Skip to main content
Question

Error on inserting in a PostgreSQL table with Composite Primary Key. Attribute id is not added to the Insert query


dvazquez
Participant
Forum|alt.badge.img

Hi!

I’m using FME Workbench 2022.

I’m trying to insert some data in a table in PostgreSQL. The table has a composite key, like this: (id, feed_id, env_id). The table, obviously, has the constraint: CONSTRAINT agency_pkey PRIMARY KEY (id, feed_id, env_id).

In FME, I’m reading from a GTFS file, doing some transformations, and then, trying to write into the DB with a FeatureWriter using PostgreSQL as Format. I have all the configurations right. I checked it so many times, and before posting this question, I talked to some experienced mates.

The problem I have is, in runtime, the FeatureWriter is not adding the attribute called “id” to the insert, so the database is sending the error “null value in column id violates not null constraint”. It happens with and without bulk mode.

Now I’ll provide some images for visual context and information.

Flux:

Data in logger:

FeatureWriter Parameters:

FeatureWriter User Attributes:

I added the Debug to the log to see what is happening in the FeatureWriter. This is the SQL query that is creating, which does not include the id:

 

Could someone please help me with this? I really don’t know what is happening. Thanks!

0 replies

Be the first to reply!

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings