Re: BUG #8870: PL/PgSQL, SELECT .. INTO and the number of result columns

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: BUG #8870: PL/PgSQL, SELECT .. INTO and the number of result columns
Дата
Msg-id 52DF1CA6.8020800@joh.to
обсуждение исходный текст
Ответ на Re: BUG #8870: PL/PgSQL, SELECT .. INTO and the number of result columns  (Marko Tiikkaja <marko@joh.to>)
Ответы Re: BUG #8870: PL/PgSQL, SELECT .. INTO and the number of result columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On 1/19/14, 1:50 AM, I wrote:
> But making this check at run time doesn't seem too hard.  How broken
> does the attached look?

A bit broken, now that I look at it in detail.  In particular, I could
see someone doing something like:

   CREATE TABLE lotsofcolumns(f1 int, f2 int, f3 int, ..);

   DECLARE
   f1 int;
   f2 int;
   BEGIN
   SELECT * INTO f1, f2 FROM lotsofcolumns;

I can't say I think this is a good idea, but not sure breaking this case
is worth it either.

In bug #8893 there was some discussion which I interpreted to mean that
we could improve this a bit by checking the number of returned columns
during compile time if there's no * in the target list.  Attached is a
crude patch attempting to do that, which appears to be working.  Any
thoughts?


Regards,
Marko Tiikkaja

Вложения

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #7730: intarray representation of empty arrays
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #8870: PL/PgSQL, SELECT .. INTO and the number of result columns