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

Commit3ca814c

Browse files
committed
pathman: makefile changed in order to aggregate sql scripts
1 parent4a264d2 commit3ca814c

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

‎contrib/pathman/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.o
2+
*.so

‎contrib/pathman/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ MODULE_big = pathman
44
OBJS = init.o pathman.o$(WIN32RES)
55

66
EXTENSION = pathman
7+
EXTVERSION = 0.1
78
DATA = pathman--0.1.sql
89
PGFILEDESC = "pathman - partitioning tool"
910

1011
REGRESS = pathman
1112

13+
$(EXTENSION)--$(EXTVERSION).sql: sql/init.sql sql/hash.sql sql/range.sql
14+
cat$^>$@
15+
1216
ifdefUSE_PGXS
1317
PG_CONFIG = pg_config
1418
PGXS :=$(shell$(PG_CONFIG) --pgxs)
@@ -18,4 +22,4 @@ subdir = contrib/pathman
1822
top_builddir = ../..
1923
include$(top_builddir)/src/Makefile.global
2024
include$(top_srcdir)/contrib/contrib-global.mk
21-
endif
25+
endif

‎contrib/pathman/sql/hash.sql

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*
22
* Creates hash partitions for specified relation
33
*/
4-
CREATE OR REPLACEFUNCTIONpublic.create_hash_partitions(
5-
INrelationTEXT
6-
,INattributeTEXT
7-
,INpartitions_countINTEGER
4+
CREATE OR REPLACEFUNCTIONcreate_hash_partitions(
5+
relationTEXT
6+
, attributeTEXT
7+
, partitions_countINTEGER
88
) RETURNS VOIDAS
99
$$
1010
DECLARE
@@ -24,12 +24,12 @@ BEGIN
2424
/* Create partitions and update pg_pathman configuration*/
2525
FOR partnumIN0..partitions_count-1
2626
LOOP
27-
EXECUTE format('CREATE TABLE %s_%s (LIKE %1$s INCLUDING ALL)',
28-
relation
27+
EXECUTE format('CREATE TABLE %s_%s (LIKE %1$s INCLUDING ALL)'
28+
,relation
2929
, partnum);
3030

3131
EXECUTE format('ALTER TABLE %s_%s INHERIT %1$s'
32-
relation
32+
,relation
3333
, partnum);
3434

3535
-- EXECUTE format('CREATE TABLE %s_%s () INHERITS (%1$s)', relation, partnum);
@@ -52,7 +52,7 @@ $$ LANGUAGE plpgsql;
5252
/*
5353
* Creates hash trigger for specified relation
5454
*/
55-
CREATE OR REPLACEFUNCTIONpublic.create_hash_insert_trigger(
55+
CREATE OR REPLACEFUNCTIONcreate_hash_insert_trigger(
5656
IN relationTEXT
5757
,IN attrTEXT
5858
,IN partitions_countINTEGER)
@@ -105,7 +105,7 @@ $$ LANGUAGE plpgsql;
105105
/*
106106
* Drops all partitions for specified relation
107107
*/
108-
CREATE OR REPLACEFUNCTIONpublic.drop_hash_partitions(IN relationTEXT)
108+
CREATE OR REPLACEFUNCTIONdrop_hash_partitions(IN relationTEXT)
109109
RETURNS VOIDAS
110110
$$
111111
DECLARE
@@ -135,7 +135,7 @@ $$ LANGUAGE plpgsql;
135135
/*
136136
* Drops hash trigger
137137
*/
138-
CREATE OR REPLACEFUNCTIONpublic.drop_hash_triggers(IN relationTEXT)
138+
CREATE OR REPLACEFUNCTIONdrop_hash_triggers(IN relationTEXT)
139139
RETURNS VOIDAS
140140
$$
141141
BEGIN
@@ -146,7 +146,7 @@ BEGIN
146146
END
147147
$$ LANGUAGE plpgsql;
148148

149-
CREATE OR REPLACEFUNCTIONpublic.create_hash_update_trigger(
149+
CREATE OR REPLACEFUNCTIONcreate_hash_update_trigger(
150150
IN relationTEXT
151151
,IN attrTEXT
152152
,IN partitions_countINTEGER)
File renamed without changes.

‎contrib/pathman/sql/range.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ BEGIN
6363
SELECT relfilenode INTO v_relid
6464
FROM pg_classWHERE relname= v_relation;
6565

66-
SELECTmax('max_dt') INTO v_part_timestampFROM pg_pathman_range_rels;
66+
SELECTmax(max_dt) INTO v_part_timestampFROM pg_pathman_range_rels;
6767

6868
/* Create partitions and update pg_pathman configuration*/
6969
FOR v_partnumIN0..v_premake-1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp