| От | Tom Lane |
|---|---|
| Тема | Re: Question on INSERT statement |
| Дата | |
| Msg-id | 16738.1090244762@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Question on INSERT statement (Geoffrey KRETZ <gk@4js.com>) |
| Список | pgsql-general |
Geoffrey KRETZ <gk@4js.com> writes:
> I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching
> the following request :
> INSERT INTO temp_tab VALUES (1,2,3)
> It will insert the values in the three first row whereas with informix
> or db2 for exemple, it will return an error.
This is an extension to the spec - per SQL92 it would be right to throw
an error. However Postgres has always behaved this way and we're not
likely to change it. (I think it's a hangover from PostQUEL.) Many
people find it to be a convenient behavior.
If you want an error then specify an explicit column list:
INSERT INTO temp_tab (f1,f2,f3,f4,f5) VALUES (1,2,3)
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера