Skip to content

Commit 75532ba

Browse files
committed
Merge branch 'PGPRO9_6' into PGPRO9_6_ptrack
2 parents ce50202 + fd9fc27 commit 75532ba

23 files changed

+312
-142
lines changed

doc/src/sgml/catalogs.sgml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9819,6 +9819,13 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
98199819
</tgroup>
98209820
</table>
98219821

9822+
<para>
9823+
While most timezone abbreviations represent fixed offsets from UTC,
9824+
there are some that have historically varied in value
9825+
(see <xref linkend="datetime-config-files"> for more information).
9826+
In such cases this view presents their current meaning.
9827+
</para>
9828+
98229829
</sect1>
98239830

98249831
<sect1 id="view-pg-timezone-names">

doc/src/sgml/datetime.sgml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -384,19 +384,38 @@
384384

385385
<para>
386386
A <replaceable>zone_abbreviation</replaceable> is just the abbreviation
387-
being defined. The <replaceable>offset</replaceable> is the equivalent
388-
offset in seconds from UTC, positive being east from Greenwich and
389-
negative being west. For example, -18000 would be five hours west
390-
of Greenwich, or North American east coast standard time. <literal>D</>
391-
indicates that the zone name represents local daylight-savings time rather
392-
than standard time. Alternatively, a <replaceable>time_zone_name</> can
393-
be given, in which case that time zone definition is consulted, and the
394-
abbreviation's meaning in that zone is used. This alternative is
395-
recommended only for abbreviations whose meaning has historically varied,
396-
as looking up the meaning is noticeably more expensive than just using
397-
a fixed integer value.
387+
being defined. An <replaceable>offset</replaceable> is an integer giving
388+
the equivalent offset in seconds from UTC, positive being east from
389+
Greenwich and negative being west. For example, -18000 would be five
390+
hours west of Greenwich, or North American east coast standard time.
391+
<literal>D</> indicates that the zone name represents local
392+
daylight-savings time rather than standard time.
398393
</para>
399394

395+
<para>
396+
Alternatively, a <replaceable>time_zone_name</> can be given, referencing
397+
a zone name defined in the IANA timezone database. The zone's definition
398+
is consulted to see whether the abbreviation is or has been in use in
399+
that zone, and if so, the appropriate meaning is used &mdash; that is,
400+
the meaning that was currently in use at the timestamp whose value is
401+
being determined, or the meaning in use immediately before that if it
402+
wasn't current at that time, or the oldest meaning if it was used only
403+
after that time. This behavior is essential for dealing with
404+
abbreviations whose meaning has historically varied. It is also allowed
405+
to define an abbreviation in terms of a zone name in which that
406+
abbreviation does not appear; then using the abbreviation is just
407+
equivalent to writing out the zone name.
408+
</para>
409+
410+
<tip>
411+
<para>
412+
Using a simple integer <replaceable>offset</replaceable> is preferred
413+
when defining an abbreviation whose offset from UTC has never changed,
414+
as such abbreviations are much cheaper to process than those that
415+
require consulting a time zone definition.
416+
</para>
417+
</tip>
418+
400419
<para>
401420
The <literal>@INCLUDE</> syntax allows inclusion of another file in the
402421
<filename>.../share/timezonesets/</> directory. Inclusion can be nested,

doc/src/sgml/logicaldecoding.sgml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
<para>
1414
Changes are sent out in streams identified by logical replication slots.
15-
Each stream outputs each change exactly once.
1615
</para>
1716

1817
<para>
@@ -204,8 +203,7 @@ $ pg_recvlogical -d postgres --slot test --drop-slot
204203
In the context of logical replication, a slot represents a stream of
205204
changes that can be replayed to a client in the order they were made on
206205
the origin server. Each slot streams a sequence of changes from a single
207-
database, sending each change exactly once (except when peeking forward
208-
in the stream).
206+
database.
209207
</para>
210208

211209
<note>
@@ -221,6 +219,20 @@ $ pg_recvlogical -d postgres --slot test --drop-slot
221219
independently of the connection using them and are crash-safe.
222220
</para>
223221

222+
<para>
223+
A logical slot will emit each change just once in normal operation.
224+
The current position of each slot is persisted only at checkpoint, so in
225+
the case of a crash the slot may return to an earlier LSN, which will
226+
then cause recent changes to be resent when the server restarts.
227+
Logical decoding clients are responsible for avoiding ill effects from
228+
handling the same message more than once. Clients may wish to record
229+
the last LSN they saw when decoding and skip over any repeated data or
230+
(when using the replication protocol) request that decoding start from
231+
that LSN rather than letting the server determine the start point.
232+
The Replication Progress Tracking feature is designed for this purpose,
233+
refer to <link linkend="replication-origins">replication origins</link>.
234+
</para>
235+
224236
<para>
225237
Multiple independent slots may exist for a single database. Each slot has
226238
its own state, allowing different consumers to receive changes from

