Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W4fHI-0002ic-0D for pgsql-bugs@arkaria.postgresql.org; Sat, 18 Jan 2014 23:26:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W4fHH-0000yG-2b for pgsql-bugs@arkaria.postgresql.org; Sat, 18 Jan 2014 23:26:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W4fHG-0000y9-5G for pgsql-bugs@postgresql.org; Sat, 18 Jan 2014 23:26:10 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W4fH8-0007GW-UI for pgsql-bugs@postgresql.org; Sat, 18 Jan 2014 23:26:09 +0000 MIME-Version: 1.0 Subject: BUG #8870: PL/PgSQL, SELECT .. INTO and the number of result columns To: pgsql-bugs@postgresql.org From: marko@joh.to Date: Sat, 18 Jan 2014 23:25:09 +0000 Message-ID: <20140118232509.26700.59523@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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