Re: pg newbie stumped on sequences!

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: pg newbie stumped on sequences!
Дата
Msg-id m31xyt5zka.fsf@varsoon.wireboard.com
обсуждение исходный текст
Ответ на pg newbie stumped on sequences!  ("Ben Joyce" <ben.joyce-pgsql@babelfish.co.uk>)
Список pgsql-general
"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.  ;)

'

В списке pgsql-general по дате отправления:

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: pg newbie stumped on sequences!
Следующее
От: Mike Benoit
Дата:
Сообщение: Re: disk space usage enlarging despite vacuuming