Replies: 1 comment 8 replies
-
Cursors, are for select statements, they don't have any connection with the prepared statements.
It's a good idea to provide the exact columns and their order for the insert which you can also do when using COPY FROM, see here. Just FYI, there is also cr8 tool that allows you to do inserts independently of your application. |
Beta Was this translation helpful? Give feedback.
-
Hey guys,
I'm trying to do bulk inserts from Go and wondering what the best way to go about it is. Since cursors are now supported does that mean you can wrap many prepared statements in a transaction and then execute the transaction?
I was worried about using
COPY FROM
since the schema to this table is evolving and I'm worried about putting items in the wrong column. (If I use INSERT INTO (field1, field2, field3) then everything will match up even if the schema changes)Example of what I'm thinking of doing:
Beta Was this translation helpful? Give feedback.
All reactions