X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 79C82D7BF8 for ; Tue, 8 Nov 2005 18:57:21 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 50733-10 for ; Tue, 8 Nov 2005 22:57:18 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id D2734D6F45 for ; Tue, 8 Nov 2005 18:57:19 -0400 (AST) Received: (qmail 19360 invoked from network); 8 Nov 2005 22:57:22 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 8 Nov 2005 22:57:22 -0000 In-Reply-To: <7620.1131475925@sss.pgh.pa.us> References: <22E34B35-1D29-4DCD-BF81-8AF3CFEAC94B@fastcrypt.com> <7620.1131475925@sss.pgh.pa.us> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <5BDF1E2A-B7FB-4B91-9154-590F3FED0249@fastcrypt.com> Cc: Kris Jurka , List Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: use of OID.Unknown Date: Tue, 8 Nov 2005 17:57:20 -0500 To: Tom Lane X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.022 required=5 tests=[AWL=0.022] X-Spam-Score: 0.022 X-Spam-Level: X-Archive-Number: 200511/62 X-Sequence-Number: 14160 On 8-Nov-05, at 1:52 PM, Tom Lane wrote: > Kris Jurka writes: >> I don't think this is a simple switch we should throw in a minor >> revision >> either. The real source of our problems is that for performance >> reasons >> we never issue a Describe Statement protocol message. > > No, I don't think that's the issue; the part that I'm worried about is > this one: > >> Finally there are a few cases where the server simply cannot >> resolve the >> provided type and bails out with an error message. If using the JDBC >> setXXX provided types, these work. Consider "SELECT ? IS NULL" or an >> overloaded function that cannot be resolved. > > Sending UNKNOWN creates a risk that the server will barf because it > can't guess the right data type. > > Now, if you are proposing to send a parameter marked UNKNOWN in > exactly > the same cases where the previous driver release would have sent an > undecorated string literal, then I'm mostly OK with it --- the > behavior > at least won't be a regression, because an undecorated string literal > is also taken as UNKNOWN to start with. At this point that is what I would be advocating. It appears that using UNKNOWN for the general case is fraught with problems. Previously we had advocated using setString for postgres types which do not have jdbc counterparts such as inet, or interval. The current driver breaks this behaviour. > > I remembered what it was that was nagging me about having seen this > before --- didn't we try using UNKNOWN to avoid having to choose > between > timestamp with/without time zone, and didn't that idea crash and burn? > It'd be a good idea to go back and look at the details before thinking > of adopting UNKNOWN in a more general context. Agreed. > > regards, tom lane > > ---------------------------(end of > broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match >