Re: sequence in schema -- broken default
От | Joshua D. Drake |
---|---|
Тема | Re: sequence in schema -- broken default |
Дата | |
Msg-id | 40118321.2060905@commandprompt.com обсуждение исходный текст |
Ответ на | Re: sequence in schema -- broken default ("Lee Harr" <missive@hotmail.com>) |
Ответы |
Re: sequence in schema -- broken default
|
Список | pgsql-general |
> Yes. I was just including that in case something had changed in > recent versions. I guess it just seemed strange to me that this > works ... > > # create table x (a int, b int); > CREATE TABLE > # insert into x values(5); > INSERT 18518 1 > > but this does not ... > > # insert into x values(); > ERROR: syntax error at or near ")" at character 22 > Actually if you think about it, it makes sense. At least from the example you provide. insert into x values(5) is a integer insertion, and it just inserts into the first column but the second example insert into x values() specifies a blank value. A blank is a string (versus a NULL which is nothing) and the parser barfs on it with an integer. Although you will get a different error, insert into x values ('') will also fail. Sincerely, Joshua Drake -- Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC Postgresql support, programming shared hosting and dedicated hosting. +1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
В списке pgsql-general по дате отправления: