Re: RFD: Don't force plpgsql IN parameters to constant

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: RFD: Don't force plpgsql IN parameters to constant
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C203937E8B@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на Re: RFD: Don't force plpgsql IN parameters to constant  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
>>> Is there a reason we force plpgsql IN parameters to constant?
>
> Now having said all that, I'm not really in favor of Steve's
> proposal --- it seems like it mostly would be encouraging dubious
> programming practices.  But it's hard to say that the arguments
> against are more than theoretical/aesthetic ones.
>
> Does anyone happen to know how it works in Oracle's PL/SQL?
> I think that following their lead is usually the argument-settler
> when it comes to plpgsql behavior.

Oracle 10.2.0.4:

CREATE PROCEDURE test2(a NUMBER) AUTHID CURRENT_USER AS
BEGIN  a := 2;
END;
/

PLS-00363: expression 'A' cannot be used as an assignment target

So it does not work in Oracle.


The proposed feature would have come handy for me once or twice,
but maybe that is more a sign of my sloppy coding habits than
anything else ...

Still, +1 from me for the proposal.

In my experience, restrictive languages have never kept people
from writing bad and confusing code.

What about introducing a keyword CONSTANT in the parameter list
to force the old behaviour?
(This would remove us further from Oracle though.)

Yours,
Laurenz Albe


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Patch for 8.5, transformationHook
Следующее
От: Dean Rasheed
Дата:
Сообщение: Re: WIP: Deferrable unique constraints