Skip to content

Commit 5567629

Browse files
committed
remove useless event handlers (@extschema@.on_*)
1 parent f7d62b5 commit 5567629

File tree

4 files changed

+0
-126
lines changed

4 files changed

+0
-126
lines changed

hash.sql

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ BEGIN
4545
partition_names,
4646
tablespaces);
4747

48-
/* Notify backend about changes */
49-
PERFORM @extschema@.on_create_partitions(parent_relid);
50-
5148
/* Copy data */
5249
IF partition_data = true THEN
5350
PERFORM @extschema@.set_enable_parent(parent_relid, false);
@@ -156,9 +153,6 @@ BEGIN
156153
new_partition,
157154
p_init_callback);
158155

159-
/* Invalidate cache */
160-
PERFORM @extschema@.on_update_partitions(parent_relid);
161-
162156
RETURN new_partition;
163157
END
164158
$$

init.sql

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,6 @@ BEGIN
432432

433433
/* Drop triggers on update */
434434
PERFORM @extschema@.drop_triggers(parent_relid);
435-
436-
/* Notify backend about changes */
437-
PERFORM @extschema@.on_remove_partitions(parent_relid);
438435
END
439436
$$
440437
LANGUAGE plpgsql STRICT;
@@ -637,9 +634,6 @@ BEGIN
637634
v_part_count := v_part_count + 1;
638635
END LOOP;
639636

640-
/* Notify backend about changes */
641-
PERFORM @extschema@.on_remove_partitions(parent_relid);
642-
643637
RETURN v_part_count;
644638
END
645639
$$ LANGUAGE plpgsql
@@ -762,23 +756,6 @@ ON sql_drop
762756
EXECUTE PROCEDURE @extschema@.pathman_ddl_trigger_func();
763757

764758

765-
766-
CREATE OR REPLACE FUNCTION @extschema@.on_create_partitions(
767-
relid REGCLASS)
768-
RETURNS VOID AS 'pg_pathman', 'on_partitions_created'
769-
LANGUAGE C STRICT;
770-
771-
CREATE OR REPLACE FUNCTION @extschema@.on_update_partitions(
772-
relid REGCLASS)
773-
RETURNS VOID AS 'pg_pathman', 'on_partitions_updated'
774-
LANGUAGE C STRICT;
775-
776-
CREATE OR REPLACE FUNCTION @extschema@.on_remove_partitions(
777-
relid REGCLASS)
778-
RETURNS VOID AS 'pg_pathman', 'on_partitions_removed'
779-
LANGUAGE C STRICT;
780-
781-
782759
/*
783760
* Get number of partitions managed by pg_pathman.
784761
*/

range.sql

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@ BEGIN
169169
NULL);
170170
END IF;
171171

172-
/* Notify backend about changes */
173-
PERFORM @extschema@.on_create_partitions(parent_relid);
174-
175172
/* Relocate data if asked to */
176173
IF partition_data = true THEN
177174
PERFORM @extschema@.set_enable_parent(parent_relid, false);
@@ -267,9 +264,6 @@ BEGIN
267264
NULL);
268265
END IF;
269266

270-
/* Notify backend about changes */
271-
PERFORM @extschema@.on_create_partitions(parent_relid);
272-
273267
/* Relocate data if asked to */
274268
IF partition_data = true THEN
275269
PERFORM @extschema@.set_enable_parent(parent_relid, false);
@@ -326,9 +320,6 @@ BEGIN
326320
partition_names,
327321
tablespaces);
328322

329-
/* Notify backend about changes */
330-
PERFORM @extschema@.on_create_partitions(parent_relid);
331-
332323
/* Relocate data if asked to */
333324
IF partition_data = true THEN
334325
PERFORM @extschema@.set_enable_parent(parent_relid, false);
@@ -386,9 +377,6 @@ BEGIN
386377
part_count := part_count + 1;
387378
END LOOP;
388379

389-
/* Notify backend about changes */
390-
PERFORM @extschema@.on_create_partitions(parent_relid);
391-
392380
/* Relocate data if asked to */
393381
IF partition_data = true THEN
394382
PERFORM @extschema@.set_enable_parent(parent_relid, false);
@@ -448,9 +436,6 @@ BEGIN
448436
part_count := part_count + 1;
449437
END LOOP;
450438

451-
/* Notify backend about changes */
452-
PERFORM @extschema@.on_create_partitions(parent_relid);
453-
454439
/* Relocate data if asked to */
455440
IF partition_data = true THEN
456441
PERFORM @extschema@.set_enable_parent(parent_relid, false);
@@ -551,9 +536,6 @@ BEGIN
551536
partition_relid::TEXT,
552537
v_check_name,
553538
v_cond);
554-
555-
/* Tell backend to reload configuration */
556-
PERFORM @extschema@.on_update_partitions(v_parent);
557539
END
558540
$$
559541
LANGUAGE plpgsql;
@@ -615,8 +597,6 @@ BEGIN
615597
INTO
616598
v_part_name;
617599

