Skip to content

Commit bbe42b7

Browse files
committed
Merge branch 'PGPRO9_6' into PGPROEE9_6
2 parents c8672b5 + 0916714 commit bbe42b7

File tree

322 files changed

+2295
-2216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

322 files changed

+2295
-2216
lines changed

contrib/pg_pathman/README.md

Lines changed: 114 additions & 39 deletions
Large diffs are not rendered by default.

contrib/pg_pathman/expected/pathman_basic.out

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -889,9 +889,9 @@ SELECT * FROM test.hash_rel WHERE id = 123;
889889
*/
890890
SELECT pathman.drop_partitions('test.hash_rel');
891891
NOTICE: drop cascades to 3 other objects
892-
NOTICE: 2 rows copied from test.hash_rel_2
893-
NOTICE: 3 rows copied from test.hash_rel_1
894892
NOTICE: 2 rows copied from test.hash_rel_0
893+
NOTICE: 3 rows copied from test.hash_rel_1
894+
NOTICE: 2 rows copied from test.hash_rel_2
895895
drop_partitions
896896
-----------------
897897
3
@@ -925,11 +925,11 @@ SELECT COUNT(*) FROM ONLY test.hash_rel;
925925
DROP TABLE test.hash_rel CASCADE;
926926
SELECT pathman.drop_partitions('test.num_range_rel');
927927
NOTICE: drop cascades to 4 other objects
928-
NOTICE: 0 rows copied from test.num_range_rel_6
929-
NOTICE: 2 rows copied from test.num_range_rel_4
930-
NOTICE: 1000 rows copied from test.num_range_rel_3
931-
NOTICE: 1000 rows copied from test.num_range_rel_2
932928
NOTICE: 998 rows copied from test.num_range_rel_1
929+
NOTICE: 1000 rows copied from test.num_range_rel_2
930+
NOTICE: 1000 rows copied from test.num_range_rel_3
931+
NOTICE: 2 rows copied from test.num_range_rel_4
932+
NOTICE: 0 rows copied from test.num_range_rel_6
933933
drop_partitions
934934
-----------------
935935
5
@@ -1108,9 +1108,9 @@ EXPLAIN (COSTS OFF) SELECT * FROM test."TeSt" WHERE a = 1;
11081108

11091109
SELECT pathman.drop_partitions('test."TeSt"');
11101110
NOTICE: drop cascades to 3 other objects
1111-
NOTICE: 3 rows copied from test."TeSt_2"
1112-
NOTICE: 0 rows copied from test."TeSt_1"
11131111
NOTICE: 0 rows copied from test."TeSt_0"
1112+
NOTICE: 0 rows copied from test."TeSt_1"
1113+
NOTICE: 3 rows copied from test."TeSt_2"
11141114
drop_partitions
11151115
-----------------
11161116
3
@@ -1163,11 +1163,11 @@ SELECT pathman.split_range_partition('test."RangeRel_1"', '2015-01-01'::DATE);
11631163

11641164
SELECT pathman.drop_partitions('test."RangeRel"');
11651165
NOTICE: function test.RangeRel_upd_trig_func() does not exist, skipping
1166-
NOTICE: 1 rows copied from test."RangeRel_6"
1167-
NOTICE: 0 rows copied from test."RangeRel_4"
1168-
NOTICE: 1 rows copied from test."RangeRel_3"
1169-
NOTICE: 1 rows copied from test."RangeRel_2"
11701166
NOTICE: 0 rows copied from test."RangeRel_1"
1167+
NOTICE: 1 rows copied from test."RangeRel_2"
1168+
NOTICE: 1 rows copied from test."RangeRel_3"
1169+
NOTICE: 0 rows copied from test."RangeRel_4"
1170+
NOTICE: 1 rows copied from test."RangeRel_6"
11711171
drop_partitions
11721172
-----------------
11731173
5
@@ -1199,9 +1199,9 @@ SELECT pathman.create_range_partitions('test."RangeRel"', 'id', 1, 100, 3);
11991199

