Re: proposal: less strict input of regprocedure type

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: less strict input of regprocedure type
Date: 2018-12-02 03:59:05
Message-ID: CAFj8pRCC8sWBdyMm5G_ZsRW_8d9i4bgXDryMFjsdW0a-ocxdQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

ne 2. 12. 2018 v 4:52 odesílatel Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
napsal:

>
>
> so 1. 12. 2018 v 20:49 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:
>
>> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> > input value of regrocedure type should be complete function signature.
>> > postgres=# select 'uni'::regprocedure;
>> > ERROR: expected a left parenthesis
>> > LINE 1: select 'uni'::regprocedure;
>> > ^
>>
>> Yup.
>>
>> > I think so it is not necessary, when function name is unique.
>>
>> This doesn't seem like a great idea to me. It will just encourage
>> people to write brittle code that falls over as soon as the name
>> isn't unique. Also, if you're willing to assume that it is,
>> why not just use regproc?
>>
>
> regproc doesn't allow to specify complete signature when it is necessary.
>
> postgres=# select 'uni(int)'::regproc;
> ERROR: function "uni(int)" does not exist
> LINE 1: select 'uni(int)'::regproc;
> ^
>
> The motivation is same like last change of DROP FUNCTION. When the name is
> unique, then you should not to write a signature.
>

We can introduce new type -- "routine_identity", that can be used for \sf,
\ef, ... and for my plpgsql_check too.

> Regards
>
> Pavel
>
>>
>> regards, tom lane
>>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2018-12-02 04:10:54 Re: Markdown format output for psql, design notes
Previous Message Pavel Stehule 2018-12-02 03:52:59 Re: proposal: less strict input of regprocedure type