From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Erki Eessaar <erki.eessaar@taltech.ee>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: INFORMATION_SCHEMA.routines column routine_definition does not show the source
Date: Thu, 01 Dec 2022 20:28:39 -0500
Message-ID: <1744742.1669944519@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwYT+HudtXnYTp_EvPvjd_a0516_PmmzJWX2SLQ+PLhqfg@mail.gmail.com>
References: <AM9PR01MB8268D5CDABDF044EE9F42173FE8C9@AM9PR01MB8268.eurprd01.prod.exchangelabs.com>
<CAKFQuwZaihWCaR4T=4Ov9ufk7jipRbBBtEDon61XMYOU6qkhxQ@mail.gmail.com>
<134216.1635957998@sss.pgh.pa.us>
<CAKFQuwYT+HudtXnYTp_EvPvjd_a0516_PmmzJWX2SLQ+PLhqfg@mail.gmail.com>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> Decided to ping this as I don't recall or see it getting patched and the
> recent discussion regarding the prosrc field.
>> * Note: if you change the output format of this function, be careful not
>> * to break psql's rules (in \ef and \sf) for identifying the start of the
>> * function body. To wit: the function body starts on a line that begins
>> * with "AS ", and no preceding line will look like that.
>>
>> Needless to say, the SQL-function-body patch has ignored this advice
>> totally. At the very least this comment needs to be adjusted, but
>> I wonder if it's not telling us that \ef and/or \sf are broken.
Indeed, if you experiment with "\sf+" or "\ef" with a line number,
those features fail miserably for new-style SQL functions.
We could partially fix that by teaching psql to also recognize
"BEGIN" as the start of the function body. I say "partially"
because the whole point of that line-numbers feature is so that
you can figure out which line an error report is complaining about.
However, SQL functions don't report in terms of line numbers,
and never have, so maybe that's moot. It's fortunate that they
don't, because the reconstructed function text is likely to have
different line breaks than the original.
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, erki.eessaar@taltech.ee, peter.eisentraut@2ndquadrant.com, pgsql-bugs@lists.postgresql.org
Subject: Re: INFORMATION_SCHEMA.routines column routine_definition does not show the source
In-Reply-To: <1744742.1669944519@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