pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Oliver Jowett <oliver@opencloud.com>
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: John Lister <john.lister-ps@kickstone.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Query preparation
Date: Wed, 15 Apr 2009 11:11:14 -0400
Message-ID: <10718.1239808274@sss.pgh.pa.us> (raw)
In-Reply-To: <49E5DD02.2060909@opencloud.com>
References: <49E4A6FA.7050407@kickstone.com>
	<49E4AEAC.5000700@opencloud.com>
	<49E4F20C.6040900@kickstone.com>
	<18961.1239742344@sss.pgh.pa.us>
	<49E4FBB0.40405@kickstone.com>
	<49E5D64F.8010603@enterprisedb.com>
	<49E5DD02.2060909@opencloud.com>

Oliver Jowett <oliver@opencloud.com> writes:
> Heikki Linnakangas wrote:
>> Does anyone see a problem with caching the result set descriptor
>> (RowDescription)? AFAICS it should never change after a statement is
>> prepared. If not, I'll polish up and submit the patch.

> If you tie it to the existing named statement mechanisms I think that
> works. We invalidate the named statement anyway if the parameter types
> change, and you want to invalidate any cached row description at the
> same time. Schema changes could bite you, but I think they bite named
> statements in other ways anyway. (Not sure how far the server-side
> efforts to do plan invalidation progressed)

It should be safe.  The server is set up to throw an error if you try to
re-use a prepared statement whose output tuple descriptor would have
changed due to schema changes.  So there's a backstop if the driver's
invalidation logic misses anything.

			regards, tom lane



view thread (15+ messages)  latest in thread

Message-ID: <10718.1239808274@sss.pgh.pa.us>
Permalink:  ../10718.1239808274@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10718.1239808274@sss.pgh.pa.us

 · 

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-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, oliver@opencloud.com, heikki.linnakangas@enterprisedb.com, john.lister-ps@kickstone.com
  Subject: Re: Query preparation
  In-Reply-To: <10718.1239808274@sss.pgh.pa.us>
  References: <49E4A6FA.7050407@kickstone.com> <49E4AEAC.5000700@opencloud.com> <49E4F20C.6040900@kickstone.com> <18961.1239742344@sss.pgh.pa.us> <49E4FBB0.40405@kickstone.com> <49E5D64F.8010603@enterprisedb.com> <49E5DD02.2060909@opencloud.com> <10718.1239808274@sss.pgh.pa.us>

* 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