Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 58F7F633197 for ; Wed, 15 Apr 2009 12:11:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 64940-05 for ; Wed, 15 Apr 2009 12:11:33 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 2F620632B1A for ; Wed, 15 Apr 2009 12:11:42 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n3FFBE2m010719; Wed, 15 Apr 2009 11:11:15 -0400 (EDT) To: Oliver Jowett cc: Heikki Linnakangas , John Lister , pgsql-jdbc@postgresql.org Subject: Re: Query preparation 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> Comments: In-reply-to Oliver Jowett message dated "Thu, 16 Apr 2009 01:11:30 +1200" Date: Wed, 15 Apr 2009 11:11:14 -0400 Message-ID: <10718.1239808274@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.159 tagged_above=0 required=5 tests=AWL=0.159 X-Spam-Level: X-Archive-Number: 200904/60 X-Sequence-Number: 19507 Oliver Jowett 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