Skip to content

Commit 6bb45be

Browse files
committed
Merge branch 'PGPRO9_6' of gitlab.postgrespro.ru:pgpro-dev/postgrespro into PGPRO9_6
2 parents 84fa653 + 1b38c23 commit 6bb45be

File tree

23 files changed

+7376
-4819
lines changed

23 files changed

+7376
-4819
lines changed

configure

Lines changed: 2028 additions & 158 deletions
Large diffs are not rendered by default.

configure.in

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dnl Read the Autoconf manual for details.
1717
dnl
1818
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
1919

20-
AC_INIT([PostgreSQL], [9.6.beta.4], [pgsql-bugs@postgresql.org])
20+
AC_INIT([PostgreSQL], [9.6rc1], [pgsql-bugs@postgresql.org])
2121

2222
m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
2323
Untested combinations of 'autoconf' and PostgreSQL versions are not
@@ -735,6 +735,16 @@ PGAC_ARG_BOOL(with, systemd, no, [build with systemd support],
735735
AC_SUBST(with_systemd)
736736
AC_MSG_RESULT([$with_systemd])
737737

738+
#
739+
# ICU
740+
#
741+
AC_MSG_CHECKING([whether to build with ICU support])
742+
PGAC_ARG_BOOL(with, icu, no, [ --with-icu build with ICU support],
743+
[AC_DEFINE([USE_ICU], 1, [Define to build with ICU support. (--with-icu)])])
744+
AC_MSG_RESULT([$with_icu])
745+
AC_SUBST(with_icu)
746+
747+
738748
#
739749
# Readline
740750
#
@@ -1126,6 +1136,75 @@ if test "$with_openssl" = yes ; then
11261136
AC_CHECK_FUNCS([SSL_get_current_compression])
11271137
fi
11281138

1139+
if test "$with_icu" = yes ; then
1140+
AC_SEARCH_LIBS(ucol_open_57, [icui18n icuin], [], [
1141+
AC_SEARCH_LIBS(ucol_open_56, [icui18n icuin], [], [
1142+
AC_SEARCH_LIBS(ucol_open_55, [icui18n icuin], [], [
1143+
AC_SEARCH_LIBS(ucol_open_54, [icui18n icuin], [], [
1144+
AC_SEARCH_LIBS(ucol_open_53, [icui18n icuin], [], [
1145+
AC_SEARCH_LIBS(ucol_open_52, [icui18n icuin], [], [
1146+
AC_SEARCH_LIBS(ucol_open_50, [icui18n icuin], [], [
1147+
AC_SEARCH_LIBS(ucol_open_48, [icui18n icuin], [], [
1148+
AC_SEARCH_LIBS(ucol_open_46, [icui18n icuin], [], [
1149+
AC_SEARCH_LIBS(ucol_open_44, [icui18n icuin], [], [
1150+
AC_SEARCH_LIBS(ucol_open_43, [icui18n icuin], [], [
1151+
AC_SEARCH_LIBS(ucol_open_4_2, [icui18n icuin], [], [
1152+
AC_SEARCH_LIBS(ucol_open_4_1, [icui18n icuin], [], [
1153+
AC_SEARCH_LIBS(ucol_open_4_0, [icui18n icuin], [], [
1154+
AC_SEARCH_LIBS(ucol_open_3_8, [icui18n icuin], [], [
1155+
AC_SEARCH_LIBS(ucol_open_3_6, [icui18n icuin], [], [
1156+
AC_SEARCH_LIBS(ucol_open_3_4, [icui18n icuin], [], [AC_MSG_ERROR([library 'icui18n' is required for ICU])])
1157+
])
1158+
])
1159+
])
1160+
])
1161+
])
1162+
])
1163+
])
1164+
])
1165+
])
1166+
])
1167+
])
1168+
])
1169+
])
1170+
])
1171+
])
1172+
])
1173+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_57, [], [
1174+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_56, [], [
1175+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_55, [], [
1176+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_54, [], [
1177+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_53, [], [
1178+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_52, [], [
1179+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_50, [], [
1180+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_48, [], [
1181+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_46, [], [
1182+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_44, [], [
1183+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_43, [], [
1184+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_4_2, [], [
1185+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_4_1, [], [
1186+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_4_0, [], [
1187+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_3_8, [], [
1188+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_3_6, [], [
1189+
AC_CHECK_LIB(icuuc, ucnv_fromUChars_3_4, [], [AC_MSG_ERROR([library 'icuuc' is required for ICU])])
1190+
])
1191+
])
1192+
])
1193+
])
1194+
])
1195+
])
1196+
])
1197+
])
1198+
])
1199+
])
1200+
])
1201+
])
1202+
])
1203+
])
1204+
])
1205+
])
1206+
fi
1207+
11291208
if test "$with_pam" = yes ; then
11301209
AC_CHECK_LIB(pam, pam_start, [], [AC_MSG_ERROR([library 'pam' is required for PAM])])
11311210
fi
@@ -1279,6 +1358,10 @@ if test "$with_openssl" = yes ; then
12791358
AC_CHECK_HEADER(openssl/err.h, [], [AC_MSG_ERROR([header file <openssl/err.h> is required for OpenSSL])])
12801359
fi
12811360

