I have exported my local database table to a file and wish to load it to my cloud db.
when using the command: \copy <table name> from '<path>/<file name>.txt' delimiter ',' csv;
the data is copied without enforcing the unique rules that exist on the table as well as insert the ID column "as is", not following the serial numbering.
I know the command update <table name> set <id column name> = DEFAULT;
here is the tricky part: I'm exporting other tables as well that have references to eachother
is there a way to achieve these two goals?
copy
actually enforces unique constraints, and serial auto-numbering happens by default, just like with INSERT. If that doesn't work for you, please show a reproducible example or expand on the specifics of your case.