diff options
author | Noah Misch <noah@leadboat.com> | 2013-12-10 09:34:37 -0500 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2013-12-10 09:34:37 -0500 |
commit | 53685d79813a46c7e3a46ae4b1210f608d41d6ab (patch) | |
tree | 8760f628f2d5baf874307624248f92e80475d9ca /src/backend/utils/adt/ruleutils.c | |
parent | 01cc1fecfdecc37649b3996100ab1f03ccc8ab7e (diff) | |
download | postgresql-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/utils/adt/ruleutils.c')
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 348f620f2a4..86c0a582539 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -8125,10 +8125,10 @@ get_from_clause_item(Node *jtnode, Query *query, deparse_context *context) rtfunc1 = (RangeTblFunction *) linitial(rte->functions); /* - * Omit TABLE() syntax if there's just one function, unless it + * Omit ROWS FROM() syntax for just one function, unless it * has both a coldeflist and WITH ORDINALITY. If it has both, - * we must use TABLE() syntax to avoid ambiguity about whether - * the coldeflist includes the ordinality column. + * we must use ROWS FROM() syntax to avoid ambiguity about + * whether the coldeflist includes the ordinality column. */ if (list_length(rte->functions) == 1 && (rtfunc1->funccolnames == NIL || !rte->funcordinality)) @@ -8151,8 +8151,8 @@ get_from_clause_item(Node *jtnode, Query *query, deparse_context *context) * XXX This is pretty ugly, since it makes not-terribly- * future-proof assumptions about what the parser would do * with the output; but the alternative is to emit our - * nonstandard extended TABLE() notation for what might - * have been a perfectly spec-compliant multi-argument + * nonstandard ROWS FROM() notation for what might have + * been a perfectly spec-compliant multi-argument * UNNEST(). */ all_unnest = true; @@ -8189,7 +8189,7 @@ get_from_clause_item(Node *jtnode, Query *query, deparse_context *context) { int funcno = 0; - appendStringInfoString(buf, "TABLE("); + appendStringInfoString(buf, "ROWS FROM("); foreach(lc, rte->functions) { RangeTblFunction *rtfunc = (RangeTblFunction *) lfirst(lc); @@ -8422,7 +8422,7 @@ get_column_alias_list(deparse_columns *colinfo, deparse_context *context) * * When printing a top-level coldeflist (which is syntactically also the * relation's column alias list), use column names from colinfo. But when - * printing a coldeflist embedded inside TABLE(), we prefer to use the + * printing a coldeflist embedded inside ROWS FROM(), we prefer to use the * original coldeflist's names, which are available in rtfunc->funccolnames. * Pass NULL for colinfo to select the latter behavior. * |