12001200
SELECT pathman.drop_partitions('test."RangeRel"');
12011201
NOTICE: function test.RangeRel_upd_trig_func() does not exist, skipping
1202-
NOTICE: 0 rows copied from test."RangeRel_3"
1203-
NOTICE: 0 rows copied from test."RangeRel_2"
12041202
NOTICE: 0 rows copied from test."RangeRel_1"
1203+
NOTICE: 0 rows copied from test."RangeRel_2"
1204+
NOTICE: 0 rows copied from test."RangeRel_3"
12051205
drop_partitions
12061206
-----------------
12071207
3
@@ -1358,20 +1358,20 @@ DELETE FROM range_rel r USING tmp t WHERE r.dt = '2010-01-02' AND r.id = t.id;
13581358
/* Create range partitions from whole range */
13591359
SELECT drop_partitions('range_rel');
13601360
NOTICE: function public.range_rel_upd_trig_func() does not exist, skipping
1361-
NOTICE: 0 rows copied from range_rel_15
1362-
NOTICE: 0 rows copied from range_rel_14
1363-
NOTICE: 14 rows copied from range_rel_13
1364-
NOTICE: 31 rows copied from range_rel_12
1365-
NOTICE: 30 rows copied from range_rel_11
1366-
NOTICE: 31 rows copied from range_rel_10
1367-
NOTICE: 30 rows copied from range_rel_9
1368-
NOTICE: 31 rows copied from range_rel_8
1369-
NOTICE: 31 rows copied from range_rel_7
1370-
NOTICE: 29 rows copied from range_rel_6
1371-
NOTICE: 31 rows copied from range_rel_5
1372-
NOTICE: 30 rows copied from range_rel_4
1373-
NOTICE: 31 rows copied from range_rel_3
13741361
NOTICE: 44 rows copied from range_rel_1
1362+
NOTICE: 31 rows copied from range_rel_3
1363+
NOTICE: 30 rows copied from range_rel_4
1364+
NOTICE: 31 rows copied from range_rel_5
1365+
NOTICE: 29 rows copied from range_rel_6
1366+
NOTICE: 31 rows copied from range_rel_7
1367+
NOTICE: 31 rows copied from range_rel_8
1368+
NOTICE: 30 rows copied from range_rel_9
1369+
NOTICE: 31 rows copied from range_rel_10
1370+
NOTICE: 30 rows copied from range_rel_11
1371+
NOTICE: 31 rows copied from range_rel_12
1372+
NOTICE: 14 rows copied from range_rel_13
1373+
NOTICE: 0 rows copied from range_rel_14
1374+
NOTICE: 0 rows copied from range_rel_15
13751375
drop_partitions
13761376
-----------------
13771377
14

contrib/pg_pathman/expected/pathman_callbacks.out

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ NOTICE: sequence "abc_seq" does not exist, skipping
1818
2
1919
(1 row)
2020

21-
SELECT set_part_init_callback('callbacks.abc',
22-
'callbacks.abc_on_part_created_callback');
23-
set_part_init_callback
24-
------------------------
21+
SELECT set_init_callback('callbacks.abc',
22+
'callbacks.abc_on_part_created_callback');
23+
set_init_callback
24+
-------------------
2525

2626
(1 row)
2727

@@ -62,10 +62,10 @@ NOTICE: 0 rows copied from callbacks.abc_6
6262
(1 row)
6363

6464
/* set callback to be called on HASH partitions */
65-
SELECT set_part_init_callback('callbacks.abc',
66-
'callbacks.abc_on_part_created_callback');
67-
set_part_init_callback
68-
------------------------
65+
SELECT set_init_callback('callbacks.abc',
66+
'callbacks.abc_on_part_created_callback');
67+
set_init_callback
68+
-------------------
6969

7070
(1 row)
7171

contrib/pg_pathman/hash.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ 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)
18+
partition_data BOOLEAN DEFAULT TRUE)
1919
RETURNS INTEGER AS
2020
$$
2121
DECLARE

contrib/pg_pathman/init.sql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ LANGUAGE plpgsql STRICT;
135135
/*
136136
* Set partition creation callback
137137
*/
138-
CREATE OR REPLACE FUNCTION @extschema@.set_part_init_callback(
138+
CREATE OR REPLACE FUNCTION @extschema@.set_init_callback(
139139
relation REGCLASS,
140-
callback REGPROC)
140+
callback REGPROC DEFAULT 0)
141141
RETURNS VOID AS
142142
$$
143143
BEGIN
@@ -535,7 +535,8 @@ BEGIN
535535

