From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Rob Sargent <robjsargent@gmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
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 18:48:15 -0400
Message-ID: <1837006.1650062895@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwYq56qhtrSFWXSzOu_a7ih0Om8uBsYjCNHSc-3Uo6VnAA@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>
<08b7dc99-c3e4-7da0-b9f1-5c4587626c0d@gmail.com>
<CAKFQuwYq56qhtrSFWXSzOu_a7ih0Om8uBsYjCNHSc-3Uo6VnAA@mail.gmail.com>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> ... And if I know something exists
> in the DB and I want details, doing a name-only search followed by \sf
> seems like it would work well enough.
It could work better though. For example,
regression=# \df *backup*
List of functions
Schema | Name | Result data type | Argument data types | Type
------------+-----------------+------------------+------------------------------------------------------------------------------------------------+------
pg_catalog | pg_backup_start | pg_lsn | label text, fast boolean DEFAULT false | func
pg_catalog | pg_backup_stop | record | wait_for_archive boolean DEFAULT true, OUT lsn pg_lsn, OUT labelfile text, OUT spcmapfile text | func
(2 rows)
regression=# \sf pg_backup_start (label text, fast boolean DEFAULT false)
ERROR: syntax error at or near "text"
It seems annoying that I can't copy-and-paste \df's output to invoke \sf.
Moreover, once I peel that down to what will work:
regression=# \sf pg_backup_start (text, boolean )
CREATE OR REPLACE FUNCTION pg_catalog.pg_backup_start(label text, fast boolean DEFAULT false)
RETURNS pg_lsn
LANGUAGE internal
PARALLEL RESTRICTED STRICT
AS $function$pg_backup_start$function$
it's apparent that \sf isn't even consistent with *itself*.
So I agree that there's room for some polishing here.
I'm not sure how far we can go without breaking backwards compatibility.
OTOH, it looks like \df's ability to consider parameters at all is new
as of v14, so maybe the details don't have a huge constituency yet.
regards, tom lane
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: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, robjsargent@gmail.com, adrian.klaver@aklaver.com
Subject: Re: function defined (or not), more worries on version 10->14 upgrade
In-Reply-To: <1837006.1650062895@sss.pgh.pa.us>
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> <CAKFQuwYq56qhtrSFWXSzOu_a7ih0Om8uBsYjCNHSc-3Uo6VnAA@mail.gmail.com> <1837006.1650062895@sss.pgh.pa.us>
* 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