From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] SQL procedures
Date: Tue, 14 Nov 2017 17:47:25 -0500
Message-ID: <5b643520-59fd-b62a-102c-184e884149c9@2ndquadrant.com> (raw)
In-Reply-To: <19884.1510676091@sss.pgh.pa.us>
References: <336f6926-8990-ff2d-4167-276ce417fc32@2ndquadrant.com>
<9388.1509474184@sss.pgh.pa.us>
<f2b2ac79-f7d0-e736-ac12-50a103d0dcbd@2ndquadrant.com>
<17774.1510152857@sss.pgh.pa.us>
<32ceef13-595d-a698-128c-b90ab9494a52@2ndquadrant.com>
<19884.1510676091@sss.pgh.pa.us>
On 11/14/17 11:14, Tom Lane wrote:
>> The common functionality between functions and procedures is like 98%
>> [citation needed], so they definitely belong there, even more so than
>> aggregates, for example.
> No, I don't think so. The core reason why not is that in
>
> SELECT foo(...) FROM ...
>
> foo() might be either a plain function or an aggregate, so it's important
> that functions and aggregates share the same namespace. *That* is why
> they are in the same catalog. On the other hand, since the above syntax
> is not usable to call a SQL procedure, putting SQL procedures into pg_proc
> just creates namespacing conflicts. Do we really want the existence of
> a function foo(int) to mean that you can't create a SQL procedure named
> foo and taking one int argument?
Yes, that is defined that way by the SQL standard.
The point about the overlap refers more to the internals. The entire
parsing, look-up, type-resolution, DDL handling, and other things are
the same.
So for both of these reasons I think it's appropriate to use the same
catalog.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com, tgl@sss.pgh.pa.us
Subject: Re: [HACKERS] SQL procedures
In-Reply-To: <5b643520-59fd-b62a-102c-184e884149c9@2ndquadrant.com>
References: <336f6926-8990-ff2d-4167-276ce417fc32@2ndquadrant.com> <9388.1509474184@sss.pgh.pa.us> <f2b2ac79-f7d0-e736-ac12-50a103d0dcbd@2ndquadrant.com> <17774.1510152857@sss.pgh.pa.us> <32ceef13-595d-a698-128c-b90ab9494a52@2ndquadrant.com> <19884.1510676091@sss.pgh.pa.us> <5b643520-59fd-b62a-102c-184e884149c9@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox