From 53685d79813a46c7e3a46ae4b1210f608d41d6ab Mon Sep 17 00:00:00 2001 From: Noah Misch Date: Tue, 10 Dec 2013 09:34:37 -0500 Subject: Rename TABLE() to ROWS FROM(). SQL-standard TABLE() is a subset of UNNEST(); they deal with arrays and other collection types. This feature, however, deals with set-returning functions. Use a different syntax for this feature to keep open the possibility of implementing the standard TABLE(). --- doc/src/sgml/ref/select.sgml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'doc/src/sgml/ref') diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml index 88ebd73d49c..d6a17cc7a44 100644 --- a/doc/src/sgml/ref/select.sgml +++ b/doc/src/sgml/ref/select.sgml @@ -56,7 +56,7 @@ SELECT [ ALL | DISTINCT [ ON ( expressionalias [ ( column_alias [, ...] ) ] ] [ LATERAL ] function_name ( [ argument [, ...] ] ) [ AS ] alias ( column_definition [, ...] ) [ LATERAL ] function_name ( [ argument [, ...] ] ) AS ( column_definition [, ...] ) - [ LATERAL ] TABLE( function_name ( [ argument [, ...] ] ) [ AS ( column_definition [, ...] ) ] [, ...] ) + [ LATERAL ] ROWS FROM( function_name ( [ argument [, ...] ] ) [ AS ( column_definition [, ...] ) ] [, ...] ) [ WITH ORDINALITY ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] from_item [ NATURAL ] join_type from_item [ ON join_condition | USING ( join_column [, ...] ) ] @@ -390,7 +390,7 @@ TABLE [ ONLY ] table_name [ * ] Multiple function calls can be combined into a single FROM-clause item by surrounding them - with TABLE( ... ). The output of such an item is the + with ROWS FROM( ... ). The output of such an item is the concatenation of the first row from each function, then the second row from each function, etc. If some of the functions produce fewer rows than others, NULLs are substituted for the missing data, so @@ -410,18 +410,18 @@ TABLE [ ONLY ] table_name [ * ] - When using the TABLE( ... ) syntax, if one of the + When using the ROWS FROM( ... ) syntax, if one of the functions requires a column definition list, it's preferred to put the column definition list after the function call inside - TABLE( ... ). A column definition list can be placed - after the TABLE( ... ) construct only if there's just a - single function and no WITH ORDINALITY clause. + ROWS FROM( ... ). A column definition list can be placed + after the ROWS FROM( ... ) construct only if there's just + a single function and no WITH ORDINALITY clause. To use ORDINALITY together with a column definition - list, you must use the TABLE( ... ) syntax and put the - column definition list inside TABLE( ... ). + list, you must use the ROWS FROM( ... ) syntax and put the + column definition list inside ROWS FROM( ... ). @@ -1811,8 +1811,7 @@ SELECT distributors.* WHERE distributors.name = 'Westward'; - Placing multiple function calls inside TABLE( ... ) syntax is - also an extension of the SQL standard. + ROWS FROM( ... ) is an extension of the SQL standard. -- cgit v1.2.3