1
- /* **********************************************************************
1
+ /* ------------------------------------------------------------------------
2
+ *
3
+ * pg_pathman--1.0--1.1.sql
4
+ * Migration scripts to version 1.1
5
+ *
6
+ * Copyright (c) 2015-2016, Postgres Professional
7
+ *
8
+ * ------------------------------------------------------------------------
9
+ */
10
+
11
+
12
+ /* ------------------------------------------------------------------------
2
13
* Modify config params table
3
- ********************************************************************* */
14
+ * ---------------------------------------------------------------------- */
4
15
ALTER TABLE @extschema@.pathman_config_params ADD COLUMN init_callback REGPROCEDURE NOT NULL DEFAULT 0 ;
5
16
ALTER TABLE @extschema@.pathman_config_params ALTER COLUMN enable_parent SET DEFAULT FALSE;
6
17
7
- /* Enable permissions */
18
+
19
+ /* ------------------------------------------------------------------------
20
+ * Enable permissions
21
+ * ----------------------------------------------------------------------*/
8
22
GRANT SELECT , INSERT, UPDATE , DELETE
9
23
ON @extschema@.pathman_config, @extschema@.pathman_config_params
10
24
TO public;
@@ -27,8 +41,10 @@ ALTER TABLE @extschema@.pathman_config_params ENABLE ROW LEVEL SECURITY;
27
41
28
42
GRANT SELECT ON @extschema@.pathman_concurrent_part_tasks TO PUBLIC;
29
43
30
- /* Drop irrelevant functions */
31
- DROP FUNCTION @extschema@.invalidate_relcache(OID );
44
+
45
+ /* ------------------------------------------------------------------------
46
+ * Drop irrelevant functions
47
+ * ----------------------------------------------------------------------*/
32
48
DROP FUNCTION @extschema@.pathman_set_param(REGCLASS, TEXT , BOOLEAN );
33
49
DROP FUNCTION @extschema@.enable_parent(REGCLASS);
34
50
DROP FUNCTION @extschema@.disable_parent(relation REGCLASS);
@@ -61,7 +77,10 @@ DROP FUNCTION @extschema@.get_range_by_part_oid(REGCLASS, REGCLASS, ANYELEMENT);
61
77
DROP FUNCTION @extschema@.get_min_range_value(REGCLASS, ANYELEMENT);
62
78
DROP FUNCTION @extschema@.get_max_range_value(REGCLASS, ANYELEMENT);
63
79
64
- /* Alter functions' modifiers */
80
+
81
+ /* ------------------------------------------------------------------------
82
+ * Alter functions' modifiers
83
+ * ----------------------------------------------------------------------*/
65
84
ALTER FUNCTION @extschema@.partitions_count(REGCLASS) STRICT;
66
85
ALTER FUNCTION @extschema@.partition_data(REGCLASS, OUT BIGINT ) STRICT;
67
86
ALTER FUNCTION @extschema@.disable_pathman_for(REGCLASS) STRICT;
@@ -71,7 +90,29 @@ ALTER FUNCTION @extschema@.drop_triggers(REGCLASS) STRICT;
71
90
ALTER FUNCTION @extschema@.check_overlap(REGCLASS, ANYELEMENT, ANYELEMENT) CALLED ON NULL INPUT;
72
91
ALTER FUNCTION @extschema@.find_or_create_range_partition(REGCLASS, ANYELEMENT) CALLED ON NULL INPUT;
73
92
74
- /* Create functions */
93
+
94
+ /* ------------------------------------------------------------------------
95
+ * Add new views
96
+ * ----------------------------------------------------------------------*/
97
+ CREATE OR REPLACE FUNCTION @extschema@.show_partition_list()
98
+ RETURNS TABLE (
99
+ parent REGCLASS,
100
+ partition REGCLASS,
101
+ parttype INT4,
102
+ partattr TEXT ,
103
+ range_min TEXT ,
104
+ range_max TEXT )
105
+ AS ' pg_pathman' , ' show_partition_list_internal' LANGUAGE C STRICT;
106
+
107
+ CREATE OR REPLACE VIEW @extschema@.pathman_partition_list
108
+ AS SELECT * FROM @extschema@.show_partition_list();
109
+
110
+ GRANT SELECT ON @extschema@.pathman_partition_list TO PUBLIC;
111
+
112
+
113
+ /* ------------------------------------------------------------------------
114
+ * (Re)create functions
115
+ * ----------------------------------------------------------------------*/
75
116
CREATE OR REPLACE FUNCTION @extschema@.pathman_set_param(
76
117
relation REGCLASS,
77
118
param TEXT ,
0 commit comments