The postgres-specific sql extension 'ALTER SEQUENCE' does not appear to support subqueries.
I have inserted some data into a table, including values in the primary
key. I want to reset the associated sequence so that any further
records to be inserted into that table resume numbering
correctly. The statement I attempted was:
ALTER SEQUENCE foo_id_seq
RESTART WITH (SELECT max(id) FROM foo);
Is this syntax correct and supported?
- [SQL] alter sequence + subqueries jeff sacksteder
- Re: [SQL] alter sequence + subqueries Alvaro Herrera
- Re: [SQL] alter sequence + subqueries Michael Fuhr