Thread: Fwd: Support for OUT parameters in procedures

Fwd: Support for OUT parameters in procedures

From
Dave Cramer
Date:
Just saw this on hackers.  Anyon care to comment ?

Dave Cramer
www.postgres.rocks


---------- Forwarded message ---------
From: Robert Haas <robertmhaas@gmail.com>
Date: Fri, 28 Aug 2020 at 09:31
Subject: Re: Support for OUT parameters in procedures
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>


On Fri, Aug 28, 2020 at 2:04 AM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> The handling of results of SQL statements executed at the top level
> (a.k.a. direct SQL) is implementation-specific and varies widely in
> practice.  More interesting in practice, in terms of functionality and
> also compatibility, are nested calls in PL/pgSQL as well as integration
> in JDBC.

I agree that driver integration, and in particular JDBC integration,
is important and needs some thought. I don't think it horribly
matters, with a feature like this, what shows up when people type
stuff into psql. Whatever it is, people will get used to it. But when
they interact through a driver, it's different. It is no good
inventing things, either in PostgreSQL or in the JDBC driver for
PostgreSQL, that make PostgreSQL behave differently from every other
database they use. I don't know exactly how we get to a good outcome
here, but I think it's worth some careful consideration.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: Support for OUT parameters in procedures

From
Steven Schlansker
Date:
Jdbi got a feature request for such parameters a while back:
https://github.com/jdbi/jdbi/issues/1606

The user uses Oracle which I don't really care to install.  When I tried to implement the feature using Postgres,
I found the driver support too lacking to proceed.

So there's some interest out there in making it work, and I can volunteer to at least smoke test it with my test cases...

On Mon, Oct 5, 2020 at 3:54 AM Dave Cramer <davecramer@postgres.rocks> wrote:
Just saw this on hackers.  Anyon care to comment ?

Dave Cramer
www.postgres.rocks


---------- Forwarded message ---------
From: Robert Haas <robertmhaas@gmail.com>
Date: Fri, 28 Aug 2020 at 09:31
Subject: Re: Support for OUT parameters in procedures
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>


On Fri, Aug 28, 2020 at 2:04 AM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> The handling of results of SQL statements executed at the top level
> (a.k.a. direct SQL) is implementation-specific and varies widely in
> practice.  More interesting in practice, in terms of functionality and
> also compatibility, are nested calls in PL/pgSQL as well as integration
> in JDBC.

I agree that driver integration, and in particular JDBC integration,
is important and needs some thought. I don't think it horribly
matters, with a feature like this, what shows up when people type
stuff into psql. Whatever it is, people will get used to it. But when
they interact through a driver, it's different. It is no good
inventing things, either in PostgreSQL or in the JDBC driver for
PostgreSQL, that make PostgreSQL behave differently from every other
database they use. I don't know exactly how we get to a good outcome
here, but I think it's worth some careful consideration.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: Support for OUT parameters in procedures

From
Dave Cramer
Date:


On Mon, 5 Oct 2020 at 12:17, Steven Schlansker <stevenschlansker@gmail.com> wrote:
Jdbi got a feature request for such parameters a while back:
https://github.com/jdbi/jdbi/issues/1606

The user uses Oracle which I don't really care to install.  When I tried to implement the feature using Postgres,
I found the driver support too lacking to proceed.

So there's some interest out there in making it work, and I can volunteer to at least smoke test it with my test cases...

Sure, lets see how broken it is right now.


Dave Cramer
www.postgres.rocks
 

On Mon, Oct 5, 2020 at 3:54 AM Dave Cramer <davecramer@postgres.rocks> wrote:
Just saw this on hackers.  Anyon care to comment ?

Dave Cramer
www.postgres.rocks


---------- Forwarded message ---------
From: Robert Haas <robertmhaas@gmail.com>
Date: Fri, 28 Aug 2020 at 09:31
Subject: Re: Support for OUT parameters in procedures
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>


On Fri, Aug 28, 2020 at 2:04 AM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> The handling of results of SQL statements executed at the top level
> (a.k.a. direct SQL) is implementation-specific and varies widely in
> practice.  More interesting in practice, in terms of functionality and
> also compatibility, are nested calls in PL/pgSQL as well as integration
> in JDBC.

I agree that driver integration, and in particular JDBC integration,
is important and needs some thought. I don't think it horribly
matters, with a feature like this, what shows up when people type
stuff into psql. Whatever it is, people will get used to it. But when
they interact through a driver, it's different. It is no good
inventing things, either in PostgreSQL or in the JDBC driver for
PostgreSQL, that make PostgreSQL behave differently from every other
database they use. I don't know exactly how we get to a good outcome
here, but I think it's worth some careful consideration.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: Support for OUT parameters in procedures

From
Andrew Dunstan
Date:
On 10/5/20 12:24 PM, Dave Cramer wrote:
>
>
> On Mon, 5 Oct 2020 at 12:17, Steven Schlansker
> <stevenschlansker@gmail.com <mailto:stevenschlansker@gmail.com>> wrote:
>
>     Jdbi got a feature request for such parameters a while back:
>     https://github.com/jdbi/jdbi/issues/1606
>
>     The user uses Oracle which I don't really care to install.  When I
>     tried to implement the feature using Postgres,
>     I found the driver support too lacking to proceed.
>
>     So there's some interest out there in making it work, and I can
>     volunteer to at least smoke test it with my test cases...
>
>
> Sure, lets see how broken it is right now.
>
>
>

We're working on it. It's a bit tricky, but we need to get it working,
for sure. The main thing is that the driver needs to send some type
other than VOID for the OUT param. Minimally that can be UNKNOWN, but it
should probably reflect the type set in registerOutParameter().


cheers


andrew


--
Andrew Dunstan
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company




Re: Support for OUT parameters in procedures

From
Dave Cramer
Date:


On Mon, 5 Oct 2020 at 14:59, Andrew Dunstan <andrew@dunslane.net> wrote:

On 10/5/20 12:24 PM, Dave Cramer wrote:
>
>
> On Mon, 5 Oct 2020 at 12:17, Steven Schlansker
> <stevenschlansker@gmail.com <mailto:stevenschlansker@gmail.com>> wrote:
>
>     Jdbi got a feature request for such parameters a while back:
>     https://github.com/jdbi/jdbi/issues/1606
>
>     The user uses Oracle which I don't really care to install.  When I
>     tried to implement the feature using Postgres,
>     I found the driver support too lacking to proceed.
>
>     So there's some interest out there in making it work, and I can
>     volunteer to at least smoke test it with my test cases...
>
>
> Sure, lets see how broken it is right now.
>
>
>

We're working on it. It's a bit tricky, but we need to get it working,
for sure. The main thing is that the driver needs to send some type
other than VOID for the OUT param. Minimally that can be UNKNOWN, but it
should probably reflect the type set in registerOutParameter().

I would think we run into the normal issues with things like timestamps and dates with and without time zones

Thanks,

Dave Cramer
www.postgres.rocks