"Ben Joyce" <ben.joyce-pgsql@babelfish.co.uk> writes:
> Hi. I'm from a MSSQL/mySQL background and am just poking about in PG.
> I'm using phpPgAdmin 2.3 and PostgreSQL 7.1.3.
>
> INSERT INTO "test" ("ID", "Subject", "Body", "DTS", "Archive") VALUES
> (NEXTVAL('""test_ID_seq""'::text), 'test', 'this is a test', '2003-05-20
> 16:30:42', '0')
This is wrong--the "nextval" call should look like:
NEXTVAL('"test_ID_seq"')
The '::text' cast is optional but shouldn't hurt anything.
Looks like phpPgAdmin is inserting too many quotes.
FYI: the double-quotes-within-single-quotes thing is to tell NEXTVAL
not to fold the sequence name to lower case (which it would do if you
left out the double quotes). Yes, it's a little odd. ;)
'