Re: [HACKERS] SQL procedures

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [HACKERS] SQL procedures
Дата
Msg-id CA+TgmoYjzskF6jFS2nWCW_nDJNnZzaf4S2KZmPD0=vUOz=Z=rw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] SQL procedures  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: [HACKERS] SQL procedures
Список pgsql-hackers
On Wed, Nov 8, 2017 at 9:21 AM, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
>> Why not use VOIDOID for the prorettype value?
>
> We need a way to distinguish functions that are callable by SELECT and
> procedures that are callable by CALL.

I agree that we need this, but using prorettype = InvalidOid to do it
might not be the best way, because it only works for procedures that
don't return anything.  If a procedure could return, say, an integer,
then it would fail, because we have two ways to say that something in
pg_proc returns nothing (InvalidOid, VOIDOID) but we have only one way
to say that it returns an integer (INT4OID).  Similarly, we'd have a
problem if we ever tried to use procedures for handling triggers or
(perhaps more likely) event triggers, since those special kinds of
functions also signal their purpose via the return type - which may
also not have been such a hot idea, but at least in those cases the
idea of returning any sort of real result is more or less known to be
nonsensical.

Anyway, I think it would be better to invent an explicit way to
represent whether something is a procedure rather than relying on
overloading prorettype to tell us.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] LDAPS
Следующее
От: David Steele
Дата:
Сообщение: Re: PATCH: Configurable file mode mask