Re: function defined (or not), more worries on version 10->14 upgrade

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: function defined (or not), more worries on version 10->14 upgrade
Date: 2022-04-15 22:02:48
Message-ID: 08b7dc99-c3e4-7da0-b9f1-5c4587626c0d@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 4/15/22 15:52, David G. Johnston wrote:
>
>
> On Fri, Apr 15, 2022 at 2:30 PM Rob Sargent <robjsargent(at)gmail(dot)com> wrote:
>
> On 4/15/22 15:18, David G. Johnston wrote:
>> On Fri, Apr 15, 2022 at 2:04 PM Rob Sargent
>> <robjsargent(at)gmail(dot)com> wrote:
>>
>> but have not found a combination of name/args for
>> genome_threshold_mono(text,text,double precision)
>>
>>
>> Per the fine documentation:
>>
>> \df[anptwS+] [ pattern [ arg_pattern ... ] ]
>>
>> So the correct formulation is:
>>
>> \df genome_threshold_mono text text 'double precision'
>>
>> You need to quote the fourth argument to protect the
>> embedded space as a character and not an argument separator.
>>
>> David J.
>>
> Wow.  An old bad habit of using parens, I guess?
>
> Do you consider this correct behaviour?
>
> barnard=# \df public.genome_threshold_mono text,text
> List of functions
>  Schema |         Name          | Result data type
> |                  Argument data types                   | Type
> --------+-----------------------+------------------+--------------------------------------------------------+------
>  public | genome_threshold_mono | uuid             | pbs_name
> text, genome_name text                        | func
>  public | genome_threshold_mono | uuid             | pbs_name
> text, genome_name text, conf double precision | func
> (2 rows)
>
>
> I cannot reproduce that on head:
>
> \df test_function text
>                                 List of functions
>  Schema |     Name      | Result data type |     Argument data types  
>    | Type
> --------+---------------+------------------+------------------------------+------
>  public | test_function | text             | text, double precision  
>     | func
>  public | test_function | text             | text, text, double
> precision | func
> (2 rows)
Isn't the above example exactly my case?  It seems to work as "match at
least these leading args" which in my mind appends a silent ",*".  But
that's just me.
>
> \df test_function text,text
>                        List of functions
>  Schema | Name | Result data type | Argument data types | Type
> --------+------+------------------+---------------------+------
> (0 rows)
>
> i.e, is it automatically wildcarded?
>
>
> No, easy enough to prove, just mis-spell "text" and "text' in the
> first example
>
>
> And then, I dare say, this is just plain inconsistent, vis parens
>
> barnard=# \sf public.genome_threshold_mono text,text
> ERROR:  invalid name syntax
>
> So what? \df and \sf have different goals in life; it should be
> expected they behave differently.  Specifically, \sf doesn't use
> patterns while \df does.
>
> David J.
>
Do you take it as inconsequential that they both deal with specifics of
named functions and both make use of that functions argument list and
are part of the same meta-function world within psql?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2022-04-15 22:06:55 Re: function defined (or not), more worries on version 10->14 upgrade
Previous Message David G. Johnston 2022-04-15 21:52:33 Re: function defined (or not), more worries on version 10->14 upgrade