INSERT and parentheses

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема INSERT and parentheses
Дата
Msg-id 4BD58DB3.4070605@cs.helsinki.fi
обсуждение исходный текст
Ответы Re: INSERT and parentheses
Re: INSERT and parentheses
Список pgsql-hackers
Hi,

This came up on IRC today and I recall several instances of this during
the last two months or so, so I decided to send a patch.  The problem in
question occurs when you have extra parentheses in an INSERT list:

INSERT INTO foo(a,b,c) SELECT (a,b,c) FROM ..; or
INSERT INTO foo(a,b,c) VALUES((0,1,2));

Both of these give you the same error:
ERROR:  INSERT has more target columns than expressions

The first version is a lot more common and as it turns out, is sometimes
very hard to spot.  This patch attaches a HINT message to these two
cases.  The message itself could probably be a lot better, but I can't
think of anything.

Thoughts?


Regards,
Marko Tiikkaja

Вложения

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

Предыдущее
От: Stefan Kaltenbrunner
Дата:
Сообщение: Re: recovery_connections cannot start (was Re: master in standby mode croaks)
Следующее
От: Robert Haas
Дата:
Сообщение: Re: recovery_connections cannot start (was Re: master in standby mode croaks)