pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: marko@joh.to
To: pgsql-bugs@postgresql.org
Subject: BUG #8870: PL/PgSQL, SELECT .. INTO and the number of result columns
Date: Sat, 18 Jan 2014 23:25:09 +0000
Message-ID: <20140118232509.26700.59523@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      8870
Logged by:          Marko Tiikkaja
Email address:      marko@joh.to
PostgreSQL version: 9.3.2
Operating system:   OS X
Description:        

I looked more closely into a gripe from Stephen Frost, which lead me into
discovering this behaviour:

=# create function f() returns void as
-# $$declare
$#   f1 int;
$# begin
$# select 1, 2 into f1;
$# end
$# $$ language plpgsql;
CREATE FUNCTION
=# select f();
 f 
---
 
(1 row)

Which directly contradicts this statement in the docs
(http://www.postgresql.org/docs/9.3/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-ONEROW):

"If a row or a variable list is used as target, the query's result columns
must exactly match the structure of the target as to number and data types,
or else a run-time error occurs."

This seems to have been broken by commit
8bb3c8fe5413103c30ba8d1bcb3a1f8e46bddf3d.  I strongly believe the
documentation is right in this case, and the behaviour ought to change.


-- 
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: <20140118232509.26700.59523@wrigleys.postgresql.org>
Permalink:  ../20140118232509.26700.59523@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20140118232509.26700.59523@wrigleys.postgresql.org

 · 

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: marko@joh.to
  Subject: Re: BUG #8870: PL/PgSQL, SELECT .. INTO and the number of result columns
  In-Reply-To: <20140118232509.26700.59523@wrigleys.postgresql.org>
  References: <20140118232509.26700.59523@wrigleys.postgresql.org>

* 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