pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pg@fastcrypt.com
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: IN/OUT parameters
Date: Tue, 24 May 2005 16:35:30 -0400
Message-ID: <5461.1116966930@sss.pgh.pa.us> (raw)
In-Reply-To: <42937ED2.1030902@fastcrypt.com>
References: <42936EF8.7000703@fastcrypt.com>
	<4829.1116961439@sss.pgh.pa.us>
	<42937ED2.1030902@fastcrypt.com>

Dave Cramer <pg@fastcrypt.com> 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



view thread (11+ messages)  latest in thread

Message-ID: <5461.1116966930@sss.pgh.pa.us>
Permalink:  ../5461.1116966930@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5461.1116966930@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, pg@fastcrypt.com, pgsql-hackers@postgresql.org
  Subject: Re: IN/OUT parameters
  In-Reply-To: <5461.1116966930@sss.pgh.pa.us>
  References: <42936EF8.7000703@fastcrypt.com> <4829.1116961439@sss.pgh.pa.us> <42937ED2.1030902@fastcrypt.com> <5461.1116966930@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