diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-09-29 18:21:41 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-09-29 18:21:41 +0000 |
commit | 3a94e789f5c9537d804210be3cb26f7fb08e3b9e (patch) | |
tree | f1eac12405e3c0ded881d7dd7e59cec35b30c335 /src/backend/optimizer/util/plancat.c | |
parent | 6f64c2e54a0b14154a335249f4dca91a39c61c50 (diff) | |
download | postgresql-3a94e789f5c9537d804210be3cb26f7fb08e3b9e.tar.gz |
Subselects in FROM clause, per ISO syntax: FROM (SELECT ...) [AS] alias.
(Don't forget that an alias is required.) Views reimplemented as expanding
to subselect-in-FROM. Grouping, aggregates, DISTINCT in views actually
work now (he says optimistically). No UNION support in subselects/views
yet, but I have some ideas about that. Rule-related permissions checking
moved out of rewriter and into executor.
INITDB REQUIRED!
Diffstat (limited to 'src/backend/optimizer/util/plancat.c')
-rw-r--r-- | src/backend/optimizer/util/plancat.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index 750a463122..0d32e82ed9 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.60 2000/07/27 23:16:04 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.61 2000/09/29 18:21:23 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -25,7 +25,6 @@ #include "catalog/pg_inherits.h" #include "catalog/pg_index.h" #include "optimizer/plancat.h" -#include "parser/parsetree.h" #include "utils/builtins.h" #include "utils/fmgroids.h" #include "utils/relcache.h" @@ -37,16 +36,15 @@ /* * relation_info - * Retrieves catalog information for a given relation. - * Given the rangetable index of the relation, return the following info: + * Given the Oid of the relation, return the following info: * whether the relation has secondary indices * number of pages * number of tuples */ void -relation_info(Query *root, Index relid, +relation_info(Oid relationObjectId, bool *hasindex, long *pages, double *tuples) { - Oid relationObjectId = getrelid(relid, root->rtable); HeapTuple relationTuple; Form_pg_class relation; @@ -69,19 +67,18 @@ relation_info(Query *root, Index relid, /* * find_secondary_indexes * Creates a list of IndexOptInfo nodes containing information for each - * secondary index defined on the given relation. + * secondary index defined on the specified relation. * - * 'relid' is the RT index of the relation for which indices are being located + * 'relationObjectId' is the OID of the relation for which indices are wanted * * Returns a list of new IndexOptInfo nodes. */ List * -find_secondary_indexes(Query *root, Index relid) +find_secondary_indexes(Oid relationObjectId) { List *indexinfos = NIL; List *indexoidlist, *indexoidscan; - Oid indrelid = getrelid(relid, root->rtable); Relation relation; /* @@ -89,12 +86,12 @@ find_secondary_indexes(Query *root, Index relid) * a cached list of OID indexes for each relation. So, get that list * and then use the syscache to obtain pg_index entries. */ - relation = heap_open(indrelid, AccessShareLock); + relation = heap_open(relationObjectId, AccessShareLock); indexoidlist = RelationGetIndexList(relation); foreach(indexoidscan, indexoidlist) { - Oid indexoid = lfirsti(indexoidscan); + Oid indexoid = lfirsti(indexoidscan); HeapTuple indexTuple; Form_pg_index index; IndexOptInfo *info; |