From: | Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> |
---|---|
To: | Keith Marr <marrk(at)comcast(dot)net> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: currval and nextval in 7.3.4 |
Date: | 2003-10-24 05:41:17 |
Message-ID: | 20031023223708.J34706@megazone.bigpanda.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On Thu, 23 Oct 2003, Keith Marr wrote:
> Hi,
>
> I recently installed 7.3.4 (complete install from scratch) and both 'select
> nextval('my_seq') from my_table' and 'select currval('my_seq') from my_table'
> return a number of rows equal to the number of rows in the table.
>
> The sequence was created with a SERIAL type if that helps.
> In 'psql' the results look like this.
>
> my_db=# select nextval('my_seq') from my_table;
> nextval
> ---------
> 6
> 7
> 8
> 9
> (4 rows)
This is what you asked for, for each row of my_table, call
nextval('my_seq') and return its value as an output row.
I'd guess that maybe you just want select nextval('myseq');
but I'm not sure.
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2003-10-24 15:47:36 | Re: ISM shared memory on solaris |
Previous Message | Edmund Bacon | 2003-10-23 21:05:15 | ECPG and NULL indicators |