4.2.6. Function Calls

4.2.6. Function Calls
4.2.6. 函数调用
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:
例如,以下计算2的平方根:
 
sqrt(2)
 
The list of built-in functions is in Chapter 9. Other functions can be added by the user.
第9章列出了内置函数列表。其他的函数可以由用户自定义。
 
When issuing queries in a database where some users mistrust other users, observe security precautions  from Section 10.3 when writing function calls.
在某些用户不信任其他用户的数据库中发出查询时,编写函数调用时请遵守 第10.3节 中的安全预防措施。
 
The arguments can optionally have names attached. See Section 4.3 for details.
参数可以选择附加名称。 有关详细信息,请参见第4.3节
 
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 Section 8.16.5.
可以选择使用区域选择语法来调用采用复合类型的单个参数的函数,相反,也可以以函数样式编写区域段选择。 也就是说,col(table)和table.col是可互换的。 此行为虽然不是SQL标准的,但在PostgreSQL中提供,因为它允许使用函数来模拟“计算区域”。 有关更多信息,请参见第8.16.5节
发布了341 篇原创文章 · 获赞 53 · 访问量 88万+

猜你喜欢

转载自blog.csdn.net/ghostliming/article/details/104261434