Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfU1p-0005Nc-Np for pgsql-general@arkaria.postgresql.org; Fri, 15 Apr 2022 22:02:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nfU1n-0005hI-Er for pgsql-general@arkaria.postgresql.org; Fri, 15 Apr 2022 22:02:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfU1m-0005h9-Oy for pgsql-general@lists.postgresql.org; Fri, 15 Apr 2022 22:02:55 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nfU1k-0001t5-Ec for pgsql-general@postgresql.org; Fri, 15 Apr 2022 22:02:53 +0000 Received: by mail-pj1-x102e.google.com with SMTP id bg24so8515111pjb.1 for ; Fri, 15 Apr 2022 15:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to; bh=M6JoJJ8/XIl5v4LanGPMTR/b6TY9GpwRmgxKYoLbBNg=; b=nQNDgwV6s8fQpCS/dprJaFqBJy5S098FWp12YwUeDKMa9xaSK7oaQlBSXHVJ2xq+nS YyIU78uTh29s1wJ4Djw6NR9yx+hH2GosMFDxuZ265pk6CDW/49juKuVAuy8UCbcedRUt V6ubtgvxIOYeKNhIY90Jz2Y3Rqk6j0iNw3KzDsBsgQrNbEQeqlZ36AJr0w8nbRLo3lTN MY8nSdva/4b86fvKmYVrz9mcz9GpZ/kdlWJxELQmQj3cN1pQHcCH4g1nrK29qNcRcLr+ OS5OZfmMDlMdoWnrKy/i754g4jvuuy7Gu8znAn+gKtpdVOHI8gDlJVLvDlPeoCMiWtAu 9yYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to; bh=M6JoJJ8/XIl5v4LanGPMTR/b6TY9GpwRmgxKYoLbBNg=; b=Vwx3kiWoiYN1Tdy7ZX7MijLNESoUzobG2PoTlKxH2jhhDsAGkD050VhDKO4g1rItDZ kxwfN7Uto+x92n+G4BgrnKLm4KrQZpq9qtwvsBmGOVnO+eBC5h+YIiRPUgJgsIraDL32 kDxXyD4GjhAv27UG6X/2YZ9+4TEzHS7fMSWaV8sTswUxjPZQ/e53ZPppDI+rGkaVztb0 AjRVxiwOvDAzmBOnufbkv190JN1TB1RVzjGJeQc//I/fFDLgORHJr+vIYP9KY/0sfkXI qKGEEi7FdCRAZVqqJQc0SHIxjC9axr0cZzF8PnPumfwv5t3YP6WEYt+7n5bdj3VDR90K I71Q== X-Gm-Message-State: AOAM532D+NB2PM6PmKc3XbVBuavHVViii8NCFyDn7y7Us35lEbT3rBeb 2d1q2LiwejEJhnVOTS08evY= X-Google-Smtp-Source: ABdhPJwh3vNo/ykyKKCKYsJ4AwG/dNE5Xd5gn/89Kd+Urcpq1PFfWP0s1dueIYxN5clvXDI3MBq+9g== X-Received: by 2002:a17:902:e949:b0:158:681d:ffaa with SMTP id b9-20020a170902e94900b00158681dffaamr1052536pll.127.1650060171317; Fri, 15 Apr 2022 15:02:51 -0700 (PDT) Received: from [10.128.71.194] ([155.98.131.2]) by smtp.gmail.com with ESMTPSA id b77-20020a621b50000000b00505fda28908sm3899791pfb.97.2022.04.15.15.02.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Apr 2022 15:02:50 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------D04xZNGPLq7wWN9imz24Zric" Message-ID: <08b7dc99-c3e4-7da0-b9f1-5c4587626c0d@gmail.com> Date: Fri, 15 Apr 2022 16:02:48 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: function defined (or not), more worries on version 10->14 upgrade Content-Language: en-CA To: "David G. Johnston" Cc: Adrian Klaver , Tom Lane , "pgsql-general@postgresql.org" 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> From: Rob Sargent In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------D04xZNGPLq7wWN9imz24Zric Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/15/22 15:52, David G. Johnston wrote: > > > On Fri, Apr 15, 2022 at 2:30 PM Rob Sargent wrote: > > On 4/15/22 15:18, David G. Johnston wrote: >> On Fri, Apr 15, 2022 at 2:04 PM Rob Sargent >> 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? --------------D04xZNGPLq7wWN9imz24Zric Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
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?


--------------D04xZNGPLq7wWN9imz24Zric--