postgresql_16:3.1.2.2 Positional Parameters
PostgreSQL 16 > The SQL Language > SQL Syntax > Value Expressions > Positional Parameters
A positional parameter reference is used to indicate a value that is supplied externally to an SQL statement. Parameters are used in SQL function definitions and in prepared queries. Some client libraries also support specifying data values separately from the SQL command string, in which case parameters are used to refer to the out-of-line data values. The form of a parameter reference is: $*number*
For example, consider the definition of a function, dept, as: CREATE FUNCTION dept(text) RETURNS dept AS $$ SELECT * FROM dept WHERE name = $1 $$ LANGUAGE SQL; Here the $1 references the value of the first function argument whenever the function is invoked.