pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: Adrian Klaver <adrian.klaver@aklaver.com>
To: 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 15:04:12 -0600
Message-ID: <4100be2d-7fa3-8aec-2a49-7702b7249581@gmail.com> (raw)
In-Reply-To: <44d8ca64-af6a-6ff8-1a6a-e19d8f75885c@aklaver.com>
References: <1c00b419-2507-f018-3579-2529ed8d6de5@gmail.com>
	<1653697.1650042859@sss.pgh.pa.us>
	<44d8ca64-af6a-6ff8-1a6a-e19d8f75885c@aklaver.com>

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
>>
>>
>
>

view thread (16+ messages)  latest in thread

Message-ID: <4100be2d-7fa3-8aec-2a49-7702b7249581@gmail.com>
Permalink:  ../4100be2d-7fa3-8aec-2a49-7702b7249581@gmail.com/
Also on:    postgresql.org/message-id/4100be2d-7fa3-8aec-2a49-7702b7249581@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, 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: <4100be2d-7fa3-8aec-2a49-7702b7249581@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>

* 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