X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E93315287E for ; Tue, 24 May 2005 17:35:40 -0300 (ADT) 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 15494-06 for ; Tue, 24 May 2005 20:35:32 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 19289528B3 for ; Tue, 24 May 2005 17:35:30 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j4OKZU3q005462; Tue, 24 May 2005 16:35:30 -0400 (EDT) To: pg@fastcrypt.com Cc: PostgreSQL-development Subject: Re: IN/OUT parameters In-reply-to: <42937ED2.1030902@fastcrypt.com> References: <42936EF8.7000703@fastcrypt.com> <4829.1116961439@sss.pgh.pa.us> <42937ED2.1030902@fastcrypt.com> Comments: In-reply-to Dave Cramer message dated "Tue, 24 May 2005 15:21:54 -0400" Date: Tue, 24 May 2005 16:35:30 -0400 Message-ID: <5461.1116966930@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/1355 X-Sequence-Number: 68231 Dave Cramer writes: > At this point I'd just like the backend to ignore the OUT parameter if > it were set that way, but allow it to be sent. I think you're thinking at the wrong level. AIUI the issue occurs at the Parse stage, long before any parameter value is sent (or not sent). What you really want, if I'm understanding correctly, is to be able to send SQL that looks like this: SELECT * FROM myfunc($1,$2,$3); and then have some of the Param symbols be simply ignored while looking up myfunc(). This is pretty ugly in itself, and I'd not want to add a protocol change into the mix to make it happen. But possibly we could do it without any protocol-level change. What would you say to specifying that Params that are declared as type VOID are ignored in a function lookup? What this would mean is that you'd need to do the following: 1. The SQL string can look as above. 2. When sending the Parse message, you'd specify the parameter types as, say, INT4/VOID/VOID (or possibly UNKNOWN/VOID/VOID). 3. When sending Bind, you'd have to specify dummy values (probably nulls) for the VOID parameter positions. While I haven't looked at the backend code yet, I think we could drop VOID-type parameters out of the argument list of a function during parse analysis without too much trouble. This would affect *all* function calls, not only those appearing in SELECT * FROM, but I don't see any legitimate use of VOID-type values that this would interfere with. Klugy, isn't it? Anyone have a better idea? Or should we just tell Dave that the JDBC driver ought to handle it? regards, tom lane