aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_clause.c
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2013-12-10 09:34:37 -0500
committerNoah Misch <noah@leadboat.com>2013-12-10 09:34:37 -0500
commit53685d79813a46c7e3a46ae4b1210f608d41d6ab (patch)
tree8760f628f2d5baf874307624248f92e80475d9ca /src/backend/parser/parse_clause.c
parent01cc1fecfdecc37649b3996100ab1f03ccc8ab7e (diff)
downloadpostgresql-53685d79813a46c7e3a46ae4b1210f608d41d6ab.tar.gz
postgresql-53685d79813a46c7e3a46ae4b1210f608d41d6ab.zip
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().
Diffstat (limited to 'src/backend/parser/parse_clause.c')
-rw-r--r--src/backend/parser/parse_clause.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 8b4c0ae0d3b..939fa834e0a 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -655,25 +655,25 @@ transformRangeFunction(ParseState *pstate, RangeFunction *r)
* expansion) and no WITH ORDINALITY. The reason for the latter
* restriction is that it's not real clear whether the ordinality column
* should be in the coldeflist, and users are too likely to make mistakes
- * in one direction or the other. Putting the coldeflist inside TABLE()
- * is much clearer in this case.
+ * in one direction or the other. Putting the coldeflist inside ROWS
+ * FROM() is much clearer in this case.
*/
if (r->coldeflist)
{
if (list_length(funcexprs) != 1)
{
- if (r->is_table)
+ if (r->is_rowsfrom)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("TABLE() with multiple functions cannot have a column definition list"),
- errhint("Put a separate column definition list for each function inside TABLE()."),
+ errmsg("ROWS FROM() with multiple functions cannot have a column definition list"),
+ errhint("Put a separate column definition list for each function inside ROWS FROM()."),
parser_errposition(pstate,
exprLocation((Node *) r->coldeflist))));
else
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("UNNEST() with multiple arguments cannot have a column definition list"),
- errhint("Use separate UNNEST() calls inside TABLE(), and attach a column definition list to each one."),
+ errhint("Use separate UNNEST() calls inside ROWS FROM(), and attach a column definition list to each one."),
parser_errposition(pstate,
exprLocation((Node *) r->coldeflist))));
}
@@ -681,7 +681,7 @@ transformRangeFunction(ParseState *pstate, RangeFunction *r)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("WITH ORDINALITY cannot be used with a column definition list"),
- errhint("Put the column definition list inside TABLE()."),
+ errhint("Put the column definition list inside ROWS FROM()."),
parser_errposition(pstate,
exprLocation((Node *) r->coldeflist))));