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 1nfT78-0001ZZ-D8 for pgsql-general@arkaria.postgresql.org; Fri, 15 Apr 2022 21:04:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nfT77-0001Bp-79 for pgsql-general@arkaria.postgresql.org; Fri, 15 Apr 2022 21:04:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfT76-0001Bf-Q1 for pgsql-general@lists.postgresql.org; Fri, 15 Apr 2022 21:04:20 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nfT72-0004f6-Ba for pgsql-general@postgresql.org; Fri, 15 Apr 2022 21:04:20 +0000 Received: by mail-pg1-x52f.google.com with SMTP id q12so8533198pgj.13 for ; Fri, 15 Apr 2022 14:04:15 -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=hZSzAOik+m1ttJ/tnGVgkTlNOZjPTGnFTMQZvFDHsBA=; b=VGbTq+slYth9AZseta4ZddJZ8x+q2xulfrE9NqimlDCOVHsuGLZZ86Dc9Hx8DatSOQ ZpYEmCV318PpB+LCAuhjiU5y3fSQUxgC8ngd1GLVdm01heYa3waZTFjIbIWRNHaXjD2o eXWgFs+Y5qQhTIt18gc3ChQGsn21ajEmV+jQdv4qjVTa+EpuAuxym0jtk8Pte9O97OO6 y2fpuVxPzncIv1r71bEB2Qe2HTPPbA+rzfz3y0McQALYsMEONdEsEAdHsUMf/CjL9RvE bsz7oJZcLeRh0Djtttsjz9ycc6w/Q0XwgqTGYwMpVLE0dEZlNSdt6bCKf4EC7ACLsrEi 7sEw== 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=hZSzAOik+m1ttJ/tnGVgkTlNOZjPTGnFTMQZvFDHsBA=; b=f0o+0XllkxUqY79lst6dlYARja5Hchn3bxwOZananV9CEwiqqEhiDqoBO+EhpPJcwV pvGpDcxPNi9lHfBacVPULaKtE22vlRjvJlKH3Xy5hE0dGYGwnBawkzRVlB9JMoX5KaCM 9NmlMnBl9uLq9bkjF6rGk9Wl9IaNvHuieVTSrETUKVoxep537mgjEsuiFgwBNRMxJjuR 5N/hKpNnh3nIE/revjHriqSKgaIk6QolQQpo4flmrz/IUef37dIB7yjb1NY18aj893YG oClSGxI/U8JS0ZcZJSPkvGm3hjCtimrR2O2ec3wvuHQiOhrbkImkB2NSgKjWcZm4cvjU dYYA== X-Gm-Message-State: AOAM532j8kN8P42QK4CxcbuE8kxBwyWb+Z0IiZAm8+GrLJbBWaHWlRQY ZgOzmmvWx0O291wtIYB0RaQ= X-Google-Smtp-Source: ABdhPJzm6+6PHwHuaYI+LiuPxToFiUa1GmgwxmVnTtQWogkyH2/fKNTpPmm8iu9EAYE/leaofpwSBg== X-Received: by 2002:a63:fa06:0:b0:39c:f169:18e6 with SMTP id y6-20020a63fa06000000b0039cf16918e6mr653119pgh.129.1650056654081; Fri, 15 Apr 2022 14:04:14 -0700 (PDT) Received: from [10.128.71.194] ([155.98.131.2]) by smtp.gmail.com with ESMTPSA id s14-20020a63dc0e000000b0039cc76bda79sm5168733pgg.40.2022.04.15.14.04.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Apr 2022 14:04:13 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------W7bi1aBZzUtRvFLJOaIfwahc" Message-ID: <4100be2d-7fa3-8aec-2a49-7702b7249581@gmail.com> Date: Fri, 15 Apr 2022 15:04:12 -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: Adrian Klaver , Tom Lane Cc: "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> From: Rob Sargent In-Reply-To: <44d8ca64-af6a-6ff8-1a6a-e19d8f75885c@aklaver.com> 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. --------------W7bi1aBZzUtRvFLJOaIfwahc Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/15/22 14:22, Adrian Klaver wrote: > On 4/15/22 10:14, Tom Lane wrote: >> Rob Sargent writes: >>> The function in question is working but I'm having trouble getting at >>> it's current definition and the possibility that there are more >>> v10->v14 >>> issues in this database.  The last ERROR: below seems to me "a system >>> thing"(tm) >> >> Hmm, it looks like \df does not cope well with spaces in the argument >> list: >> >> regression=# \df genome_threshold_mono(text,text,double) >>                         List of functions >>   Schema | Name | Result data type | Argument data types | Type >> --------+------+------------------+---------------------+------ >> (0 rows) >> >> regression=# \df genome_threshold_mono(text,text, double) >> ERROR:  invalid regular expression: parentheses () not balanced >> >> It's sending the server a bogus pattern in the second case. >> I've not looked at the code yet, but this does seem like a >> psql (not server) bug. >> > > Seems it also has another white space problem: > > \df upc_check_digit() >                               List of functions >  Schema |      Name       | Result data type  |  Argument data types  > | Type > --------+-----------------+-------------------+-----------------------+------ > >  public | upc_check_digit | character varying | upc character varying > | func > > \df upc_check_digit () >                        List of functions >  Schema | Name | Result data type | Argument data types | Type > --------+------+------------------+---------------------+------ > (0 rows) > > \df upc_check_digit(varchar) >                        List of functions >  Schema | Name | Result data type | Argument data types | Type > --------+------+------------------+---------------------+------ > (0 rows) > > \df upc_check_digit (varchar) >                               List of functions >  Schema |      Name       | Result data type  |  Argument data types  > | Type > --------+-----------------+-------------------+-----------------------+------ > >  public | upc_check_digit | character varying | upc character varying > | func > (1 row) > > Perhaps beating a dead horse, but barnard=# \df genome_threshold_mono(text,text,double precision); ERROR:  invalid regular expression: parentheses () not balanced barnard=# \df genome_threshold_mono(text,text,double precision); ERROR:  invalid regular expression: parentheses () not balanced barnard=# \df genome_threshold_mono(text,text,float);                        List of functions  Schema | Name | Result data type | Argument data types | Type --------+------+------------------+---------------------+------ (0 rows) barnard=# \df genome_threshold_mono(text,text,'double precision');                        List of functions  Schema | Name | Result data type | Argument data types | Type --------+------+------------------+---------------------+------ (0 rows) barnard=# \df genome_threshold_mon*                                                  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) space after function name barnard=# \df genome_threshold_mono (text,text,double precision);                                                  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) \df: extra argument "(text,text,double" ignored \df: extra argument "precision);" ignored barnard=# \df genome_threshold_mono (text,text,float);                                                  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) \df: extra argument "(text,text,float);" ignored I can get some definitions, eg barnard=# \sf shoc.pvr(shoc.segment, float) CREATE OR REPLACE FUNCTION shoc.pvr(seg shoc.segment, plus double precision DEFAULT 0.0)  RETURNS double precision  LANGUAGE sql AS $function$   select ((1.0*seg.events_equal)+seg.events_greater+plus)/((1.0*seg.events_less)+seg.events_equal+seg.events_greater+plus)::float as result; $function$ but have not found a combination of name/args for genome_threshold_mono(text,text,double precision) I'm about to unleash new versions of the above and related functions (args will change), so a drops are imminent. Any reason to hold off on that? >> >>             regards, tom lane >> >> > > --------------W7bi1aBZzUtRvFLJOaIfwahc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 4/15/22 14:22, Adrian Klaver wrote:
On 4/15/22 10:14, Tom Lane wrote:
Rob Sargent <robjsargent@gmail.com> writes:
The function in question is working but I'm having trouble getting at
it's current definition and the possibility that there are more v10->v14
issues in this database.  The last ERROR: below seems to me "a system
thing"(tm)

