X-Original-To: pgsql-interfaces-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id AB4109FB391 for ; Mon, 14 Aug 2006 12:27:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 13387-05-5 for ; Mon, 14 Aug 2006 15:26:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id E58FD9FB387 for ; Mon, 14 Aug 2006 12:23:25 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7EFNMPA009626; Mon, 14 Aug 2006 11:23:22 -0400 (EDT) To: Andro cc: pgsql-interfaces@postgresql.org Subject: Re: leaving out paramTypes parameter In-reply-to: References: Comments: In-reply-to Andro message dated "Mon, 14 Aug 2006 15:38:23 +0200" Date: Mon, 14 Aug 2006 11:23:22 -0400 Message-ID: <9625.1155569002@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200608/20 X-Sequence-Number: 6234 Andro writes: > they both require "paramTypes" parameter, but documentation says "If > paramTypes is NULL, or any particular element in the array is zero, > the server assigns a data type to the parameter symbol in the same way > it would do for an untyped literal string." > How reliable is that? Can we really leave out this parameter anytime? Like it says, you get the same results you would get from writing a literal string 'foo' where the parameter symbol is. If you like, you can force the type decision with a cast in the query text, eg "SELECT ... WHERE x = $1::int8 ... " In some ways this is better than using paramTypes because you don't have to mess with numeric OIDs for data types. regards, tom lane