pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: function defined (or not), more worries on version 10->14 upgrade
Date: Fri, 15 Apr 2022 16:02:48 -0600
Message-ID: <08b7dc99-c3e4-7da0-b9f1-5c4587626c0d@gmail.com> (raw)
In-Reply-To: <CAKFQuwYWxc3SzdYU+dc_be2XdB2rHeEnx3vWiqi14PoDkdJ+6w@mail.gmail.com>
References: <1c00b419-2507-f018-3579-2529ed8d6de5@gmail.com>
	<1653697.1650042859@sss.pgh.pa.us>
	<44d8ca64-af6a-6ff8-1a6a-e19d8f75885c@aklaver.com>
	<4100be2d-7fa3-8aec-2a49-7702b7249581@gmail.com>
	<CAKFQuwYJd2yaWNR6eJqGtgJG5ehy+ScwpwAhzToSFp1ipBq=qw@mail.gmail.com>
	<d4caa24a-10f6-adf2-45a3-6894a7f90d97@gmail.com>
	<CAKFQuwYWxc3SzdYU+dc_be2XdB2rHeEnx3vWiqi14PoDkdJ+6w@mail.gmail.com>

On 4/15/22 15:52, David G. Johnston wrote:
>
>
> On Fri, Apr 15, 2022 at 2:30 PM Rob Sargent <robjsargent@gmail.com> wrote:
>
>     On 4/15/22 15:18, David G. Johnston wrote:
>>     On Fri, Apr 15, 2022 at 2:04 PM Rob Sargent
>>     <robjsargent@gmail.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?

view thread (16+ messages)  latest in thread

Message-ID: <08b7dc99-c3e4-7da0-b9f1-5c4587626c0d@gmail.com>
Permalink:  ../08b7dc99-c3e4-7da0-b9f1-5c4587626c0d@gmail.com/
Also on:    postgresql.org/message-id/08b7dc99-c3e4-7da0-b9f1-5c4587626c0d@gmail.com

 · 

reply

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-general@postgresql.org
  Cc: robjsargent@gmail.com, david.g.johnston@gmail.com, adrian.klaver@aklaver.com, tgl@sss.pgh.pa.us
  Subject: Re: function defined (or not), more worries on version 10->14 upgrade
  In-Reply-To: <08b7dc99-c3e4-7da0-b9f1-5c4587626c0d@gmail.com>
  References: <1c00b419-2507-f018-3579-2529ed8d6de5@gmail.com> <1653697.1650042859@sss.pgh.pa.us> <44d8ca64-af6a-6ff8-1a6a-e19d8f75885c@aklaver.com> <4100be2d-7fa3-8aec-2a49-7702b7249581@gmail.com> <CAKFQuwYJd2yaWNR6eJqGtgJG5ehy+ScwpwAhzToSFp1ipBq=qw@mail.gmail.com> <d4caa24a-10f6-adf2-45a3-6894a7f90d97@gmail.com> <CAKFQuwYWxc3SzdYU+dc_be2XdB2rHeEnx3vWiqi14PoDkdJ+6w@mail.gmail.com> <08b7dc99-c3e4-7da0-b9f1-5c4587626c0d@gmail.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