Re: pg newbie stumped on sequences!

Lists: pgsql-general
From: "Ben Joyce" <ben(at)babelfish(dot)co(dot)uk>
To: <pgsql-general(at)postgresql(dot)org>
Subject: pg newbie stumped on sequences!
Date: 2003-05-20 14:49:35
Message-ID: DF1220D4F915D4119C6B00306E00103E02CD90C0@ids10004.idesk.plc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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.

I'm a bit stumped why I'm getting an error when trying to create new
records.

I tried the following:

CREATE TABLE "test" (
"ID" SERIAL,
"Subject" varchar (255) ,
"Body" varchar (2000) ,
"DTS" timestamp NOT NULL,
"Archive" int2 NOT NULL );

and then:

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')

and i got:

PostgreSQL said: ERROR: pg_aclcheck: class ""test_ID_seq"" not found
Your query:
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 leads me to believe i have a sequence missing, but:

test_ID_seq 1 1 2147483647 1 1 1 f f

it's there!

It's been suggested that ('""test_ID_seq""'::text) might be the issue,
irregular quoting? Odd, as this is what phpPgAdmin spewed out.

any ideas?

.b(affled)

--
ben joyce


From: Doug McNaught <doug(at)mcnaught(dot)org>
To: "Ben Joyce" <ben(at)babelfish(dot)co(dot)uk>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg newbie stumped on sequences!
Date: 2003-05-25 00:50:13
Message-ID: m3n0hbyhmi.fsf@varsoon.wireboard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

"Ben Joyce" <ben(at)babelfish(dot)co(dot)uk> writes:

> It's been suggested that ('""test_ID_seq""'::text) might be the issue,
> irregular quoting? Odd, as this is what phpPgAdmin spewed out.

This came up quite recently. The phpPgAdmin output is definitely
wrong--see if there's a newer version available.

-Doug