mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 10:30:33 +03:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -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"), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user