doc/src/sgml/release-9.6.sgml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,26 @@ This commit is also listed under libpq and psql
303303
</para>
304304
</listitem>
305305

306+
<listitem>
307+
<!--
308+
2016-06-07 [a89b4b1be] Update citext extension for parallel query.
309+
and many others in the same vein
310+
-->
311+
<para>
312+
Update extension functions to be marked parallel-safe where
313+
appropriate (Andreas Karlsson)
314+
</para>
315+
316+
<para>
317+
Many of the standard extensions have been updated to allow their
318+
functions to be executed within parallel query worker processes.
319+
These changes will not take effect in
320+
databases <application>pg_upgrade</>'d from prior versions unless
321+
you apply <command>ALTER EXTENSION UPDATE</> to each such extension
322+
(in each database of a cluster).
323+
</para>
324+
</listitem>
325+
306326
</itemizedlist>
307327

308328
</sect2>

src/backend/access/gin/gindatapage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ typedef struct
8686
char action;
8787

8888
ItemPointerData *modifieditems;
89-
int nmodifieditems;
89+
uint16 nmodifieditems;
9090

9191
/*
9292
* The following fields represent the items in this segment. If 'items' is

src/backend/utils/adt/datetime.c

Lines changed: 64 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ static void AdjustFractDays(double frac, struct pg_tm * tm, fsec_t *fsec,
5656
int scale);
5757
static int DetermineTimeZoneOffsetInternal(struct pg_tm * tm, pg_tz *tzp,
5858
pg_time_t *tp);
59-
static int DetermineTimeZoneAbbrevOffsetInternal(pg_time_t t, const char *abbr,
60-
pg_tz *tzp, int *isdst);
59+
static bool DetermineTimeZoneAbbrevOffsetInternal(pg_time_t t,
60+
const char *abbr, pg_tz *tzp,
61+
int *offset, int *isdst);
6162
static pg_tz *FetchDynamicTimeZone(TimeZoneAbbrevTable *tbl, const datetkn *tp);
6263

6364

@@ -1689,19 +1690,40 @@ DetermineTimeZoneOffsetInternal(struct pg_tm * tm, pg_tz *tzp, pg_time_t *tp)
16891690
* This differs from the behavior of DetermineTimeZoneOffset() in that a
16901691
* standard-time or daylight-time abbreviation forces use of the corresponding
16911692
* GMT offset even when the zone was then in DS or standard time respectively.
1693+
* (However, that happens only if we can match the given abbreviation to some
1694+
* abbreviation that appears in the IANA timezone data. Otherwise, we fall
1695+
* back to doing DetermineTimeZoneOffset().)
16921696
*/
16931697
int
16941698
DetermineTimeZoneAbbrevOffset(struct pg_tm * tm, const char *abbr, pg_tz *tzp)
16951699
{
16961700
pg_time_t t;
1701+
int zone_offset;
1702+
int abbr_offset;
1703+
int abbr_isdst;
16971704

16981705
/*
16991706
* Compute the UTC time we want to probe at. (In event of overflow, we'll
17001707
* probe at the epoch, which is a bit random but probably doesn't matter.)
17011708
*/
1702-
(void) DetermineTimeZoneOffsetInternal(tm, tzp, &t);
1709+
zone_offset = DetermineTimeZoneOffsetInternal(tm, tzp, &t);
17031710

1704-
return DetermineTimeZoneAbbrevOffsetInternal(t, abbr, tzp, &tm->tm_isdst);
1711+
/*
1712+
* Try to match the abbreviation to something in the zone definition.
1713+
*/
1714+
if (DetermineTimeZoneAbbrevOffsetInternal(t, abbr, tzp,
1715+
&abbr_offset, &abbr_isdst))
1716+
{
1717+
/* Success, so use the abbrev-specific answers. */
1718+
tm->tm_isdst = abbr_isdst;
1719+
return abbr_offset;
1720+
}
1721+
1722+
/*
1723+
* No match, so use the answers we already got from
1724+
* DetermineTimeZoneOffsetInternal.
1725+
*/
1726+
return zone_offset;
17051727
}
17061728

17071729

