inner subprograms ... Was: syntax question

From: Bryn Llewellyn <bryn(at)yugabyte(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: inner subprograms ... Was: syntax question
Date: 2021-06-03 22:35:29
Message-ID: 83EF1ADC-64CF-4404-9F02-C6C9051F968E@yugabyte.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> bruce(at)momjian(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2021-06-03 23:00:08 Re: possible license violations
Previous Message Bryn Llewellyn 2021-06-03 22:10:31 Re: arbitrary "interval" expression OK with "at time zone" but not with "set time zone" — Why?