RefLib

Reference library for AI

Back

postgresql_16:3.1.2.6 Function Calls

PostgreSQL 16 > The SQL Language > SQL Syntax > Value Expressions > Function Calls

The syntax for a function call is the name of a function (possibly qualified with a schema name), followed by its argument list enclosed in parentheses: *function_name* (*expression* , *expression* ... )

For example, the following computes the square root of 2: sqrt(2)

The list of built-in functions is in (see postgresql_16:3.6). Other functions can be added by the user.

When issuing queries in a database where some users mistrust other users, observe security precautions from (see postgresql_16:3.7.3) when writing function calls.

The arguments can optionally have names attached. See (see postgresql_16:3.1.3) for details.

Note

A function that takes a single argument of composite type can optionally be called using field-selection syntax, and conversely field selection can be written in functional style. That is, the notations col(table) and table.col are interchangeable. This behavior is not SQL-standard but is provided in PostgreSQL because it allows use of functions to emulate “computed fields”. For more information see (see postgresql_16:3.5.16.5).

Back