From: Tom Lane <tgl@sss.pgh.pa.us>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: David Gauthier <dfgpostgres@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: How to \ef a function ?
Date: Mon, 08 Jan 2024 12:12:42 -0500
Message-ID: <1944451.1704733962@sss.pgh.pa.us> (raw)
In-Reply-To: <1940933.1704732479@sss.pgh.pa.us>
References: <CAEs=6D=nwX2wm0hjkaw6C_LnqR+NFtnnzbSzeZq-xcfi_ooKSw@mail.gmail.com>
<5991da49-11ba-4b0a-8ed8-a7bc59ea0405@aklaver.com>
<1940933.1704732479@sss.pgh.pa.us>
I wrote:
> Yeah, that's what psql is expecting, but it does seem a bit
> unforgiving considering that you can write a noise semicolon
> in many other backslash commands. And this:
> dvdb=# \ef opid.bef_ins_axi_reqs_set_trig();
> ERROR: expected a right parenthesis
> seems outright buggy. I've not looked at the code though.
Ah, I see it. The difference in the error messages is because \ef
feeds the whole argument to regprocin to find out the function OID
if there are no parens, but regprocedurein if there are parens.
Neither of those functions like the trailing semicolon, but their
complaints are different.
More interestingly, \ef is actually trying to ignore trailing
semicolons: exec_command_ef_ev tells psql_scan_slash_option
to do so. But it's using OT_WHOLE_LINE mode and that function
ignores the request in that mode. So that seems like an
oversight.
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, adrian.klaver@aklaver.com, dfgpostgres@gmail.com
Subject: Re: How to \ef a function ?
In-Reply-To: <1944451.1704733962@sss.pgh.pa.us>
References: <CAEs=6D=nwX2wm0hjkaw6C_LnqR+NFtnnzbSzeZq-xcfi_ooKSw@mail.gmail.com> <5991da49-11ba-4b0a-8ed8-a7bc59ea0405@aklaver.com> <1940933.1704732479@sss.pgh.pa.us> <1944451.1704733962@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