| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера