You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
CREATE OR REPLACE FUNCTION information_schema._pg_expandarray(anyarray, OUT x anyelement, OUT n integer)
5253
+
RETURNS SETOF record
5254
+
LANGUAGE sql
5255
+
IMMUTABLE PARALLEL SAFE STRICT
5256
+
AS $function$select $1[s],
5257
+
s operator(pg_catalog.-) pg_catalog.array_lower($1,1) operator(pg_catalog.+) 1
5258
+
from pg_catalog.generate_series(pg_catalog.array_lower($1,1),
5259
+
pg_catalog.array_upper($1,1),
5260
+
1) as g(s)$function$
5261
+
\sf+ information_schema._pg_expandarray
5262
+
CREATE OR REPLACE FUNCTION information_schema._pg_expandarray(anyarray, OUT x anyelement, OUT n integer)
5263
+
RETURNS SETOF record
5264
+
LANGUAGE sql
5265
+
IMMUTABLE PARALLEL SAFE STRICT
5266
+
1 AS $function$select $1[s],
5267
+
2 s operator(pg_catalog.-) pg_catalog.array_lower($1,1) operator(pg_catalog.+) 1
5268
+
3 from pg_catalog.generate_series(pg_catalog.array_lower($1,1),
5269
+
4 pg_catalog.array_upper($1,1),
5270
+
5 1) as g(s)$function$
5271
+
\sf+ interval_pl_time
5272
+
CREATE OR REPLACE FUNCTION pg_catalog.interval_pl_time(interval, time without time zone)
5273
+
RETURNS time without time zone
5274
+
LANGUAGE sql
5275
+
IMMUTABLE PARALLEL SAFE STRICT COST 1
5276
+
1 RETURN ($2 + $1)
5277
+
\sf ts_debug(text)
5278
+
CREATE OR REPLACE FUNCTION pg_catalog.ts_debug(document text, OUT alias text, OUT description text, OUT token text, OUT dictionaries regdictionary[], OUT dictionary regdictionary, OUT lexemes text[])
5279
+
RETURNS SETOF record
5280
+
LANGUAGE sql
5281
+
STABLE PARALLEL SAFE STRICT
5282
+
BEGIN ATOMIC
5283
+
SELECT ts_debug.alias,
5284
+
ts_debug.description,
5285
+
ts_debug.token,
5286
+
ts_debug.dictionaries,
5287
+
ts_debug.dictionary,
5288
+
ts_debug.lexemes
5289
+
FROM ts_debug(get_current_ts_config(), ts_debug.document) ts_debug(alias, description, token, dictionaries, dictionary, lexemes);
5290
+
END
5291
+
\sf+ ts_debug(text)
5292
+
CREATE OR REPLACE FUNCTION pg_catalog.ts_debug(document text, OUT alias text, OUT description text, OUT token text, OUT dictionaries regdictionary[], OUT dictionary regdictionary, OUT lexemes text[])
5293
+
RETURNS SETOF record
5294
+
LANGUAGE sql
5295
+
STABLE PARALLEL SAFE STRICT
5296
+
1 BEGIN ATOMIC
5297
+
2 SELECT ts_debug.alias,
5298
+
3 ts_debug.description,
5299
+
4 ts_debug.token,
5300
+
5 ts_debug.dictionaries,
5301
+
6 ts_debug.dictionary,
5302
+
7 ts_debug.lexemes
5303
+
8 FROM ts_debug(get_current_ts_config(), ts_debug.document) ts_debug(alias, description, token, dictionaries, dictionary, lexemes);
0 commit comments