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');
533
533
```
534
534
535
535
Here's an example of the query performing filtering by partitioning key:
536
- ```
536
+ ``` plpgsql
537
537
SELECT * FROM journal WHERE dt >= ' 2015-06-01' AND dt < ' 2015-06-03' ;
538
538
id | dt | level | msg
539
539
-- ------+---------------------+-------+----------------------------------
Original file line number Diff line number Diff line change @@ -582,7 +582,7 @@ BEGIN
582
582
583
583
/* Check if this is a RANGE partition */
584
584
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 ;
586
586
END IF;
587
587
588
588
v_atttype = @extschema@.get_attribute_type(v_parent, v_attname);
@@ -1036,11 +1036,22 @@ DECLARE
1036
1036
part_name TEXT ;
1037
1037
v_relkind CHAR ;
1038
1038
v_rows BIGINT ;
1039
+ v_part_type INTEGER ;
1039
1040
1040
1041
BEGIN
1041
1042
parent_relid := @extschema@.get_parent_of_partition(p_partition);
1042
1043
part_name := p_partition::TEXT ; /* save the name to be returned */
1043
1044
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
+
1044
1055
/* Acquire lock on parent */
1045
1056
PERFORM @extschema@.lock_partitioned_relation(parent_relid);
1046
1057
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ init_partition_filter_static_data(void)
92
92
NULL ,
93
93
& pg_pathman_enable_partition_filter ,
94
94
true,
95
- PGC_SUSET ,
95
+ PGC_USERSET ,
96
96
0 ,
97
97
NULL ,
98
98
NULL ,
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ get_parent_of_partition_pl(PG_FUNCTION_ARGS)
173
173
PG_RETURN_OID (parent );
174
174
else
175
175
{
176
- elog (ERROR , "\%s\" is not pg_pathman's partition" ,
176
+ elog (ERROR , "\" %s\" is not a partition" ,
177
177
get_rel_name_or_relid (partition ));
178
178
179
179
PG_RETURN_NULL ();
You can’t perform that action at this time.
0 commit comments