inner subprograms ... Was: syntax question - Mailing list pgsql-general

From Bryn Llewellyn
Subject inner subprograms ... Was: syntax question
Date
Msg-id 83EF1ADC-64CF-4404-9F02-C6C9051F968E@yugabyte.com
Whole thread Raw
In response to Re: syntax question  (Bruce Momjian <bruce@momjian.us>)
List pgsql-general
bruce@momjian.us wrote:

Oh, I thought he wanted to declare a function inside the function that could be called only by that function, like private functions in Oracle packages can do.  Yes, you can create a function that defines a function that can be called later.  I guess you could also create a function that _conditionally_ creates a function that it can call itself too.  My point is that you can't create a function that has function scope — they all have schema scope.

I’ve heard that EDB’s version of PostgreSQL supports inner subprograms (declared and defined within a DECLARE section) to any depth of nesting—and packages too. Is this true?

I worked at Oracle HQ for the longest time. Not a day goes by, when I need to write PL/pgSQL code, that I don’t miss these two constructs. I wish that (a future version of) vanilla PG could bring support for them.

pgsql-general by date:

Previous
From: Bryn Llewellyn
Date:
Subject: Re: arbitrary "interval" expression OK with "at time zone" but not with "set time zone" — Why?
Next
From: Bruce Momjian
Date:
Subject: Re: possible license violations