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 #11402: Prepared statement cache invalidation and unknown types
Date: Thu, 11 Sep 2014 21:58:05 +0000
Message-ID: <20140911215805.2484.10673@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:      11402
Logged by:          Marko Tiikkaja
Email address:      marko@joh.to
PostgreSQL version: 9.4beta2
Operating system:   Any
Description:        

Hi,

This might have been reported before, but I hit this quite horrible
behaviour with prepared statements this week.  Observeth:

local:marko=# create table foo(a int);
CREATE TABLE
local:marko=#* prepare qwr(unknown) as select * from foo where a = $1;
PREPARE
local:marko=#* execute qwr('1');
 a 
---
(0 rows)

local:marko=#* alter table foo alter column a type text;
ALTER TABLE
local:marko=#* execute qwr('1');
ERROR:  operator does not exist: text = integer
HINT:  No operator matches the given name and argument type(s). You might
need to add explicit type casts.

I hit the behaviour on 9.1 originally with functions, but tested it against
a reasonably fresh HEAD and it was still broken.  Somehow it seems that the
prepared statement isn't willing to forget the data type of the argument
after it has been resolved once (even though it was specified to be unknown
:-( ).  This leads to some grotesque cache invalidation code in our API.

If this has been discussed before and has been decided to not be worth
fixing, feel free to call me names, but I just thought I'd bring it to your
attention before I forget again.


-- 
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: <20140911215805.2484.10673@wrigleys.postgresql.org>
Permalink:  ../20140911215805.2484.10673@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20140911215805.2484.10673@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 #11402: Prepared statement cache invalidation and unknown types
  In-Reply-To: <20140911215805.2484.10673@wrigleys.postgresql.org>
  References: <20140911215805.2484.10673@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