Re: Seeking Clarification on Function Definitions in PostgreSQL Extensions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Seeking Clarification on Function Definitions in PostgreSQL Extensions
Date: 2024-06-18 20:04:25
Message-ID: 4184542.1718741065@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Tuesday, June 18, 2024, Ron Johnson <ronljohnsonjr(at)gmail(dot)com> wrote:
>> What's the purpose? Legacy of not having procedures?

> So people can have a style guide that says always specify a returns clause
> on function definitions.

To my mind, the reason we allow RETURNS together with OUT parameter(s)
is so there's a place to write SETOF if you want that.

Yes, the RETURNS TABLE syntax is somewhat redundant with RETURNS
SETOF. Blame the SQL standard for that.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2024-06-18 20:57:28 Re: Restore of a reference database kills the auto analyze processing.
Previous Message Adrian Klaver 2024-06-18 19:31:23 Re: fail to install postgresql15 on Alma9