Hmm, it looks like \df does not cope well with spaces in the argument
list:

regression=# \df genome_threshold_mono(text,text,double)
                        List of functions
  Schema | Name | Result data type | Argument data types | Type
--------+------+------------------+---------------------+------
(0 rows)

regression=# \df genome_threshold_mono(text,text, double)
ERROR:  invalid regular expression: parentheses () not balanced

It's sending the server a bogus pattern in the second case.
I've not looked at the code yet, but this does seem like a
psql (not server) bug.


Seems it also has another white space problem:

\df upc_check_digit()
                              List of functions
 Schema |      Name       | Result data type  |  Argument data types  | Type
--------+-----------------+-------------------+-----------------------+------
 public | upc_check_digit | character varying | upc character varying | func

\df upc_check_digit ()
                       List of functions
 Schema | Name | Result data type | Argument data types | Type
--------+------+------------------+---------------------+------
(0 rows)

\df upc_check_digit(varchar)
                       List of functions
 Schema | Name | Result data type | Argument data types | Type
--------+------+------------------+---------------------+------
(0 rows)

\df upc_check_digit (varchar)
                              List of functions
 Schema |      Name       | Result data type  |  Argument data types  | Type
--------+-----------------+-------------------+-----------------------+------
 public | upc_check_digit | character varying | upc character varying | func
(1 row)



Perhaps beating a dead horse, but
barnard=# \df genome_threshold_mono(text,text,double precision);
ERROR:  invalid regular expression: parentheses () not balanced
barnard=# \df genome_threshold_mono(text,text,double precision);
ERROR:  invalid regular expression: parentheses () not balanced
barnard=# \df genome_threshold_mono(text,text,float);
                       List of functions
 Schema | Name | Result data type | Argument data types | Type
--------+------+------------------+---------------------+------
(0 rows)

barnard=# \df genome_threshold_mono(text,text,'double precision');
                       List of functions
 Schema | Name | Result data type | Argument data types | Type
--------+------+------------------+---------------------+------
(0 rows)

barnard=# \df genome_threshold_mon*
                                                 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)

space after function name
barnard=# \df genome_threshold_mono (text,text,double precision);
                                                 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)

\df: extra argument "(text,text,double" ignored
\df: extra argument "precision);" ignored
barnard=# \df genome_threshold_mono (text,text,float);
                                                 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)

\df: extra argument "(text,text,float);" ignored

I can get some definitions, eg
barnard=# \sf shoc.pvr(shoc.segment, float)
CREATE OR REPLACE FUNCTION shoc.pvr(seg shoc.segment, plus double precision DEFAULT 0.0)
 RETURNS double precision
 LANGUAGE sql
AS $function$
  select ((1.0*seg.events_equal)+seg.events_greater+plus)/((1.0*seg.events_less)+seg.events_equal+seg.events_greater+plus)::float as result;
$function$
but have not found a combination of name/args for genome_threshold_mono(text,text,double precision)

I'm about to unleash new versions of the above and related functions (args will change), so a drops are imminent. Any reason to hold off on that?





            regards, tom lane





--------------W7bi1aBZzUtRvFLJOaIfwahc--