Skip to content

Commit 4ddfbb5

Browse files
committed
introduce new function xact_conflicting_lock_exists(), rename functions related to concurrent partitioning, split worker.c into pathman_workers.c & pathman_workers.h, medium refactoring & fixes
2 parents 0084ae6 + 67d8a5d commit 4ddfbb5

18 files changed

+908
-591
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
MODULE_big = pg_pathman
44
OBJS = src/init.o src/relation_info.o src/utils.o src/partition_filter.o src/runtimeappend.o \
55
src/runtime_merge_append.o src/pg_pathman.o src/dsm_array.o src/rangeset.o src/pl_funcs.o \
6-
src/worker.o src/hooks.o src/nodes_common.o $(WIN32RES)
6+
src/pathman_workers.o src/hooks.o src/nodes_common.o src/xact_handling.o $(WIN32RES)
77

88
EXTENSION = pg_pathman
99
EXTVERSION = 0.1

hash.sql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ CREATE OR REPLACE FUNCTION @extschema@.create_hash_partitions(
1515
parent_relid REGCLASS,
1616
attribute TEXT,
1717
partitions_count INTEGER,
18-
partition_data BOOLEAN DEFAULT true
19-
) RETURNS INTEGER AS
18+
partition_data BOOLEAN DEFAULT true)
19+
RETURNS INTEGER AS
2020
$$
2121
DECLARE
2222
v_child_relname TEXT;
@@ -26,6 +26,9 @@ DECLARE
2626
v_hashfunc TEXT;
2727

2828
BEGIN
29+
/* Acquire exclusive lock on parent */
30+
PERFORM @extschema@.lock_partitioned_relation(parent_relid);
31+
2932
PERFORM @extschema@.validate_relname(parent_relid);
3033
attribute := lower(attribute);
3134
PERFORM @extschema@.common_relation_checks(parent_relid, attribute);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy