1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +03:00

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.com
This commit is contained in:
Tom Lane
2022-12-02 14:24:44 -05:00
parent b23cd185fd
commit cabfb8241d
4 changed files with 94 additions and 26 deletions

View File

@@ -1271,9 +1271,17 @@ reset work_mem;
\df has_database_privilege oid text
\df has_database_privilege oid text -
\dfa bit* small*
\df *._pg_expandarray
\do - pg_catalog.int4
\do && anyarray *
-- check \sf
\sf information_schema._pg_expandarray
\sf+ information_schema._pg_expandarray
\sf+ interval_pl_time
\sf ts_debug(text)
\sf+ ts_debug(text)
-- AUTOCOMMIT
CREATE TABLE ac_test (a int);