pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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: Wed, 03 Nov 2021 12:46:38 -0400
Message-ID: <134216.1635957998@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwZaihWCaR4T=4Ov9ufk7jipRbBBtEDon61XMYOU6qkhxQ@mail.gmail.com>
References: <AM9PR01MB8268D5CDABDF044EE9F42173FE8C9@AM9PR01MB8268.eurprd01.prod.exchangelabs.com>
	<CAKFQuwZaihWCaR4T=4Ov9ufk7jipRbBBtEDon61XMYOU6qkhxQ@mail.gmail.com>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> The information schema query consults pg_proc.prosrc directly instead of
> calling pg_get_functiondef(...) (which didn't exist when the original query
> was written, and hasn't been wrong until now).

pg_get_functiondef would produce more than we want, but it looks like
pg_get_function_sqlbody() would do.

BTW, while researching this I noted the header comment for
pg_get_functiondef:

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

			regards, tom lane





view thread (9+ messages)  latest in thread

Message-ID: <134216.1635957998@sss.pgh.pa.us>
Permalink:  ../134216.1635957998@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/134216.1635957998@sss.pgh.pa.us

 · 

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 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: <134216.1635957998@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