diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-05-12 20:10:05 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-05-12 20:10:05 +0000 |
commit | f9e4f611a18f64fd9106a72ec9af9e2220075780 (patch) | |
tree | bfbc1d3d9fb5a008d8fe3405dce3366659c7e7cc /src/backend/utils/adt/ruleutils.c | |
parent | 71009354c848964e657e540e24dac6b4c9a81570 (diff) | |
download | postgresql-f9e4f611a18f64fd9106a72ec9af9e2220075780.tar.gz postgresql-f9e4f611a18f64fd9106a72ec9af9e2220075780.zip |
First pass at set-returning-functions in FROM, by Joe Conway with
some kibitzing from Tom Lane. Not everything works yet, and there's
no documentation or regression test, but let's commit this so Joe
doesn't need to cope with tracking changes in so many files ...
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index b1f012d4d9d..b4bd3b2f514 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -3,7 +3,7 @@ * back to source text * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.102 2002/05/03 20:15:02 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.103 2002/05/12 20:10:04 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -705,25 +705,16 @@ deparse_context_for_plan(int outer_varno, Node *outercontext, } /* - * deparse_context_for_relation - Build deparse context for 1 relation + * deparse_context_for_rte - Build deparse context for 1 relation * * Helper routine to build one of the inputs for deparse_context_for_plan. - * Pass the reference name (alias) and OID of a relation. * - * The returned node is actually a RangeTblEntry, but we declare it as just - * Node to discourage callers from assuming anything. + * The returned node is actually the given RangeTblEntry, but we declare it + * as just Node to discourage callers from assuming anything. */ Node * -deparse_context_for_relation(const char *aliasname, Oid relid) +deparse_context_for_rte(RangeTblEntry *rte) { - RangeTblEntry *rte = makeNode(RangeTblEntry); - - rte->rtekind = RTE_RELATION; - rte->relid = relid; - rte->eref = makeAlias(aliasname, NIL); - rte->inh = false; - rte->inFromCl = true; - return (Node *) rte; } @@ -2398,6 +2389,10 @@ get_from_clause_item(Node *jtnode, Query *query, deparse_context *context) get_query_def(rte->subquery, buf, context->namespaces); appendStringInfoChar(buf, ')'); break; + case RTE_FUNCTION: + /* Function RTE */ + get_rule_expr(rte->funcexpr, context); + break; default: elog(ERROR, "unexpected rte kind %d", (int) rte->rtekind); break; |