Skip to content

Commit b4dd837

Browse files
committed
reformat Pl/PgSQL code
1 parent beaf8dd commit b4dd837

File tree

3 files changed

+25
-30
lines changed

3 files changed

+25
-30
lines changed

hash.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ BEGIN
273273
END
274274
$$ LANGUAGE plpgsql;
275275

276+
276277
/*
277278
* Just create HASH partitions, called by create_hash_partitions().
278279
*/

init.sql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ CREATE OR REPLACE FUNCTION @extschema@.check_security_policy(relation regclass)
9595
RETURNS BOOL AS 'pg_pathman', 'check_security_policy' LANGUAGE C STRICT;
9696

9797
/*
98-
* Row security policy to restrict partitioning operations to owner and
99-
* superusers only
98+
* Row security policy to restrict partitioning operations to owner and superusers only
10099
*/
101100
CREATE POLICY deny_modification ON @extschema@.pathman_config
102101
FOR ALL USING (check_security_policy(partrel));

range.sql

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -529,15 +529,6 @@ END
529529
$$
530530
LANGUAGE plpgsql;
531531

532-
/*
533-
* Merge multiple partitions. All data will be copied to the first one.
534-
* The rest of partitions will be dropped.
535-
*/
536-
CREATE OR REPLACE FUNCTION @extschema@.merge_range_partitions(
537-
partitions REGCLASS[])
538-
RETURNS VOID AS 'pg_pathman', 'merge_range_partitions'
539-
LANGUAGE C STRICT;
540-
541532
/*
542533
* The special case of merging two partitions
543534
*/
@@ -656,7 +647,6 @@ END
656647
$$
657648
LANGUAGE plpgsql;
658649

659-
660650
/*
661651
* Prepend new partition.
662652
*/
@@ -762,7 +752,6 @@ END
762752
$$
763753
LANGUAGE plpgsql;
764754

765-
766755
/*
767756
* Add new partition
768757
*/
@@ -807,7 +796,6 @@ END
807796
$$
808797
LANGUAGE plpgsql;
809798

810-
811799
/*
812800
* Drop range partition
813801
*/
@@ -874,20 +862,6 @@ $$
874862
LANGUAGE plpgsql
875863
SET pg_pathman.enable_partitionfilter = off; /* ensures that PartitionFilter is OFF */
876864

877-
878-
/*
879-
* Drops partition and expands the next partition so that it cover dropped
880-
* one
881-
*
882-
* This function was written in order to support Oracle-like ALTER TABLE ...
883-
* DROP PARTITION. In Oracle partitions only have upper bound and when
884-
* partition is dropped the next one automatically covers freed range
885-
*/
886-
CREATE OR REPLACE FUNCTION @extschema@.drop_range_partition_expand_next(relid REGCLASS)
887-
RETURNS VOID AS 'pg_pathman', 'drop_range_partition_expand_next'
888-
LANGUAGE C STRICT;
889-
890-
891865
/*
892866
* Attach range partition
893867
*/
@@ -966,7 +940,6 @@ END
966940
$$
967941
LANGUAGE plpgsql;
968942

969-
970943
/*
971944
* Detach range partition
972945
*/
@@ -1010,7 +983,6 @@ END
1010983
$$
1011984
LANGUAGE plpgsql;
1012985

1013-
1014986
/*
1015987
* Creates an update trigger
1016988
*/
@@ -1107,6 +1079,29 @@ BEGIN
11071079
END
11081080
$$ LANGUAGE plpgsql;
11091081

1082+
1083+
/*
1084+
* Merge multiple partitions. All data will be copied to the first one.
1085+
* The rest of partitions will be dropped.
1086+
*/
1087+
CREATE OR REPLACE FUNCTION @extschema@.merge_range_partitions(
1088+
partitions REGCLASS[])
1089+
RETURNS VOID AS 'pg_pathman', 'merge_range_partitions'
1090+
LANGUAGE C STRICT;
1091+
1092+
/*
1093+
* Drops partition and expands the next partition so that it cover dropped
1094+
* one
1095+
*
1096+
* This function was written in order to support Oracle-like ALTER TABLE ...
1097+
* DROP PARTITION. In Oracle partitions only have upper bound and when
1098+
* partition is dropped the next one automatically covers freed range
1099+
*/
1100+
CREATE OR REPLACE FUNCTION @extschema@.drop_range_partition_expand_next(
1101+
partition REGCLASS)
1102+
RETURNS VOID AS 'pg_pathman', 'drop_range_partition_expand_next'
1103+
LANGUAGE C STRICT;
1104+
11101105
/*
11111106
* Creates new RANGE partition. Returns partition name.
11121107
* NOTE: This function SHOULD NOT take xact_handling lock (BGWs in 9.5).

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