aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ruleutils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-12-02 14:24:44 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2022-12-02 14:24:44 -0500
commit303b26c1bb14abf20a35a9cddebee65e10f5ebd4 (patch)
treebf4f8a37d5330afd3202b73d543b99f05e790a4b /src/backend/utils/adt/ruleutils.c
parent47e1224d590ccbc0d745e812dffe2fa913201776 (diff)
downloadpostgresql-303b26c1bb14abf20a35a9cddebee65e10f5ebd4.tar.gz
postgresql-303b26c1bb14abf20a35a9cddebee65e10f5ebd4.zip
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
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r--src/backend/utils/adt/ruleutils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 8e428e93286..b4eb4e18e6a 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -2778,8 +2778,8 @@ pg_get_serial_sequence(PG_FUNCTION_ARGS)
*
* 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.
+ * function body. To wit: the function body starts on a line that begins with
+ * "AS ", "BEGIN ", or "RETURN ", and no preceding line will look like that.
*/
Datum
pg_get_functiondef(PG_FUNCTION_ARGS)