Trouble adding a record to a table in db

Hello, I am receiving persistent error when trying to add a record to a table in my database.

I have a web app with a form that triggers a query to populate the new row with data.

When I try to do this by writing the query in GUI mode I get the error message 'you must satisfy the constraint "tablename" pkey'. Primary key column in table is just a simple id column that increments by one. My query omits it because I thought the database fills it in automatically.

When I tried to write the SQL query manually using INSERT INTO tablename (column1,column2...) values (value1,value2...) I get a different error message. 'duplicate key value violates unique constraint "tablename_pkey"' even though I did not specify a primary key value so it can not be duplicate.

On a different table, when attempting to do the same thing (insert new record) I get an error message that the query violates a not-null constraint on primary key. Again, I'm not sure what the issue is even though the error seems to be different.

Is this a bug or am I doing something wrong? I don't have much (any) prior coding experience and after over 5 hours haven't been able to figure this out so would really appreciate any help.

Hello, this is my table settings for the primary key

You can insert new records like this:

Ensure that your form fields "Form data key" match the table column headers
image

Animation

I had this error as well until I realized that I created the table with a "UUID" instead of a "Primary Key" field. I couldn't find a simple way to convert it in PostgreSQL, but it was a small test table, so recreating it with the PK solved the problem.

@adam1 I am having the same issue when trying to add records to a db in bulk.

@Oscar_Ortega I can get it working using your method when adding one record at a time via a form. But for my use case I need to add lots of records in bulk in an array to the db. Do you have any suggestions for how I ensure the primary id auto increments for each record i'm trying to insert?

UPDATE
I figured this out, I was using the wrong option in the GUI. I was using 'Bulk insert records' when i should have been using 'Bulk upsert via a primary key'. Then just omit the primary key in the array.