536536
FOR v_rec IN (SELECT inhrelid::REGCLASS AS tbl
537537
FROM pg_catalog.pg_inherits
538-
WHERE inhparent::regclass = parent_relid)
538+
WHERE inhparent::regclass = parent_relid
539+
ORDER BY inhrelid ASC)
539540
LOOP
540541
IF NOT delete_data THEN
541542
EXECUTE format('WITH part_data AS (DELETE FROM %s RETURNING *)

contrib/pg_pathman/sql/pathman_callbacks.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ $$ language plpgsql;
1818
CREATE TABLE callbacks.abc(a serial, b int);
1919
SELECT create_range_partitions('callbacks.abc', 'a', 1, 100, 2);
2020

21-
SELECT set_part_init_callback('callbacks.abc',
22-
'callbacks.abc_on_part_created_callback');
21+
SELECT set_init_callback('callbacks.abc',
22+
'callbacks.abc_on_part_created_callback');
2323

2424
INSERT INTO callbacks.abc VALUES (123, 1);
2525
INSERT INTO callbacks.abc VALUES (223, 1);
@@ -32,8 +32,8 @@ SELECT drop_partitions('callbacks.abc');
3232

3333

3434
/* set callback to be called on HASH partitions */
35-
SELECT set_part_init_callback('callbacks.abc',
36-
'callbacks.abc_on_part_created_callback');
35+
SELECT set_init_callback('callbacks.abc',
36+
'callbacks.abc_on_part_created_callback');
3737
SELECT create_hash_partitions('callbacks.abc', 'a', 5);
3838

3939

contrib/pg_pathman/src/init.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ init_main_pathman_toggles(void)
118118
NULL,
119119
&pg_pathman_init_state.pg_pathman_enable,
120120
true,
121-
PGC_USERSET,
121+
PGC_SUSET,
122122
0,
123123
NULL,
124124
pg_pathman_enable_assign_hook,
@@ -130,7 +130,7 @@ init_main_pathman_toggles(void)
130130
NULL,
131131
&pg_pathman_init_state.auto_partition,
132132
true,
133-
PGC_USERSET,
133+
PGC_SUSET,
134134
0,
135135
NULL,
136136
NULL,
@@ -142,7 +142,7 @@ init_main_pathman_toggles(void)
142142
NULL,
143143
&pg_pathman_init_state.override_copy,
144144
true,
145-
PGC_USERSET,
145+
PGC_SUSET,
146146
0,
147147
NULL,
148148
NULL,

contrib/pg_pathman/src/partition_filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ init_partition_filter_static_data(void)
9292
NULL,
9393
&pg_pathman_enable_partition_filter,
9494
true,
95-
PGC_USERSET,
95+
PGC_SUSET,
9696
0,
9797
NULL,
9898
NULL,

contrib/pg_pathman/src/utils.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,9 @@ validate_on_part_init_cb(Oid procid, bool emit_error)
700700
Form_pg_proc functup;
701701
bool is_ok = true;
702702

703+
if (procid == InvalidOid)
704+
return true;
705+
703706
tp = SearchSysCache1(PROCOID, ObjectIdGetDatum(procid));
704707
if (!HeapTupleIsValid(tp))
705708
elog(ERROR, "cache lookup failed for function %u", procid);

doc/src/sgml/acronyms.sgml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<title>Acronyms</title>
55

66
<para>
7-
This is a list of acronyms commonly used in the <productname>PostgreSQL</>
8-
documentation and in discussions about <productname>PostgreSQL</>.
7+
This is a list of acronyms commonly used in the <productname>&productname;</>
8+
documentation and in discussions about <productname>&productname;</>.
99

1010
<variablelist>
1111

@@ -185,7 +185,7 @@
185185
<term><acronym>ECPG</acronym></term>
186186
<listitem>
187187
<para>
188-
<link linkend="ecpg">Embedded C for PostgreSQL</link>
188+
<link linkend="ecpg">Embedded C for &productname;</link>
189189
</para>
190190
</listitem>
191191
</varlistentry>
@@ -281,7 +281,7 @@
281281
<listitem>
282282
<para>
283283
<link linkend="config-setting">Grand Unified Configuration</link>,
284-
the <productname>PostgreSQL</> subsystem that handles server configuration
284+
the <productname>&productname;</> subsystem that handles server configuration
285285
</para>
286286
</listitem>
287287
</varlistentry>
@@ -476,7 +476,7 @@
476476
<term><acronym>PGSQL</acronym></term>
477477
<listitem>
478478
<para>
479-
<link linkend="postgres"><productname>PostgreSQL</></link>
479+
<link linkend="postgres"><productname>&productname;</></link>
480480
</para>
481481
</listitem>
482482
</varlistentry>
@@ -485,7 +485,7 @@
485485
<term><acronym>PGXS</acronym></term>
486486
<listitem>
487487
<para>
488-
<link linkend="extend-pgxs"><productname>PostgreSQL</> Extension System</link>
488+
<link linkend="extend-pgxs"><productname>&productname;</> Extension System</link>
489489
</para>
490490
</listitem>
491491
</varlistentry>

doc/src/sgml/advanced.sgml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<para>
1010
In the previous chapter we have covered the basics of using
1111
<acronym>SQL</acronym> to store and access your data in
12-
<productname>PostgreSQL</productname>. We will now discuss some
12+
<productname>&productname;</productname>. We will now discuss some
1313
more advanced features of <acronym>SQL</acronym> that simplify
1414
management and prevent loss or corruption of your data. Finally,
15-
we will look at some <productname>PostgreSQL</productname>
15+
we will look at some <productname>&productname;</productname>
1616
extensions.
1717
</para>
1818

@@ -93,7 +93,7 @@ SELECT * FROM myview;
9393
exists, and then inserting or rejecting the new
9494
<classname>weather</classname> records. This approach has a
9595
number of problems and is very inconvenient, so
96-
<productname>PostgreSQL</productname> can do this for you.
96+
<productname>&productname;</productname> can do this for you.
9797
</para>
9898

9999
<para>
@@ -216,7 +216,7 @@ UPDATE branches SET balance = balance + 100.00
216216
</para>
217217

218218
<para>
219-
In <productname>PostgreSQL</>, a transaction is set up by surrounding
219+
In <productname>&productname;</>, a transaction is set up by surrounding
220220
the SQL commands of the transaction with
221221
<command>BEGIN</> and <command>COMMIT</> commands. So our banking
222222
transaction would actually look like:
@@ -238,7 +238,7 @@ COMMIT;
238238
</para>
239239

240240
<para>
241-
<productname>PostgreSQL</> actually treats every SQL statement as being
241+
<productname>&productname;</> actually treats every SQL statement as being
242242
executed within a transaction. If you do not issue a <command>BEGIN</>
243243
command,
244244
then each individual statement has an implicit <command>BEGIN</> and
@@ -628,10 +628,10 @@ CREATE TABLE capitals (
628628
<structfield>population</>, and <structfield>altitude</>) from its
629629
<firstterm>parent</firstterm>, <classname>cities</classname>. The
630630
type of the column <structfield>name</structfield> is
631-
<type>text</type>, a native <productname>PostgreSQL</productname>
631+
<type>text</type>, a native <productname>&productname;</productname>
632632
type for variable length character strings. State capitals have
633633
an extra column, <structfield>state</>, that shows their state. In
634-
<productname>PostgreSQL</productname>, a table can inherit from
634+
<productname>&productname;</productname>, a table can inherit from
635635
zero or more other tables.
636636
</para>
637637

@@ -703,15 +703,15 @@ SELECT name, altitude
703703
<title>Conclusion</title>
704704

705705
<para>
706-
<productname>PostgreSQL</productname> has many features not
706+
<productname>&productname;</productname> has many features not
707707
touched upon in this tutorial introduction, which has been
708708
oriented toward newer users of <acronym>SQL</acronym>. These
709709
features are discussed in more detail in the remainder of this
710710
book.
711711
</para>
712712

713713
<para>
714-
If you feel you need more introductory material, please visit the PostgreSQL
714+
If you feel you need more introductory material, please visit the &productname;
715715
<ulink url="http://www.postgresql.org">web site</ulink>
716716
for links to more resources.
717717
</para>

0 commit comments

Comments
 (0)