Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UPJh5-0003ks-C5 for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Apr 2013 21:33:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UPJh4-0007J7-Lx for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Apr 2013 21:33:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UPJh3-0007J1-RQ for pgsql-bugs@postgresql.org; Mon, 08 Apr 2013 21:33:37 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UPJgw-00012s-IZ for pgsql-bugs@postgresql.org; Mon, 08 Apr 2013 21:33:37 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UPJgv-00024O-I2 for pgsql-bugs@postgresql.org; Mon, 08 Apr 2013 21:33:29 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1UPJgq-0005C1-Ap for pgsql-bugs@postgresql.org; Mon, 08 Apr 2013 21:33:24 +0000 Date: Mon, 08 Apr 2013 21:33:24 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #8046: PL/pgSQL plan caching regression To: pgsql-bugs@postgresql.org From: dmitigr@gmail.com X-Pg-Spam-Score: -3.4 (---) 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: 8046 Logged by: Dmitriy Igrishin Email address: dmitigr@gmail.com PostgreSQL version: 9.2.4 Operating system: Linux Debian Wheezy x64 Description:=20=20=20=20=20=20=20=20 -- -*- sql -*- -- A bug test case. -- PostgreSQL 9.2.4 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.7.2-5) 4.7.2, 64-bit BEGIN; CREATE OR REPLACE FUNCTION rec(type_name_ regclass, id_ bigint) RETURNS record LANGUAGE plpgsql STABLE AS $function$ DECLARE r_ record; BEGIN EXECUTE 'SELECT * FROM '||type_name_::text||' WHERE id =3D $1' INTO r_ USING id_; RAISE NOTICE '%', pg_typeof(r_.id); RETURN r_; END; $function$; CREATE TABLE t1 (id integer); CREATE TABLE t2 (id bigint); SELECT rec('t1', 1); -- NOTICE: integer SELECT rec('t2', 2); -- Should NOTICE: bigint, but RAISE ERROR: type of parameter 5 (bigint) does not match that when preparing the plan (integer) ROLLBACK; --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs