Re: BUG #11402: Prepared statement cache invalidation and unknown types

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #11402: Prepared statement cache invalidation and unknown types
Date: 2014-09-12 08:20:29
Message-ID: 5412ACCD.8090609@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 9/12/14, 3:55 AM, Tom Lane wrote:
> marko(at)joh(dot)to writes:
>> 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.
>
> I'm not exactly convinced that this is a bug. Having a prepared statement
> silently change its input parameter types seems a lot more dangerous than
> just failing; especially since we lack any signaling mechanism by which
> the client application could be warned that whatever it may have known
> about the statement is now invalid.

Yeah, that's probably fair. I guess it's possible for an app to use
unknown type parameters and then ask the database about the data types
and do something different based on that.

I'll just have to live with the (increasingly) horrible logic. Thanks
for your reply.

.marko

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Roman Konoval 2014-09-12 09:15:26 Re: Memory leak during delete with sequential scan
Previous Message Michael Paquier 2014-09-12 05:25:50 Re: BUG #11399: CreateUser error when upgrading