Re: Question on INSERT statement

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: "raptor@tvskat.net"
Дата:
Сообщение: enumerated type..
Следующее
От: Franco Bruno Borghesi
Дата:
Сообщение: Re: enumerated type..