Re: How to \ef a function ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: David Gauthier <dfgpostgres(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to \ef a function ?
Date: 2024-01-08 17:12:42
Message-ID: 1944451.1704733962@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dean Rasheed 2024-01-08 19:36:34 Re: Emitting JSON to file using COPY TO
Previous Message Tom Lane 2024-01-08 16:47:59 Re: How to \ef a function ?