618-
/* Invalidate cache */
619-
PERFORM @extschema@.on_update_partitions(parent_relid);
620600
RETURN v_part_name;
621601
END
622602
$$
@@ -725,8 +705,6 @@ BEGIN
725705
INTO
726706
v_part_name;
727707

728-
/* Invalidate cache */
729-
PERFORM @extschema@.on_update_partitions(parent_relid);
730708
RETURN v_part_name;
731709
END
732710
$$
@@ -828,7 +806,6 @@ BEGIN
828806
end_value,
829807
partition_name,
830808
tablespace);
831-
PERFORM @extschema@.on_update_partitions(parent_relid);
832809

833810
RETURN v_part_name;
834811
END
@@ -893,9 +870,6 @@ BEGIN
893870
EXECUTE format('DROP TABLE %s', partition_relid::TEXT);
894871
END IF;
895872

896-
/* Invalidate cache */
897-
PERFORM @extschema@.on_update_partitions(parent_relid);
898-
899873
RETURN part_name;
900874
END
901875
$$
@@ -978,9 +952,6 @@ BEGIN
978952
start_value,
979953
end_value);
980954

981-
/* Invalidate cache */
982-
PERFORM @extschema@.on_update_partitions(parent_relid);
983-
984955
RETURN partition_relid;
985956
END
986957
$$
@@ -1026,9 +997,6 @@ BEGIN
1026997
@extschema@.build_update_trigger_name(parent_relid),
1027998
partition_relid::TEXT);
1028999

1029-
/* Invalidate cache */
1030-
PERFORM @extschema@.on_update_partitions(parent_relid);
1031-
10321000
RETURN partition_relid;
10331001
END
10341002
$$

src/pl_funcs.c

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@
3838

3939
/* Function declarations */
4040

41-
PG_FUNCTION_INFO_V1( on_partitions_created );
42-
PG_FUNCTION_INFO_V1( on_partitions_updated );
43-
PG_FUNCTION_INFO_V1( on_partitions_removed );
44-
4541
PG_FUNCTION_INFO_V1( get_number_of_partitions_pl );
4642
PG_FUNCTION_INFO_V1( get_parent_of_partition_pl );
4743
PG_FUNCTION_INFO_V1( get_base_type_pl );
@@ -103,10 +99,6 @@ typedef struct
10399
} show_cache_stats_cxt;
104100

105101

106-
static void on_partitions_created_internal(Oid partitioned_table, bool add_callbacks);
107-
static void on_partitions_updated_internal(Oid partitioned_table, bool add_callbacks);
108-
static void on_partitions_removed_internal(Oid partitioned_table, bool add_callbacks);
109-
110102
static void pathman_update_trigger_func_move_tuple(Relation source_rel,
111103
Relation target_rel,
112104
HeapTuple old_tuple,
@@ -120,63 +112,6 @@ check_relation_exists(Oid relid)
120112
}
121113

122114

123-
/*
124-
* ----------------------------
125-
* Partition events callbacks
126-
* ----------------------------
127-
*/
128-
129-
static void
130-
on_partitions_created_internal(Oid partitioned_table, bool add_callbacks)
131-
{
132-
elog(DEBUG2, "on_partitions_created() [add_callbacks = %s] "
133-
"triggered for relation %u",
134-
(add_callbacks ? "true" : "false"), partitioned_table);
135-
}
136-
137-
static void
138-
on_partitions_updated_internal(Oid partitioned_table, bool add_callbacks)
139-
{
140-
bool entry_found;
141-
142-
elog(DEBUG2, "on_partitions_updated() [add_callbacks = %s] "
143-
"triggered for relation %u",
144-
(add_callbacks ? "true" : "false"), partitioned_table);
145-
146-
invalidate_pathman_relation_info(partitioned_table, &entry_found);
147-
}
148-
149-
static void
150-
on_partitions_removed_internal(Oid partitioned_table, bool add_callbacks)
151-
{
152-
elog(DEBUG2, "on_partitions_removed() [add_callbacks = %s] "
153-
"triggered for relation %u",
154-
(add_callbacks ? "true" : "false"), partitioned_table);
155-
}
156-
157-
158-
Datum
159-
on_partitions_created(PG_FUNCTION_ARGS)
160-
{
161-
on_partitions_created_internal(PG_GETARG_OID(0), true);
162-
PG_RETURN_NULL();
163-
}
164-
165-
Datum
166-
on_partitions_updated(PG_FUNCTION_ARGS)
167-
{
168-
on_partitions_updated_internal(PG_GETARG_OID(0), true);
169-
PG_RETURN_NULL();
170-
}
171-
172-
Datum
173-
on_partitions_removed(PG_FUNCTION_ARGS)
174-
{
175-
on_partitions_removed_internal(PG_GETARG_OID(0), true);
176-
PG_RETURN_NULL();
177-
}
178-
179-
180115
/*
181116
* ------------------------
182117
* Various useful getters

0 commit comments

Comments
 (0)