pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marko Tiikkaja <marko@joh.to>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8870: PL/PgSQL, SELECT .. INTO and the number of result columns
Date: Tue, 21 Jan 2014 21:48:08 -0500
Message-ID: <25096.1390358888@sss.pgh.pa.us> (raw)
In-Reply-To: <52DF1CA6.8020800@joh.to>
References: <20140118232509.26700.59523@wrigleys.postgresql.org>
	<25794.1390089578@sss.pgh.pa.us>
	<52DB2139.20604@joh.to>
	<52DF1CA6.8020800@joh.to>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Marko Tiikkaja <marko@joh.to> writes:
> 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.

Um, I thought the whole point was to complain about that.  If this isn't a
mistake, how can you consistently maintain the other one is?

> 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?

Ick.  I thought you wanted to do this at first execution, anyway, not in
pl_gram.y.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (11+ messages)  latest in thread

Message-ID: <25096.1390358888@sss.pgh.pa.us>
Permalink:  ../25096.1390358888@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25096.1390358888@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, marko@joh.to
  Subject: Re: BUG #8870: PL/PgSQL, SELECT .. INTO and the number of result columns
  In-Reply-To: <25096.1390358888@sss.pgh.pa.us>
  References: <20140118232509.26700.59523@wrigleys.postgresql.org> <25794.1390089578@sss.pgh.pa.us> <52DB2139.20604@joh.to> <52DF1CA6.8020800@joh.to> <25096.1390358888@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox