Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb78e4a7

Browse files
committed
clean code, comments
1 parent43fefff commitb78e4a7

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

‎init.sql

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -646,17 +646,20 @@ $$ LANGUAGE plpgsql STRICT;
646646
/*
647647
* Set new relname, schema and tablespace
648648
*/
649-
CREATEOR REPLACE FUNCTION @extschema@.alter_partition(relation REGCLASS,
650-
new_nameTEXT,
651-
new_schema REGNAMESPACE,
652-
new_tablespaceTEXT)
649+
CREATEOR REPLACE FUNCTION @extschema@.alter_partition(
650+
relationREGCLASS,
651+
new_nameTEXT,
652+
new_schemaREGNAMESPACE,
653+
new_tablespaceTEXT)
653654
RETURNS VOIDAS
654655
$$
655656
DECLARE
656-
orig_nameTEXT;
657-
orig_schemaOID;
657+
orig_nameTEXT;
658+
orig_schemaOID;
659+
658660
BEGIN
659-
SELECT relname, relnamespaceFROM pg_classWHEREoid= relation
661+
SELECT relname, relnamespaceFROM pg_class
662+
WHEREoid= relation
660663
INTO orig_name, orig_schema;
661664

662665
/* Alter table name*/
@@ -680,7 +683,8 @@ $$ LANGUAGE plpgsql;
680683
/*
681684
* Partitioning key
682685
*/
683-
CREATEOR REPLACE FUNCTION @extschema@.get_partition_key(relid REGCLASS)
686+
CREATEOR REPLACE FUNCTION @extschema@.get_partition_key(
687+
relidREGCLASS)
684688
RETURNSTEXTAS
685689
$$
686690
SELECT attnameFROM pathman_configWHERE partrel= relid;

‎src/partition_creation.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,12 +1136,12 @@ build_raw_range_check_tree(char *attname,
11361136
ColumnRef*col_ref=makeNode(ColumnRef);
11371137

11381138
/* Partitioned column */
1139-
col_ref->fields=list_make1(makeString(attname));
1139+
col_ref->fields=list_make1(makeString(attname));
11401140
col_ref->location=-1;
11411141

1142-
and_oper->boolop=AND_EXPR;
1143-
and_oper->args=NIL;
1144-
and_oper->location=-1;
1142+
and_oper->boolop=AND_EXPR;
1143+
and_oper->args=NIL;
1144+
and_oper->location=-1;
11451145

11461146
/* Left comparison (VAR >= start_value) */
11471147
if (!IsInfinite(start_value))
@@ -1156,6 +1156,7 @@ build_raw_range_check_tree(char *attname,
11561156
left_arg->lexpr= (Node*)col_ref;
11571157
left_arg->rexpr= (Node*)left_const;
11581158
left_arg->location=-1;
1159+
11591160
and_oper->args=lappend(and_oper->args,left_arg);
11601161
}
11611162

@@ -1172,9 +1173,11 @@ build_raw_range_check_tree(char *attname,
11721173
right_arg->lexpr= (Node*)col_ref;
11731174
right_arg->rexpr= (Node*)right_const;
11741175
right_arg->location=-1;
1176+
11751177
and_oper->args=lappend(and_oper->args,right_arg);
11761178
}
11771179

1180+
/* (-inf, +inf) */
11781181
if (and_oper->args==NIL)
11791182
elog(ERROR,"cannot create infinite range constraint");
11801183

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp