File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -38,15 +38,21 @@ DECLARE
38
38
tablespace_name NAME;
39
39
main_table_has_items BOOLEAN ;
40
40
is_hypertable BOOLEAN ;
41
+ is_partitioned BOOLEAN ;
41
42
chunk_time_interval_actual BIGINT ;
42
43
time_type REGTYPE;
43
44
BEGIN
44
- SELECT relname, nspname, reltablespace
45
- INTO STRICT table_name, schema_name, tablespace_oid
45
+ SELECT relname, nspname, reltablespace, relkind = ' p '
46
+ INTO STRICT table_name, schema_name, tablespace_oid, is_partitioned
46
47
FROM pg_class c
47
48
INNER JOIN pg_namespace n ON (n .OID = c .relnamespace )
48
49
WHERE c .OID = main_table;
49
50
51
+ IF is_partitioned THEN
52
+ RAISE EXCEPTION ' table % is already partitioned' , main_table
53
+ USING ERRCODE = ' IO110' ;
54
+ END IF;
55
+
50
56
SELECT tableowner
51
57
INTO STRICT table_owner
52
58
FROM pg_catalog .pg_tables
You can’t perform that action at this time.
0 commit comments