Re: update table sequence

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: e(dot)ellenkamp(at)copernicus-it(dot)nl (Egbert Ellenkamp)
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: update table sequence
Date: 2001-03-16 20:09:50
Message-ID: 25935.984773390@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

e(dot)ellenkamp(at)copernicus-it(dot)nl (Egbert Ellenkamp) writes:
> select setval('mytable_myrowid_seq',select max(myrowid) from mytable);

That should work if you put in the required parentheses around the
sub-select:

select setval('mytable_myrowid_seq', (select max(myrowid) from mytable));

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Audley 2001-03-16 22:57:14 Oracle to PostgreSQL help: What is (+) in Oracle select?
Previous Message Ross J. Reedstrom 2001-03-16 19:58:24 Re: update table sequence