diff options
| author | Michael P | 2011-03-10 05:42:35 +0000 |
|---|---|---|
| committer | Pavan Deolasee | 2011-05-24 09:41:29 +0000 |
| commit | 8a3fec65c055440b594468c98dfae68e2e9d99ef (patch) | |
| tree | 2a55c15d3233d933483ff8fb73c06086814ee34f /src/backend/optimizer | |
| parent | 6c9638d7f6a65affb70813ee74220744c4e18d56 (diff) | |
Fix for bug 3201711: Sequence view crash
This query was pushed down to Datanodes,
but it has to be launched on Local Coordinator.
CREATE SEQUENCE foo;
select * from foo;
This fix is important for pg_admin.
Diffstat (limited to 'src/backend/optimizer')
| -rw-r--r-- | src/backend/optimizer/path/allpaths.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index d06e8e647a..d5acb48bb1 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -35,6 +35,8 @@ #include "parser/parse_clause.h" #include "parser/parsetree.h" #ifdef PGXC +#include "catalog/pg_namespace.h" +#include "catalog/pg_class.h" #include "pgxc/pgxc.h" #endif #include "rewrite/rewriteManip.h" @@ -262,11 +264,13 @@ set_plain_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) #ifdef PGXC /* * If we are on the coordinator, we always want to use - * the remote query path unless it is a pg_catalog table. + * the remote query path unless it is a pg_catalog table + * or a sequence relation. */ if (IS_PGXC_COORDINATOR && !IsConnFromCoord() && - get_rel_namespace(rte->relid) != PG_CATALOG_NAMESPACE) + get_rel_namespace(rte->relid) != PG_CATALOG_NAMESPACE && + get_rel_relkind(rte->relid) != RELKIND_SEQUENCE) add_path(rel, create_remotequery_path(root, rel)); else { |
