Skip to content

Commit 0042c46

Browse files
committed
minor fixes & improvements for PL/pgSQL code
1 parent f6cd9d5 commit 0042c46

File tree

4 files changed

+96
-128
lines changed

4 files changed

+96
-128
lines changed

expected/pg_pathman.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ SELECT pathman.create_range_partitions('test.range_rel', 'dt', '2015-01-01'::DAT
133133
ERROR: Partitioning key 'dt' must be NOT NULL
134134
ALTER TABLE test.range_rel ALTER COLUMN dt SET NOT NULL;
135135
SELECT pathman.create_range_partitions('test.range_rel', 'dt', '2015-01-01'::DATE, '1 month'::INTERVAL, 2);
136-
ERROR: Not enough partitions to fit all the values of 'dt'
136+
ERROR: Not enough partitions to fit all values of 'dt'
137137
SELECT pathman.create_range_partitions('test.range_rel', 'DT', '2015-01-01'::DATE, '1 month'::INTERVAL);
138138
NOTICE: sequence "range_rel_seq" does not exist, skipping
139139
create_range_partitions

hash.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ BEGIN
5353

5454
EXECUTE format('CREATE TABLE %1$s (LIKE %2$s INCLUDING ALL) INHERITS (%2$s)',
5555
v_child_relname,
56-
@extschema@.get_schema_qualified_name(parent_relid));
56+
parent_relid::TEXT);
5757

5858
EXECUTE format('ALTER TABLE %s ADD CONSTRAINT %s
5959
CHECK (@extschema@.get_hash_part_idx(%s(%s), %s) = %s)',
@@ -141,7 +141,7 @@ BEGIN
141141
attr := attname FROM @extschema@.pathman_config WHERE partrel = parent_relid;
142142

143143
IF attr IS NULL THEN
144-
RAISE EXCEPTION 'Table % is not partitioned', quote_ident(parent_relid::TEXT);
144+
RAISE EXCEPTION 'Table "%" is not partitioned', parent_relid::TEXT;
145145
END IF;
146146

147147
SELECT string_agg(attname, ', '),

init.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ BEGIN
268268
/* Create partitions and copy rest of the data */
269269
EXECUTE format('WITH part_data AS (DELETE FROM ONLY %1$s RETURNING *)
270270
INSERT INTO %1$s SELECT * FROM part_data',
271-
@extschema@.get_schema_qualified_name(parent_relid));
271+
parent_relid::TEXT);
272272

273273
/* Get number of inserted rows */
274274
GET DIAGNOSTICS p_total = ROW_COUNT;
@@ -317,7 +317,7 @@ BEGIN
317317

318318
IF rel_persistence = 't'::CHAR THEN
319319
RAISE EXCEPTION 'Temporary table "%" cannot be partitioned',
320-
quote_ident(p_relation::TEXT);
320+
p_relation::TEXT;
321321
END IF;
322322

323323
IF EXISTS (SELECT * FROM @extschema@.pathman_config

0 commit comments

Comments
 (0)