aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_clause.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-02-24 12:21:46 +0530
committerRobert Haas <rhaas@postgresql.org>2017-02-24 12:23:28 +0530
commit5dbdb2f799232cb1b6df7d7a85d59ade3234d30c (patch)
tree6ee90ab65f715022e61707733df02656d8da932e /src/backend/parser/parse_clause.c
parent6d493e1a013514a6f0abb5d30d08219c1831cfec (diff)
downloadpostgresql-5dbdb2f799232cb1b6df7d7a85d59ade3234d30c.tar.gz
postgresql-5dbdb2f799232cb1b6df7d7a85d59ade3234d30c.zip
Make tablesample work with partitioned tables.
This was an oversight in the original partitioning commit. Amit Langote, reviewed by David Fetter Discussion: http://postgr.es/m/59af6590-8ace-04c4-c36c-ea35d435c60e@lab.ntt.co.jp
Diffstat (limited to 'src/backend/parser/parse_clause.c')
-rw-r--r--src/backend/parser/parse_clause.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index fecc1d65984..b5eae56006d 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -907,7 +907,8 @@ transformFromClauseItem(ParseState *pstate, Node *n,
rte = rt_fetch(rtr->rtindex, pstate->p_rtable);
/* We only support this on plain relations and matviews */
if (rte->relkind != RELKIND_RELATION &&
- rte->relkind != RELKIND_MATVIEW)
+ rte->relkind != RELKIND_MATVIEW &&
+ rte->relkind != RELKIND_PARTITIONED_TABLE)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("TABLESAMPLE clause can only be applied to tables and materialized views"),