New answers tagged

0 votes

(PostgreSQL) Insert a tuple containing specific value in a column linked to a sequence

You get the error because the column is created with "GENERATED ALWAYS". If you use "GENERATED BY DEFAULT" instead then you can insert values into the column, and in this case it ...
bobflux's user avatar
  • 1,436
2 votes
Accepted

(PostgreSQL) Insert a tuple containing specific value in a column linked to a sequence

Fortunately, PostgreSQL error messages are quite helpful. Following the hint shown by the PostgreSQl engine, I added the instruction "OVERRIDING SYSTEM VALUE" and it worked flawlessly: ...
ValerioOliveira's user avatar
1 vote

Replace "INSERT" by "UPDATE"

Take a database snapshot before you start. If you mess up restore from that snapshot, fix your script and repeat. Restore from snapshot will be faster than taking a full database backup and restoring ...
Michael Green's user avatar
1 vote
Accepted

Replace "INSERT" by "UPDATE"

You can't just find and replace INSERT with UPDATE and have it work, the command syntaxes are completely different. If you want to get back to the EXACT state you were in before you started this, ...
Jonathan Fite's user avatar
1 vote
Accepted

Moving records between tables in CockroachDB is taking too long

In CockroachDB, doing an INSERT INTO <table> SELECT * FROM <other_table>; operation is generally a bad idea. I would suggest using CREATE TABLE AS syntax (https://www.cockroachlabs.com/...
jhatcher9999's user avatar

Top 50 recent answers are included