pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: dmitigr@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #8046: PL/pgSQL plan caching regression
Date: Mon, 08 Apr 2013 21:33:24 +0000
Message-ID: <E1UPJgq-0005C1-Ap@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:      8046
Logged by:          Dmitriy Igrishin
Email address:      dmitigr@gmail.com
PostgreSQL version: 9.2.4
Operating system:   Linux Debian Wheezy x64
Description:        

-- -*- 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 = $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;




-- 
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 (3+ messages)  latest in thread

Message-ID: <E1UPJgq-0005C1-Ap@wrigleys.postgresql.org>
Permalink:  ../E1UPJgq-0005C1-Ap@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1UPJgq-0005C1-Ap@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: dmitigr@gmail.com
  Subject: Re: BUG #8046: PL/pgSQL plan caching regression
  In-Reply-To: <E1UPJgq-0005C1-Ap@wrigleys.postgresql.org>
  References: <E1UPJgq-0005C1-Ap@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