no results for nextval() query? - Mailing list pgsql-novice

From Steve Lefevre
Subject no results for nextval() query?
Date
Msg-id 466F2301.6010309@osu.edu
Whole thread Raw
Responses Re: no results for nextval() query?  (Richard Broersma Jr <rabroersma@yahoo.com>)
List pgsql-novice
Hello all -

I'm having problems with a primary key column that has a sequence. I'm
trying to reserve a value using nextval ( I've also tried currval() ),
but my query returns no results. I was originally confused because I was
doing "SELECT nextval(column_name) FROM table" instead of "SELECT
nextval(sequence_name) FROM table". Then, I had the sequence name wrong,
so I got a "does not exist" error. However, now that I have the name
right -- and I think it's right because I don't get an error -- I get an
empty result set. What am I doing wrong? The sequence seems to be
working, because the primary key field defaults to the next value in the
sequence when I do an insert.

Steve Lefevre

pgsql-novice by date:

Previous
From: Andrew
Date:
Subject: Recovering Postgres databases
Next
From: Steve Lefevre
Date:
Subject: Joins within a table