1361+
if test "$with_icu" = yes ; then
1362+
AC_CHECK_HEADER(unicode/utypes.h, [], [AC_MSG_ERROR([header file <unicode/utypes.h> is required for ICU])])
1363+
fi
1364+
12821365
if test "$with_pam" = yes ; then
12831366
AC_CHECK_HEADERS(security/pam_appl.h, [],
12841367
[AC_CHECK_HEADERS(pam/pam_appl.h, [],

doc/bug.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ System Configuration:
2727

2828
Operating System (example: Linux 2.4.18) :
2929

30-
PostgreSQL version (example: PostgreSQL 9.6beta4): PostgreSQL 9.6beta4
30+
PostgreSQL version (example: PostgreSQL 9.6rc1): PostgreSQL 9.6rc1
3131

3232
Compiler used (example: gcc 3.3.5) :
3333

doc/src/sgml/spgist.sgml

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
</row>
115115
<row>
116116
<entry><literal>box_ops</></entry>
117-
<entry>box</entry>
117+
<entry><type>box</></entry>
118118
<entry>
119119
<literal>&lt;&lt;</>
120120
<literal>&amp;&lt;</>
@@ -183,11 +183,14 @@
183183
Inner tuples are more complex, since they are branching points in the
184184
search tree. Each inner tuple contains a set of one or more
185185
<firstterm>nodes</>, which represent groups of similar leaf values.
186-
A node contains a downlink that leads to either another, lower-level inner
187-
tuple, or a short list of leaf tuples that all lie on the same index page.
188-
Each node has a <firstterm>label</> that describes it; for example,
186+
A node contains a downlink that leads either to another, lower-level inner
187+
tuple, or to a short list of leaf tuples that all lie on the same index page.
188+
Each node normally has a <firstterm>label</> that describes it; for example,
189189
in a radix tree the node label could be the next character of the string
190-
value. Optionally, an inner tuple can have a <firstterm>prefix</> value
190+
value. (Alternatively, an operator class can omit the node labels, if it
191+
works with a fixed set of nodes for all inner tuples;
192+
see <xref linkend="spgist-null-labels">.)
193+
Optionally, an inner tuple can have a <firstterm>prefix</> value
191194
that describes all its members. In a radix tree this could be the common
192195
prefix of the represented strings. The prefix value is not necessarily
193196
really a prefix, but can be any data needed by the operator class;
@@ -202,7 +205,8 @@
202205
tuple, so the <acronym>SP-GiST</acronym> core provides the possibility for
203206
operator classes to manage level counting while descending the tree.
204207
There is also support for incrementally reconstructing the represented
205-
value when that is needed.
208+
value when that is needed, and for passing down additional data (called
209+
<firstterm>traverse values</>) during a tree descent.
206210
</para>
207211

208212
<note>
@@ -492,9 +496,8 @@ typedef struct spgPickSplitOut
492496
<structfield>prefixDatum</> to the prefix value.
493497
Set <structfield>nNodes</> to indicate the number of nodes that
494498
the new inner tuple will contain, and
495-
set <structfield>nodeLabels</> to an array of their label values.
496-
(If the nodes do not require labels, set <structfield>nodeLabels</>
497-
to NULL; see <xref linkend="spgist-null-labels"> for details.)
499+
set <structfield>nodeLabels</> to an array of their label values,
500+
or to NULL if node labels are not required.
498501
Set <structfield>mapTuplesToNodes</> to an array that gives the index
499502
(from zero) of the node that each leaf tuple should be assigned to.
500503
Set <structfield>leafTupleDatums</> to an array of the values to
@@ -561,7 +564,7 @@ typedef struct spgInnerConsistentIn
561564

562565
Datum reconstructedValue; /* value reconstructed at parent */
563566
void *traversalValue; /* opclass-specific traverse value */
564-
MemoryContext traversalMemoryContext;
567+
MemoryContext traversalMemoryContext; /* put new traverse values here */
565568
int level; /* current level (counting from zero) */
566569
bool returnData; /* original data must be returned? */
567570

@@ -580,7 +583,6 @@ typedef struct spgInnerConsistentOut
580583
int *levelAdds; /* increment level by this much for each */
581584
Datum *reconstructedValues; /* associated reconstructed values */
582585
void **traversalValues; /* opclass-specific traverse values */
583-
584586
} spgInnerConsistentOut;
585587
</programlisting>
586588

@@ -599,6 +601,11 @@ typedef struct spgInnerConsistentOut
599601
parent tuple; it is <literal>(Datum) 0</> at the root level or if the
600602
<function>inner_consistent</> function did not provide a value at the
601603
parent level.
604+
<structfield>traversalValue</> is a pointer to any traverse data
605+
passed down from the previous call of <function>inner_consistent</>
606+
on the parent index tuple, or NULL at the root level.
607+
<structfield>traversalMemoryContext</> is the memory context in which
608+
to store output traverse values (see below).
602609
<structfield>level</> is the current inner tuple's level, starting at
603610
zero for the root level.
604611
<structfield>returnData</> is <literal>true</> if reconstructed data is
@@ -615,9 +622,6 @@ typedef struct spgInnerConsistentOut
615622
inner tuple, and
616623
<structfield>nodeLabels</> is an array of their label values, or
617624
NULL if the nodes do not have labels.
618-
<structfield>traversalValue</> is a pointer to data that
619-
<function>inner_consistent</> gets when called on child nodes from an
620-
outer call of <function>inner_consistent</> on parent nodes.
621625
</para>
622626

623627
<para>
@@ -633,17 +637,20 @@ typedef struct spgInnerConsistentOut
633637
<structfield>reconstructedValues</> to an array of the values
634638
reconstructed for each child node to be visited; otherwise, leave
635639
<structfield>reconstructedValues</> as NULL.
640+
If it is desired to pass down additional out-of-band information
641+
(<quote>traverse values</>) to lower levels of the tree search,
642+
set <structfield>traversalValues</> to an array of the appropriate
643+
traverse values, one for each child node to be visited; otherwise,
644+
leave <structfield>traversalValues</> as NULL.
636645
Note that the <function>inner_consistent</> function is
637646
responsible for palloc'ing the
638-
<structfield>nodeNumbers</>, <structfield>levelAdds</> and
639-
<structfield>reconstructedValues</> arrays.
640-
Sometimes accumulating some information is needed, while
641-
descending from parent to child node was happened. In this case
642-
<structfield>traversalValues</> array keeps pointers to
643-
specific data you need to accumulate for every child node.
644-
Memory for <structfield>traversalValues</> should be allocated in
645-
the default context, but each element of it should be allocated in
646-
<structfield>traversalMemoryContext</>.
647+
<structfield>nodeNumbers</>, <structfield>levelAdds</>,
648+
<structfield>reconstructedValues</>, and
649+
<structfield>traversalValues</> arrays in the current memory context.
650+
However, any output traverse values pointed to by
651+
the <structfield>traversalValues</> array should be allocated
652+
in <structfield>traversalMemoryContext</>.
653+
Each traverse value must be a single palloc'd chunk.
647654
</para>
648655
</listitem>
649656
</varlistentry>
@@ -700,6 +707,9 @@ typedef struct spgLeafConsistentOut
700707
parent tuple; it is <literal>(Datum) 0</> at the root level or if the
701708
<function>inner_consistent</> function did not provide a value at the
702709
parent level.
710+
<structfield>traversalValue</> is a pointer to any traverse data
711+
passed down from the previous call of <function>inner_consistent</>
712+
on the parent index tuple, or NULL at the root level.
703713
<structfield>level</> is the current leaf tuple's level, starting at
704714
zero for the root level.
705715
<structfield>returnData</> is <literal>true</> if reconstructed data is
@@ -859,11 +869,10 @@ typedef struct spgLeafConsistentOut
859869

860870
<para>
861871
The <productname>PostgreSQL</productname> source distribution includes
862-
several examples of index operator classes for
863-
<acronym>SP-GiST</acronym>. The core system currently provides radix
864-
trees over text columns and two types of trees over points: quad-tree and
865-
k-d tree. Look into <filename>src/backend/access/spgist/</> to see the
866-
code.
872+
several examples of index operator classes for <acronym>SP-GiST</acronym>,
873+
as described in <xref linkend="spgist-builtin-opclasses-table">. Look
874+
into <filename>src/backend/access/spgist/</>
875+
and <filename>src/backend/utils/adt/</> to see the code.
867876
</para>
868877

869878
</sect1>

src/backend/access/transam/xlog.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5022,7 +5022,8 @@ readRecoveryCommandFile(void)
50225022
rtli = (TimeLineID) strtoul(item->value, NULL, 0);
50235023
if (errno == EINVAL || errno == ERANGE)
50245024
ereport(FATAL,
5025-
(errmsg("recovery_target_timeline is not a valid number: \"%s\"",
5025+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
5026+
errmsg("recovery_target_timeline is not a valid number: \"%s\"",
50265027
item->value)));
50275028
}
50285029
if (rtli)
@@ -5038,7 +5039,8 @@ readRecoveryCommandFile(void)
50385039
recoveryTargetXid = (TransactionId) strtoul(item->value, NULL, 0);
50395040
if (errno == EINVAL || errno == ERANGE)
50405041
ereport(FATAL,
5041-
(errmsg("recovery_target_xid is not a valid number: \"%s\"",
5042+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
5043+
errmsg("recovery_target_xid is not a valid number: \"%s\"",
50425044
item->value)));
50435045
ereport(DEBUG2,
50445046
(errmsg_internal("recovery_target_xid = %u",
@@ -5153,7 +5155,8 @@ readRecoveryCommandFile(void)
51535155
}
51545156
else
51555157
ereport(FATAL,
5156-
(errmsg("unrecognized recovery parameter \"%s\"",
5158+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
5159+
errmsg("unrecognized recovery parameter \"%s\"",
51575160
item->name)));
51585161
}
51595162

@@ -5172,7 +5175,8 @@ readRecoveryCommandFile(void)
51725175
{
51735176
if (recoveryRestoreCommand == NULL)
51745177
ereport(FATAL,
5175-
(errmsg("recovery command file \"%s\" must specify restore_command when standby mode is not enabled",
5178+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
5179+
errmsg("recovery command file \"%s\" must specify restore_command when standby mode is not enabled",
51765180
RECOVERY_COMMAND_FILE)));
51775181
}
51785182

@@ -5186,6 +5190,15 @@ readRecoveryCommandFile(void)
51865190
!EnableHotStandby)
51875191
recoveryTargetAction = RECOVERY_TARGET_ACTION_SHUTDOWN;
51885192

5193+
/*
5194+
* We don't support standby_mode in standalone backends; that requires
5195+
* other processes such as the WAL receiver to be alive.
5196+
*/
5197+
if (StandbyModeRequested && !IsUnderPostmaster)
5198+
ereport(FATAL,
5199+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
5200+
errmsg("standby mode is not supported by single-user servers")));
5201+
51895202
/* Enable fetching from archive recovery area */
51905203
ArchiveRecoveryRequested = true;
51915204

@@ -5202,7 +5215,8 @@ readRecoveryCommandFile(void)
52025215
/* Timeline 1 does not have a history file, all else should */
52035216
if (rtli != 1 && !existsTimeLineHistory(rtli))
52045217
ereport(FATAL,
5205-
(errmsg("recovery target timeline %u does not exist",
5218+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
5219+
errmsg("recovery target timeline %u does not exist",
52065220
rtli)));
52075221
recoveryTargetTLI = rtli;
52085222
recoveryTargetIsLatest = false;

0 commit comments

Comments
 (0)