Problems importing to Postgresql using auto-generated id

  • 209Views
  • Last Post 19 February 2019
0
votes
Elena O'Neil posted this 18 February 2019

Hi,

I would like to import new rows into a Postgresql table where the primary key uses uuid_generate_v4() to generate unique Id's. The problem is that Skyvia requires me to map that Id field, even though it will auto-populate on insert. Is it possible to leave the target id unmapped to allow for the database to create the id? Any help would be much appreciated. Thanks in advance. 

0
votes
Mariia Zaharova posted this 19 February 2019

Hi Elena!

In case if you are using UPSERT operation in your package then ID mapping is required. The UPSERT operation updates a record if it exists or inserts a new record. This allows you to avoid inserting duplicate data. In Skyvia, UPSERT determines what action to perform in the following way: if a Null value is specified for the ID or primary key, UPSERT operation inserts the record, and if a non-null value is specified, UPSERT operation tries to update the record with the specified ID or primary key. Please refer to:

https://skyvia.com/resources/docs/index.html?performing_upsert_operation.htm

https://skyvia.com/resources/docs/index.html?lookup_mapping.htm

 

If you are using INSERT operation, then please send us DDL script of your target PostgreSQL table.

Thank you and looking forward to your reply.

 

Best regards,

Mariia

Close