Wiki / psql Commands / Query buffer and editing
\sf
This command fetches and shows the definition of the named function or procedure, in the form of a CREATE OR REPLACE FUNCTION or CREATE OR REPLACE PROCEDURE command. The definition is printed to the current query output channel, as set by \o .
Reading PostgreSQL 18.6.
Description
This command fetches and shows the definition of the named function or procedure, in the form of a CREATE OR REPLACE FUNCTION or CREATE OR REPLACE PROCEDURE command. The definition is printed to the current query output channel, as set by \o .
- Client
- psql 18.6
- Case-sensitive spelling
- \sf
Usage
\sf[+] function_descriptionSpellings in this manual definition
| Command | Documented suffix modifiers |
|---|---|
| \sf | + |
Manual definition
\sf[+]function_description-
This command fetches and shows the definition of the named function or procedure, in the form of a
CREATE OR REPLACE FUNCTIONorCREATE OR REPLACE PROCEDUREcommand. The definition is printed to the current query output channel, as set by\o.The target function can be specified by name alone, or by name and arguments, for example
foo(integer, text). The argument types must be given if there is more than one function of the same name.If
+is appended to the command name, then the output lines are numbered, with the first line of the function body being line 1.Unlike most other meta-commands, the entire remainder of the line is always taken to be the argument(s) of
\sf, and neither variable interpolation nor backquote expansion are performed in the arguments.
Related entries
Documentation and source
Source build
- Version
- 18.6
- Build
- https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2
- Source fingerprint
ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8
Compare versions
PostgreSQL 10 → 11: changed.
--- PostgreSQL 10
+++ PostgreSQL 11
@@ -1,5 +1,5 @@
{
- "definition": "This command fetches and shows the definition of the named function, in the form of a CREATE OR REPLACE FUNCTION command. The definition is printed to the current query output channel, as set by \\o . The target function can be specified by name alone, or by name and arguments, for example foo(integer, text) . The argument types must be given if there is more than one function of the same name. If + is appended to the command name, then the output lines are numbered, with the first line of the function body being line 1. Unlike most other meta-commands, the entire remainder of the line is always taken to be the argument(s) of \\sf , and neither variable interpolation nor backquote expansion are performed in the arguments.",
+ "definition": "This command fetches and shows the definition of the named function or procedure, in the form of a CREATE OR REPLACE FUNCTION or CREATE OR REPLACE PROCEDURE command. The definition is printed to the current query output channel, as set by \\o . The target function can be specified by name alone, or by name and arguments, for example foo(integer, text) . The argument types must be given if there is more than one function of the same name. If + is appended to the command name, then the output lines are numbered, with the first line of the function body being line 1. Unlike most other meta-commands, the entire remainder of the line is always taken to be the argument(s) of \\sf , and neither variable interpolation nor backquote expansion are performed in the arguments.",
"modifiers": [
{
"command": "\\sf",
Compares recorded interfaces and attributes. Source fingerprints and build metadata are excluded; an absent sample is not proof of the introduction or removal release.
Related entries
Export JSON · Back to psql Commands · Recorded in PostgreSQL 10 through 20; the first sample is not necessarily its introduction.