Re: [SQL] alter sequence + subqueries

2005-09-16 Thread Michael Fuhr
On Fri, Sep 16, 2005 at 06:36:48PM -0400, jeff sacksteder wrote: > ALTER SEQUENCE foo_id_seq > RESTART WITH (SELECT max(id) FROM foo); > > Is this syntax correct and supported? Not according to the documentation; for an alternative see the example under "User Comments": http://www.postgresql.or

Re: [SQL] alter sequence + subqueries

2005-09-16 Thread Alvaro Herrera
On Fri, Sep 16, 2005 at 06:36:48PM -0400, jeff sacksteder wrote: > 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

[SQL] alter sequence + subqueries

2005-09-16 Thread jeff sacksteder
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. T