pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix psql's \sf and \ef for new-style SQL functions.
Date: Fri, 02 Dec 2022 19:24:55 +0000
Message-ID: <E1p1BeZ-001jhq-2G@gemulon.postgresql.org> (raw)

Fix psql's \sf and \ef for new-style SQL functions.

Some options of these commands need to be able to identify the start
of the function body within the output of pg_get_functiondef().
It used to be that that always began with "AS", but since the
introduction of new-style SQL functions, it might also start with
"BEGIN" or "RETURN".  Fix that on the psql side, and add some
regression tests.

Noted by me awhile ago, but I didn't do anything about it.
Thanks to David Johnston for a nag.

Discussion: https://postgr.es/m/AM9PR01MB8268D5CDABDF044EE9F42173FE8C9@AM9PR01MB8268.eurprd01.prod.exchangelabs....

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/97299cf99df086af847a641161e8b925fdf840b9

Modified Files
--------------
src/backend/utils/adt/ruleutils.c  |  4 +--
src/bin/psql/command.c             | 46 ++++++++++++++--------------
src/test/regress/expected/psql.out | 62 ++++++++++++++++++++++++++++++++++++++
src/test/regress/sql/psql.sql      |  8 +++++
4 files changed, 94 insertions(+), 26 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1p1BeZ-001jhq-2G@gemulon.postgresql.org>
Permalink:  ../E1p1BeZ-001jhq-2G@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1p1BeZ-001jhq-2G@gemulon.postgresql.org

 · 

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 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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix psql's \sf and \ef for new-style SQL functions.
  In-Reply-To: <E1p1BeZ-001jhq-2G@gemulon.postgresql.org>
  References: <E1p1BeZ-001jhq-2G@gemulon.postgresql.org>

* 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