File tree Expand file tree Collapse file tree 4 files changed +15
-4
lines changed Expand file tree Collapse file tree 4 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -533,7 +533,7 @@ SELECT detach_range_partition('journal_archive');
533533```
534534
535535Here's an example of the query performing filtering by partitioning key:
536- ```
536+ ``` plpgsql
537537SELECT * FROM journal WHERE dt >= ' 2015-06-01' AND dt < ' 2015-06-03' ;
538538 id | dt | level | msg
539539-- ------+---------------------+-------+----------------------------------
Original file line number Diff line number Diff line change @@ -582,7 +582,7 @@ BEGIN
582582
583583 /* Check if this is a RANGE partition */
584584 IF v_part_type != 2 THEN
585- RAISE EXCEPTION ' specified partition isn ' ' t RANGE partition' ;
585+ RAISE EXCEPTION ' "%" is not a RANGE partition' , p_partition:: TEXT ;
586586 END IF;
587587
588588 v_atttype = @extschema@.get_attribute_type(v_parent, v_attname);
@@ -1036,11 +1036,22 @@ DECLARE
10361036 part_name TEXT ;
10371037 v_relkind CHAR ;
10381038 v_rows BIGINT ;
1039+ v_part_type INTEGER ;
10391040
10401041BEGIN
10411042 parent_relid := @extschema@.get_parent_of_partition(p_partition);
10421043 part_name := p_partition::TEXT ; /* save the name to be returned */
10431044
1045+ SELECT parttype
1046+ FROM @extschema@.pathman_config
1047+ WHERE partrel = parent_relid
1048+ INTO v_part_type;
1049+
1050+ /* Check if this is a RANGE partition */
1051+ IF v_part_type != 2 THEN
1052+ RAISE EXCEPTION ' "%" is not a RANGE partition' , p_partition::TEXT ;
1053+ END IF;
1054+
10441055 /* Acquire lock on parent */
10451056 PERFORM @extschema@.lock_partitioned_relation(parent_relid);
10461057
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ init_partition_filter_static_data(void)
9292 NULL ,
9393 & pg_pathman_enable_partition_filter ,
9494 true,
95- PGC_SUSET ,
95+ PGC_USERSET ,
9696 0 ,
9797 NULL ,
9898 NULL ,
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ get_parent_of_partition_pl(PG_FUNCTION_ARGS)
173173 PG_RETURN_OID (parent );
174174 else
175175 {
176- elog (ERROR , "\%s\" is not pg_pathman's partition" ,
176+ elog (ERROR , "\" %s\" is not a partition" ,
177177 get_rel_name_or_relid (partition ));
178178
179179 PG_RETURN_NULL ();
You can’t perform that action at this time.
0 commit comments