Re: Need help with currval and nextvall... - Mailing list pgsql-novice

From Josh Berkus
Subject Re: Need help with currval and nextvall...
Date
Msg-id web-1837463@davinci.ethosmedia.com
Whole thread Raw
In response to Re: Need help with currval and nextvall...  (Dan Jewett <danjewett@mac.com>)
List pgsql-novice
Dan,

> I know I'm supposed to have the quotes but I keep getting :
> PostgreSQL said: ERROR: parser: parse error at or near
> "album_album_id_seq"  unless I take them out.
>
> I also tried nextval() with the same error returned: ERROR: Attribute
> 'album_album_id_seq' not found.

Because you're "nesting" quotes in a function, you'll need to double
them:
SELECT CURRVAL(''album_album_id_seq'')

And you should *not* call Nextval; the INSERT is doing that already
because of the SERIAL type on your table.

-Josh Berkus


pgsql-novice by date:

Previous
From: Philip Hallstrom
Date:
Subject: Re: Need help with currval and nextvall...
Next
From: Hugh Esco
Date:
Subject: Re: [SQL] Problems invoking psql. Help please.