Re: recursion in plpgsql

2018-11-07 Thread Tom Lane
Andrew Gierth writes: > [ nice summary ] Should we try to improve the docs in this area? regards, tom lane

Re: recursion in plpgsql

2018-11-07 Thread Andrew Gierth
> "David" == David Gauthier writes: David> Tom: I seem to remember (but am probably wrong) that cursors David> were locally scoped (or could be made so). This was several David> years ago with an earlier v8 version. Was that sort of thing David> around back then ? There are two distinct

Re: recursion in plpgsql

2018-11-07 Thread David Gauthier
Thanks for the replies ! Steve: I don't remember using a recursive query like that, but it certainly does look interesting. Tom: I seem to remember (but am probably wrong) that cursors were locally scoped (or could be made so). This was several years ago with an earlier v8 version. Was that sor

Re: recursion in plpgsql

2018-11-06 Thread Tom Lane
David Gauthier writes: > I'm trying/failing to write a recursive plpgsql function where the function > tries to operate on a hierary of records in a reflexive table. > parent-child-grandchild type of recursion. > I tried with a cursor, but got a "cursor already in use" error. So that > looks like

Re: recursion in plpgsql

2018-11-06 Thread Steve Crawford
On Tue, Nov 6, 2018 at 2:54 PM David Gauthier wrote: > Hi: > > I'm trying/failing to write a recursive plpgsql function where the > function tries to operate on a hierary of records in a reflexive table. > parent-child-grandchild type of recursion. > > I tried with a cursor, but got a "cursor alr