Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-10 Thread Bruce Momjian
Pavel Stehule wrote: > 2010/9/9 Tom Lane : > > Darren Duncan writes: > >> Since Pg's FUNCTION already seems to take on both roles, so overloading the > >> meaning of the FUNCTION keyword, like what a C function or a Perl sub does, > >> where returning VOID means procedure, then what is being added

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Darren Duncan
Peter Eisentraut wrote: On tor, 2010-09-09 at 13:08 -0700, Darren Duncan wrote: Since Pg's FUNCTION already seems to take on both roles, so overloading the meaning of the FUNCTION keyword, like what a C function or a Perl sub does, where returning VOID means procedure, then what is being added b

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Peter Eisentraut
On tor, 2010-09-09 at 16:16 -0400, Tom Lane wrote: > You might care to go back and re-read some of the extensive prior > threads about this, but to my mind the main thing that would justify > inventing a separate PROCEDURE facility is if procedures were to > execute outside the transaction system,

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Peter Eisentraut
On tor, 2010-09-09 at 13:08 -0700, Darren Duncan wrote: > Since Pg's FUNCTION already seems to take on both roles, so > overloading the meaning of the FUNCTION keyword, like what a C > function or a Perl sub does, where returning VOID means procedure, > then what is being added by a distinct PROCED

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
2010/9/9 Darren Duncan : > Kevin Grittner wrote: >> >> Tom Lane wrote: >>> >>> to my mind the main thing that would justify inventing a separate >>> PROCEDURE facility is if procedures were to execute outside the >>> transaction system, so that they could start and stop transactions >>> for themse

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Darren Duncan
Tom Lane wrote: One point that has to be made is that returning multiple result sets as if they were successive queries restricts the client to reading the result sets serially; that is, you must read all of result A before you can look at result B, etc. One aspect that I don't really like abou

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
2010/9/9 Kevin Grittner : > Tom Lane wrote: > >> I'm with Robert: this would be a huge extra complication for a >> remarkably small amount of benefit. > > This is probably heresy, but unless it's required by the standard or > drop-dead simple to allow, I'd be fine with *not* supporting > overloadi

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
2010/9/9 Tom Lane : > Pavel Stehule writes: >> 2010/9/9 Robert Haas : >>> That seems like a lot of complexity for no real benefit, to me. > >> no, you can to specify a expected result type - it's very  for some >> convert or import functions. So we expect so out procedures will >> supports to OUT

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Kevin Grittner
Tom Lane wrote: > I'm with Robert: this would be a huge extra complication for a > remarkably small amount of benefit. This is probably heresy, but unless it's required by the standard or drop-dead simple to allow, I'd be fine with *not* supporting overloading of stored procedure names based o

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Tom Lane
Pavel Stehule writes: > 2010/9/9 Robert Haas : >> That seems like a lot of complexity for no real benefit, to me. > no, you can to specify a expected result type - it's very for some > convert or import functions. So we expect so out procedures will > supports to OUT parameters, then implementat

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Darren Duncan
Kevin Grittner wrote: Tom Lane wrote: to my mind the main thing that would justify inventing a separate PROCEDURE facility is if procedures were to execute outside the transaction system, so that they could start and stop transactions for themselves. That is the biggest distinction in my mind

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Kevin Grittner
Tom Lane wrote: > I don't understand the point of a RETURN value when there can be > no caller to return a value to. The version of the draft standard I last saw allowed something like: SET x = CALL sp(param_a, param_b); I seem to remember Sybase supported a return value as well as OUT par

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Tom Lane
Robert Haas writes: > To be honest, I am already pretty unhappy with > the changes that make it impossible to redefined foo(a int) as > foo(anteater int), which is a perfectly reasonable thing to want to do > but which is now forbidden because someone MIGHT have called the > function as foo(a := 3

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
2010/9/9 Robert Haas : > On Thu, Sep 9, 2010 at 4:29 PM, Pavel Stehule wrote: so I can to write CREATE PROCEDURE foo(OUT a int) ... and CREATE PROCEDURE foo(OUT a varchar) ... and then when I use a statement CALL is correct procedure selected

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Tom Lane
"Kevin Grittner" writes: > Tom Lane wrote: >> to my mind the main thing that would justify inventing a separate >> PROCEDURE facility is if procedures were to execute outside the >> transaction system, so that they could start and stop transactions >> for themselves. > That is the biggest disti

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
2010/9/9 Robert Haas : > On Thu, Sep 9, 2010 at 4:29 PM, Pavel Stehule wrote: so I can to write CREATE PROCEDURE foo(OUT a int) ... and CREATE PROCEDURE foo(OUT a varchar) ... and then when I use a statement CALL is correct procedure selected

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Robert Haas
On Thu, Sep 9, 2010 at 4:29 PM, Pavel Stehule wrote: >>> so I can to write >>> >>> CREATE PROCEDURE foo(OUT a int) >>> ... >>> >>> and >>> CREATE PROCEDURE foo(OUT a varchar) >>> ... >>> >>> and then when I use a statement CALL is correct procedure selected >>> >>> CALL foo(textvariable) >> >> Tha

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
2010/9/9 Darren Duncan : > Tom Lane wrote: >> >> Darren Duncan writes: >>> >>> Since Pg's FUNCTION already seems to take on both roles, so overloading >>> the meaning of the FUNCTION keyword, like what a C function or a Perl sub >>> does, where returning VOID means procedure, then what is being ad

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Darren Duncan
Tom Lane wrote: Darren Duncan writes: Since Pg's FUNCTION already seems to take on both roles, so overloading the meaning of the FUNCTION keyword, like what a C function or a Perl sub does, where returning VOID means procedure, then what is being added by a distinct PROCEDURE? You might car

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
2010/9/9 Robert Haas : > On Thu, Sep 9, 2010 at 4:17 PM, Pavel Stehule wrote: >> 2010/9/9 Darren Duncan : >>> Pavel Stehule wrote: there are lot of questions - and I am not sure if procedures implementation can be done in one release cycle. The basic questions: * should be

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Kevin Grittner
Tom Lane wrote: > to my mind the main thing that would justify inventing a separate > PROCEDURE facility is if procedures were to execute outside the > transaction system, so that they could start and stop transactions > for themselves. That is the biggest distinction in my mind, too. Support

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
2010/9/9 Tom Lane : > Darren Duncan writes: >> Since Pg's FUNCTION already seems to take on both roles, so overloading the >> meaning of the FUNCTION keyword, like what a C function or a Perl sub does, >> where returning VOID means procedure, then what is being added by a distinct >> PROCEDURE? >

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Robert Haas
On Thu, Sep 9, 2010 at 4:17 PM, Pavel Stehule wrote: > 2010/9/9 Darren Duncan : >> Pavel Stehule wrote: >>> >>> there are lot of questions - and I am not sure if procedures >>> implementation can be done in one release cycle. The basic questions: >>> >>> * should be special catalog for procedures

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
2010/9/9 Darren Duncan : > Pavel Stehule wrote: >> >> there are lot of questions - and I am not sure if procedures >> implementation can be done in one release cycle. The basic questions: >> >> * should be special catalog for procedures or we will use pg_proc? >> * how can be implemented OUT variab

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Tom Lane
Darren Duncan writes: > Since Pg's FUNCTION already seems to take on both roles, so overloading the > meaning of the FUNCTION keyword, like what a C function or a Perl sub does, > where returning VOID means procedure, then what is being added by a distinct > PROCEDURE? You might care to go bac

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Darren Duncan
Pavel Stehule wrote: there are lot of questions - and I am not sure if procedures implementation can be done in one release cycle. The basic questions: * should be special catalog for procedures or we will use pg_proc? * how can be implemented OUT variables - the original implementation is simpl

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
2010/9/9 Alvaro Herrera : > Excerpts from Pavel Stehule's message of jue sep 09 14:29:57 -0400 2010: > >> * how can be implemented OUT variables - the original implementation >> is simple - it's just pointer, but it's not directly possible inside >> postgres, because we use a MemoryContexts? > > Wh

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Alvaro Herrera
Excerpts from Pavel Stehule's message of jue sep 09 14:29:57 -0400 2010: > * how can be implemented OUT variables - the original implementation > is simple - it's just pointer, but it's not directly possible inside > postgres, because we use a MemoryContexts? Why is this a problem? Just return a

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
2010/9/9 Tom Lane : > Pavel Stehule writes: >> 2010/9/9 David E. Wheeler : >>> On Sep 9, 2010, at 12:12 AM, Pavel Stehule wrote: about 2 months for full time and 2 months for partial time - is my tip >>> >>> Two months full or two months partial? I'll take the latter, please! > >> 2 months -

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
2010/9/9 Tom Lane : > Pavel Stehule writes: >> 2010/9/9 David E. Wheeler : >>> On Sep 9, 2010, at 12:12 AM, Pavel Stehule wrote: about 2 months for full time and 2 months for partial time - is my tip >>> >>> Two months full or two months partial? I'll take the latter, please! > >> 2 months -

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Tom Lane
Pavel Stehule writes: > 2010/9/9 David E. Wheeler : >> On Sep 9, 2010, at 12:12 AM, Pavel Stehule wrote: >>> about 2 months for full time and 2 months for partial time - is my tip >> >> Two months full or two months partial? I'll take the latter, please! > 2 months - basic implementation > 1 mon

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
2010/9/9 David E. Wheeler : > On Sep 9, 2010, at 12:12 AM, Pavel Stehule wrote: > >> about 2 months for full time and 2 months for partial time - is my tip > > Two months full or two months partial? I'll take the latter, please! 2 months - basic implementation 1 months - cleaning and work on commi

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread David E. Wheeler
On Sep 9, 2010, at 12:12 AM, Pavel Stehule wrote: > about 2 months for full time and 2 months for partial time - is my tip Two months full or two months partial? I'll take the latter, please! David -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your su

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread Pavel Stehule
Cc: PostgreSQL-development > Sent: Fri, September 3, 2010 1:07:03 PM > Subject: Re: [HACKERS] returning multiple result sets from a stored procedure > > >> I noticed in postgres you cannot return multiple result sets from a >> stored procedure (surprisingly as it looks like

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-09 Thread John Adams
OK, how much are we talking about? From: Josh Berkus To: John Adams Cc: PostgreSQL-development Sent: Fri, September 3, 2010 1:07:03 PM Subject: Re: [HACKERS] returning multiple result sets from a stored procedure > I noticed in postgres you cannot ret

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-07 Thread Merlin Moncure
On Sun, Sep 5, 2010 at 2:26 PM, Peter Eisentraut wrote: > On fre, 2010-09-03 at 16:18 -0400, Tom Lane wrote: >> Part of the reason it's sat on TODO is lack of consensus about how >> such a feature ought to look/work; particularly since most of the >> discussion about it has considered that it'd go

Re: OT: OFF TOPIC: [HACKERS] returning multiple result sets from a stored procedure

2010-09-06 Thread Robert Haas
On Fri, Sep 3, 2010 at 4:40 PM, John Adams wrote: > If you guys care about money and time why would you spend the best years of > your life basically copying commercial products for free? I don't work for free. :-) There was a point at which this was just a hobby for me, but as it has since tur

Re: OT: OFF TOPIC: [HACKERS] returning multiple result sets from a stored procedure

2010-09-06 Thread David Fetter
On Fri, Sep 03, 2010 at 01:40:56PM -0700, John Adams wrote: > OT: > > OFF TOPIC: > I honestly do not mean any offence, just out of curiosity. > If you guys care about money and time why would you spend the best > years of your life basically copying commercial products for free? > Because for a

Re: OT: OFF TOPIC: [HACKERS] returning multiple result sets from a stored procedure

2010-09-06 Thread David E. Wheeler
On Sep 6, 2010, at 12:07 AM, Pavel Stehule wrote: > The work on PostgreSQL is adventure, and very good experience, very > good school for me. It's job only for people who like programming, who > like hacking, it isn't job for people, who go to office on 8 hours. > Next I use PostgreSQL for my job

Re: OT: OFF TOPIC: [HACKERS] returning multiple result sets from a stored procedure

2010-09-06 Thread Pavel Stehule
one, and money is important, but not on top for me - life have to be adventure! Regards Pavel Stehule > > John > > > From: Josh Berkus > To: John Adams > Cc: PostgreSQL-development > Sent: Fri, September 3, 2010 1:07:03 PM > Subject:

OT: OFF TOPIC: [HACKERS] returning multiple result sets from a stored procedure

2010-09-05 Thread John Adams
John From: Josh Berkus To: John Adams Cc: PostgreSQL-development Sent: Fri, September 3, 2010 1:07:03 PM Subject: Re: [HACKERS] returning multiple result sets from a stored procedure > I noticed in postgres you cannot return multiple result sets from a

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-05 Thread Andrew Chernow
On 9/5/2010 2:05 PM, Heikki Linnakangas wrote: On 04/09/10 17:16, Merlin Moncure wrote: Curious: is mulitset handling as you see it supported by the current v3 protocol? The manual says: The response to a SELECT query (or other queries that return row sets, such as EXPLAIN or SHOW) normally

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-05 Thread Peter Eisentraut
On fre, 2010-09-03 at 16:18 -0400, Tom Lane wrote: > Part of the reason it's sat on TODO is lack of consensus about how > such a feature ought to look/work; particularly since most of the > discussion about it has considered that it'd go along with stored > procedures executing outside of transacti

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-05 Thread Tom Lane
Heikki Linnakangas writes: > On 04/09/10 17:16, Merlin Moncure wrote: >> Curious: is mulitset handling as you see it supported by the current >> v3 protocol? > If a multiple return sets from a procedure are returned just like > multiple return sets from multiple queries, that's already covered b

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-05 Thread Heikki Linnakangas
On 04/09/10 17:16, Merlin Moncure wrote: Curious: is mulitset handling as you see it supported by the current v3 protocol? The manual says: The response to a SELECT query (or other queries that return row sets, such as EXPLAIN or SHOW) normally consists of RowDescription, zero or more DataR

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-04 Thread Pavel Stehule
2010/9/4 Merlin Moncure : > On Sat, Sep 4, 2010 at 10:10 AM, Pavel Stehule > wrote: >>> Also as mentioned upthread there are effective workarounds if you poke >>> around a bit.  This is a FAQ, and there are about 3-4 solid methods >>> (if you search the archives) that cover most problems you woul

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-04 Thread Merlin Moncure
On Sat, Sep 4, 2010 at 10:10 AM, Pavel Stehule wrote: >> Also as mentioned upthread there are effective workarounds if you poke >> around a bit.  This is a FAQ, and there are about 3-4 solid methods >> (if you search the archives) that cover most problems you would be >> looking at multiple result

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-04 Thread Pavel Stehule
2010/9/4 Merlin Moncure : > On Fri, Sep 3, 2010 at 4:07 PM, Josh Berkus wrote: >> >>> I noticed in postgres you cannot return multiple result sets from a >>> stored procedure (surprisingly as it looks like a very good dbms). >> >> That feature has been on the TODO list for years.  However, nobody

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-04 Thread Merlin Moncure
On Fri, Sep 3, 2010 at 4:07 PM, Josh Berkus wrote: > >> I noticed in postgres you cannot return multiple result sets from a >> stored procedure (surprisingly as it looks like a very good dbms). > > That feature has been on the TODO list for years.  However, nobody has > stepped forward to either w

Re: OT: OFF TOPIC: [HACKERS] returning multiple result sets from a stored procedure

2010-09-03 Thread Josh Berkus
On 9/3/10 2:20 PM, Josh Berkus wrote: > However, if you look at any mature, large open > source project you will find that at least 1/4 of its code contributors > are paid to work on the project by *someone*, and that those paid > developers account for 70% to 95% of the code. Relevant link for th

Re: OT: OFF TOPIC: [HACKERS] returning multiple result sets from a stored procedure

2010-09-03 Thread Josh Berkus
John, > I honestly do not mean any offence, just out of curiosity. > > If you guys care about money and time why would you spend the best years > of your life basically copying commercial products for free? We don't do it to copy commercial products. We do it to build something better than them

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-03 Thread Tom Lane
Josh Berkus writes: >> I noticed in postgres you cannot return multiple result sets from a >> stored procedure (surprisingly as it looks like a very good dbms). > That feature has been on the TODO list for years. However, nobody has > stepped forward to either write it, or to fund working on it.

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-03 Thread Josh Berkus
> I noticed in postgres you cannot return multiple result sets from a > stored procedure (surprisingly as it looks like a very good dbms). That feature has been on the TODO list for years. However, nobody has stepped forward to either write it, or to fund working on it. If your company has prog

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-03 Thread Merlin Moncure
On Thu, Sep 2, 2010 at 7:17 PM, Alvaro Herrera wrote: > Excerpts from John Adams's message of jue sep 02 18:25:45 -0400 2010: >> I noticed in postgres you cannot return multiple result sets from a stored >> procedure (surprisingly as it looks like a very good dbms). > > If you're really intent abo

Re: [HACKERS] returning multiple result sets from a stored procedure

2010-09-02 Thread Alvaro Herrera
Excerpts from John Adams's message of jue sep 02 18:25:45 -0400 2010: > I noticed in postgres you cannot return multiple result sets from a stored > procedure (surprisingly as it looks like a very good dbms). If you're really intent about doing this, you can emulate it by returning a set of refc

[HACKERS] returning multiple result sets from a stored procedure

2010-09-02 Thread John Adams
I noticed in postgres you cannot return multiple result sets from a stored procedure (surprisingly as it looks like a very good dbms). I would like to suggest adding this feature. - It is very usefull - It is supported by all other dbmss I have worked with. - makes porting applications to postg