@@ -1715,19 +1737,41 @@ DetermineTimeZoneAbbrevOffsetTS(TimestampTz ts, const char *abbr,
17151737
pg_tz *tzp, int *isdst)
17161738
{
17171739
pg_time_t t = timestamptz_to_time_t(ts);
1740+
int zone_offset;
1741+
int abbr_offset;
1742+
int tz;
1743+
struct pg_tm tm;
1744+
fsec_t fsec;
17181745

1719-
return DetermineTimeZoneAbbrevOffsetInternal(t, abbr, tzp, isdst);
1746+
/*
1747+
* If the abbrev matches anything in the zone data, this is pretty easy.
1748+
*/
1749+
if (DetermineTimeZoneAbbrevOffsetInternal(t, abbr, tzp,
1750+
&abbr_offset, isdst))
1751+
return abbr_offset;
1752+
1753+
/*
1754+
* Else, break down the timestamp so we can use DetermineTimeZoneOffset.
1755+
*/
1756+
if (timestamp2tm(ts, &tz, &tm, &fsec, NULL, tzp) != 0)
1757+
ereport(ERROR,
1758+
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
1759+
errmsg("timestamp out of range")));
1760+
1761+
zone_offset = DetermineTimeZoneOffset(&tm, tzp);
1762+
*isdst = tm.tm_isdst;
1763+
return zone_offset;
17201764
}
17211765

17221766

17231767
/* DetermineTimeZoneAbbrevOffsetInternal()
17241768
*
17251769
* Workhorse for above two functions: work from a pg_time_t probe instant.
1726-
* DST status is returned into *isdst.
1770+
* On success, return GMT offset and DST status into *offset and *isdst.
17271771
*/
1728-
static int
1729-
DetermineTimeZoneAbbrevOffsetInternal(pg_time_t t, const char *abbr,
1730-
pg_tz *tzp, int *isdst)
1772+
static bool
1773+
DetermineTimeZoneAbbrevOffsetInternal(pg_time_t t, const char *abbr, pg_tz *tzp,
1774+
int *offset, int *isdst)
17311775
{
17321776
char upabbr[TZ_STRLEN_MAX + 1];
17331777
unsigned char *p;
@@ -1739,18 +1783,17 @@ DetermineTimeZoneAbbrevOffsetInternal(pg_time_t t, const char *abbr,
17391783
*p = pg_toupper(*p);
17401784

17411785
/* Look up the abbrev's meaning at this time in this zone */
1742-
if (!pg_interpret_timezone_abbrev(upabbr,
1743-
&t,
1744-
&gmtoff,
1745-
isdst,
1746-
tzp))
1747-
ereport(ERROR,
1748-
(errcode(ERRCODE_CONFIG_FILE_ERROR),
1749-
errmsg("time zone abbreviation \"%s\" is not used in time zone \"%s\"",
1750-
abbr, pg_get_timezone_name(tzp))));
1751-
1752-
/* Change sign to agree with DetermineTimeZoneOffset() */
1753-
return (int) -gmtoff;
1786+
if (pg_interpret_timezone_abbrev(upabbr,
1787+
&t,
1788+
&gmtoff,
1789+
isdst,
1790+
tzp))
1791+
{
1792+
/* Change sign to agree with DetermineTimeZoneOffset() */
1793+
*offset = (int) -gmtoff;
1794+
return true;
1795+
}
1796+
return false;
17541797
}
17551798

17561799

src/backend/utils/adt/pg_locale.c

100644100755
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,11 @@ pg_newlocale_from_collation(Oid collid)
11831183
result = newlocale(LC_COLLATE_MASK | LC_CTYPE_MASK, collcollate,
11841184
NULL);
11851185
#else
1186+
#ifdef USE_ICU
1187+
if (strcmp(collcollate,"POSIX")==0)
1188+
result = _create_locale(LC_ALL,"C");
1189+
else
1190+
#endif
11861191
result = _create_locale(LC_ALL, collcollate);
11871192
#endif
11881193
if (!result)

src/include/pg_config.h.win32

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@
548548
#define MEMSET_LOOP_LIMIT 1024
549549

550550
/* Define to the address where bug reports for this package should be sent. */
551-
#define PACKAGE_BUGREPORT "pgsql-bugs@postgresql.org"
551+
#define PACKAGE_BUGREPORT "bugs@postgrespro.ru"
552552

553553
/* Define to the full name of this package. */
554554
#define PACKAGE_NAME "PostgreSQL"
@@ -570,6 +570,11 @@
570570

571571
/* PostgreSQL version as a number */
572572
#define PG_VERSION_NUM 90600
573+
#define PGPRO_PACKAGE_NAME "PostgresPro"
574+
575+
#define PGPRO_PACKAGE_VERSION "9.6rc1.1"
576+
577+
#define PGPRO_PACKAGE_STR "PostgresPro 9.6rc1.1"
573578

574579
/* Define to the one symbol short name of this package. */
575580
#define PACKAGE_TARNAME "postgresql"
@@ -581,6 +586,9 @@
581586
/* A string containing the version number, platform, and C compiler */
582587
#define PG_VERSION_STR "Uninitialized version string (win32)"
583588

589+
/* A string containing the PostgresPro version number, platform, and C compiler */
590+
#define PGPRO_VERSION_STR "Uninitialized version string (win32)"
591+
584592
/* The size of `long', as computed by sizeof. */
585593
#define SIZEOF_LONG 4
586594

0 commit comments

Comments
 (0)