Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ad6ae52
Move code to get_tables_to_repack_partitioned
alvherre Jul 20, 2026
c94409e
Fix LSN format in REPACK worker debug message
alvherre Jul 20, 2026
1009339
Allow PostgreSQL::Test::Cluster::start() to pass postmaster options
MasaoFujii Jul 20, 2026
d5751c3
Avoid ERROR in recovery target GUC assign hooks
MasaoFujii Jul 20, 2026
d049a31
Fix restore of partitions with exclusion constraints
alvherre Jul 20, 2026
17e805e
doc: Granting TRIGGER or REFERENCES on table is dangerous.
robertmhaas Jul 20, 2026
83486b6
Fix recovery target test waiting on unavailable WAL
MasaoFujii Jul 20, 2026
99e949f
Add logical decoding status to pg_control_checkpoint().
MasahikoSawada Jul 21, 2026
d774576
Allow logical replication workers to ignore default_transaction_read_…
Jul 21, 2026
9170c8b
Test what BEFORE UPDATE triggers do to FOR PORTION OF
petere Jul 21, 2026
fc6425f
Improve generate_partition_qual()'s cache handling on out-of-memory e…
michaelpq Jul 21, 2026
c90c967
Message style fixes
petere Jul 21, 2026
078aac2
pg_upgrade: Message wording fix
petere Jul 21, 2026
02597b4
Unify error messages
alvherre Jul 21, 2026
cb2053d
Remove assertion added by commit 7dcea51c2a4d
alvherre Jul 21, 2026
96104d6
Fix typo
petere Jul 21, 2026
85df8c5
doc: clarify to_char("OF") HH/MM doesn't represent actual chars
bmomjian Jul 21, 2026
78758d3
doc: clarify how TIMESTAMP WITH TIME ZONE behaves
bmomjian Jul 21, 2026
e65c331
Add new pgstats routine to split pending data setup
michaelpq Jul 21, 2026
ccfd4b6
Improve lookup_type_cache() handling on out-of-memory errors
michaelpq Jul 22, 2026
8767a10
walsummarizer: Guard against WAL files whose tail ends are not valid.
robertmhaas Jul 22, 2026
1a8c172
Reject sequence synchronization against pre-PostgreSQL 19 publishers.
Jul 23, 2026
a49b6a6
injection_points: Clear waiter slot on error and exit
michaelpq Jul 23, 2026
abbd74c
doc: Improve description of pg_stat_activity.backend_type
michaelpq Jul 23, 2026
544d25b
Fix socket_putmessage_noblock() to call socket_putmessage()
michaelpq Jul 23, 2026
937db82
doc: Improve pg_stat_recovery documentation
MasaoFujii Jul 23, 2026
1c9c358
Validate subscription conninfo on owner change
MasaoFujii Jul 23, 2026
c5f1f41
Fix EXCEPT publication test to check subscriber
MasaoFujii Jul 24, 2026
b77868f
doc: Add missing CREATE/ALTER PUBLICATION parameter descriptions
MasaoFujii Jul 24, 2026
13b7a8a
Avoid reporting permission-denied publisher sequences as missing
MasaoFujii Jul 25, 2026
38afc3d
psql: Allow pg_read_all_stats to see database size in \l+
MasaoFujii Jul 25, 2026
ce3f19e
Fix another empty nbtree index SSI race.
petergeoghegan Jul 25, 2026
5168655
Add missing PGDLLIMPORT marker
alvherre Jul 25, 2026
62c05d6
Add tests for nbtree empty index predicate locking.
petergeoghegan Jul 25, 2026
e395fbd
Add test coverage for nbtree backwards scans.
petergeoghegan Jul 25, 2026
e01accd
Add _bt_set_startikey row compare test coverage.
petergeoghegan Jul 26, 2026
0962f9e
Use direct hash lookup in logicalrep_partmap_invalidate_cb()
michaelpq Jul 27, 2026
87f08db
Update .gitignore in test/modules/nbtree
michaelpq Jul 27, 2026
f4c850d
Fix deparsing of JSON_ARRAY(subquery) with a FORMAT clause
Jul 27, 2026
b8d9cf5
Fix issues in logical replication sequence synchronization.
Jul 27, 2026
4b1167e
Add archive_mode=shared for coordinated WAL archiving
x4m Feb 10, 2026
d18ff47
Add `primary_last_archived` column to pg_stat_wal_receiver view.
Jul 20, 2026
492994b
Guard against configuration hazards in archive_mode=shared setups.
Jul 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/dblink/dblink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2714,7 +2714,7 @@ dblink_security_check(PGconn *conn, const char *connname, const char *connstr)
ereport(ERROR,
(errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED),
errmsg("password or GSSAPI delegated credentials required"),
errdetail("Non-superusers may only connect using credentials they provide, eg: password in connection string or delegated GSSAPI credentials"),
errdetail("Non-superusers may only connect using credentials they provide, eg: password in connection string or delegated GSSAPI credentials."),
errhint("Ensure provided credentials match target server's authentication method.")));
}

Expand Down
2 changes: 1 addition & 1 deletion contrib/passwordcheck/expected/passwordcheck.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ALTER USER regress_passwordcheck_user1 PASSWORD 'a_nice_long_password';
-- error: too short
ALTER USER regress_passwordcheck_user1 PASSWORD 'tooshrt';
ERROR: password is too short
DETAIL: password must be at least "passwordcheck.min_password_length" (8) bytes long
DETAIL: Password must be at least "passwordcheck.min_password_length" (8) bytes long.
-- ok
SET passwordcheck.min_password_length = 6;
ALTER USER regress_passwordcheck_user1 PASSWORD 'v_shrt';
Expand Down
2 changes: 1 addition & 1 deletion contrib/passwordcheck/expected/passwordcheck_1.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ALTER USER regress_passwordcheck_user1 PASSWORD 'a_nice_long_password';
-- error: too short
ALTER USER regress_passwordcheck_user1 PASSWORD 'tooshrt';
ERROR: password is too short
DETAIL: password must be at least "passwordcheck.min_password_length" (8) bytes long
DETAIL: Password must be at least "passwordcheck.min_password_length" (8) bytes long.
-- ok
SET passwordcheck.min_password_length = 6;
ALTER USER regress_passwordcheck_user1 PASSWORD 'v_shrt';
Expand Down
2 changes: 1 addition & 1 deletion contrib/passwordcheck/passwordcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ check_password(const char *username,
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("password is too short"),
errdetail("password must be at least \"passwordcheck.min_password_length\" (%d) bytes long",
errdetail("Password must be at least \"passwordcheck.min_password_length\" (%d) bytes long.",
min_password_length)));

/* check if the password contains the username */
Expand Down
2 changes: 1 addition & 1 deletion contrib/pg_stash_advice/expected/pg_stash_advice.out
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ SELECT pg_create_advice_stash(' ');
ERROR: advice stash name must begin with a letter or underscore and contain only letters, digits, and underscores
SET pg_stash_advice.stash_name = '99bottles';
ERROR: invalid value for parameter "pg_stash_advice.stash_name": "99bottles"
DETAIL: advice stash name must begin with a letter or underscore and contain only letters, digits, and underscores
DETAIL: Advice stash name must begin with a letter or underscore and contain only letters, digits, and underscores.
-- Clean up state in dynamic shared memory.
SELECT pg_drop_advice_stash('regress_stash');
pg_drop_advice_stash
Expand Down
2 changes: 1 addition & 1 deletion contrib/pg_stash_advice/expected/pg_stash_advice_utf8.out
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ SELECT pg_create_advice_stash('café');
ERROR: advice stash name must not contain non-ASCII characters
SET pg_stash_advice.stash_name = 'café';
ERROR: invalid value for parameter "pg_stash_advice.stash_name": "café"
DETAIL: advice stash name must not contain non-ASCII characters
DETAIL: Advice stash name must not contain non-ASCII characters.
8 changes: 4 additions & 4 deletions contrib/pg_stash_advice/pg_stash_advice.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ pgsa_check_stash_name_guc(char **newval, void **extra, GucSource source)
if (strlen(stash_name) + 1 > NAMEDATALEN)
{
GUC_check_errcode(ERRCODE_INVALID_PARAMETER_VALUE);
GUC_check_errdetail("advice stash names may not be longer than %d bytes",
GUC_check_errdetail("Advice stash names may not be longer than %d bytes.",
NAMEDATALEN - 1);
return false;
}
Expand All @@ -400,7 +400,7 @@ pgsa_check_stash_name_guc(char **newval, void **extra, GucSource source)
if (!pg_is_ascii(stash_name))
{
GUC_check_errcode(ERRCODE_INVALID_PARAMETER_VALUE);
GUC_check_errdetail("advice stash name must not contain non-ASCII characters");
GUC_check_errdetail("Advice stash name must not contain non-ASCII characters.");
return false;
}

Expand All @@ -412,7 +412,7 @@ pgsa_check_stash_name_guc(char **newval, void **extra, GucSource source)
if (!pgsa_is_identifier(stash_name))
{
GUC_check_errcode(ERRCODE_INVALID_PARAMETER_VALUE);
GUC_check_errdetail("advice stash name must begin with a letter or underscore and contain only letters, digits, and underscores");
GUC_check_errdetail("Advice stash name must begin with a letter or underscore and contain only letters, digits, and underscores.");
return false;
}

Expand Down Expand Up @@ -701,7 +701,7 @@ pgsa_set_advice_string(char *stash_name, int64 queryId, char *advice_string)
ereport(ERROR,
errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("out of memory"),
errdetail("could not insert advice string into shared hash table"));
errdetail("Could not insert advice string into shared hash table."));
}

/* Update the entry and release the lock. */
Expand Down
2 changes: 1 addition & 1 deletion contrib/postgres_fdw/expected/postgres_fdw.out
Original file line number Diff line number Diff line change
Expand Up @@ -11839,7 +11839,7 @@ DELETE FROM result_tbl;
-- Test COPY TO when foreign table is partition
COPY async_pt TO stdout; --error
ERROR: cannot copy from foreign table "async_p1"
DETAIL: Partition "async_p1" is a foreign table in partitioned table "async_pt"
DETAIL: Partition "async_p1" is a foreign table in partitioned table "async_pt".
HINT: Try the COPY (SELECT ...) TO variant.
DROP FOREIGN TABLE async_p3;
DROP TABLE base_tbl3;
Expand Down
6 changes: 5 additions & 1 deletion doc/src/sgml/catalogs.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -8893,7 +8893,11 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
<para>
Remote LSN of the state change used for synchronization coordination
when in <literal>s</literal> or <literal>r</literal> states,
otherwise null
otherwise null. For sequences, this instead holds the publisher
sequence's page LSN as of the last synchronization, which does not
track replication progress the way it does for tables; see
<xref linkend="sequences-out-of-sync"/> for how it is used to detect
out-of-sync sequences.
</para></entry>
</row>
</tbody>
Expand Down
36 changes: 29 additions & 7 deletions doc/src/sgml/config.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -4048,14 +4048,36 @@ include_dir 'conf.d'
are sent to archive storage by setting
<xref linkend="guc-archive-command"/> or
<xref linkend="guc-archive-library"/>. In addition to <literal>off</literal>,
to disable, there are two modes: <literal>on</literal>, and
<literal>always</literal>. During normal operation, there is no
difference between the two modes, but when set to <literal>always</literal>
the WAL archiver is enabled also during archive recovery or standby
mode. In <literal>always</literal> mode, all files restored from the archive
or streamed with streaming physical replication will be archived (again). See
<xref linkend="continuous-archiving-in-standby"/> for details.
to disable, there are three modes: <literal>on</literal>, <literal>shared</literal>,
and <literal>always</literal>. During normal operation as a primary, there is no
difference between the three modes, but they differ during archive recovery or
standby mode:
</para>
<itemizedlist>
<listitem>
<para>
<literal>on</literal>: Archives WAL only when running as a primary.
</para>
</listitem>
<listitem>
<para>
<literal>shared</literal>: Coordinates archiving between primary and standby.
The standby defers WAL archival and deletion until the primary confirms
archival via streaming replication. This prevents WAL history loss during
standby promotion in high availability setups. Upon promotion, the standby
automatically starts archiving any remaining unarchived WAL. This mode works
with cascading replication, where each standby coordinates with its immediate
upstream server. See <xref linkend="continuous-archiving-in-standby"/> for details.
</para>
</listitem>
<listitem>
<para>
<literal>always</literal>: Archives all WAL independently, even during recovery.
All files restored from the archive or streamed with streaming physical
replication will be archived (again), regardless of their source.
</para>
</listitem>
</itemizedlist>
<para>
<varname>archive_mode</varname> is a separate setting from
<varname>archive_command</varname> and
Expand Down
13 changes: 7 additions & 6 deletions doc/src/sgml/datatype.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,13 @@
<row>
<entry><type>timestamp [ (<replaceable>p</replaceable>) ] [ without time zone ]</type></entry>
<entry></entry>
<entry>date and time (no time zone)</entry>
<entry>date and time (no time zone conversion)</entry>
</row>

<row>
<entry><type>timestamp [ (<replaceable>p</replaceable>) ] with time zone</type></entry>
<entry><type>timestamptz</type></entry>
<entry>date and time, including time zone</entry>
<entry>date and time, including time zone conversion</entry>
</row>

<row>
Expand Down Expand Up @@ -1768,15 +1768,15 @@ SELECT 'abc \153\154\155 \052\251\124'::bytea;
<row>
<entry><type>timestamp [ (<replaceable>p</replaceable>) ] [ without time zone ]</type></entry>
<entry>8 bytes</entry>
<entry>both date and time (no time zone)</entry>
<entry>both date and time (no time zone conversion)</entry>
<entry>4713 BC</entry>
<entry>294276 AD</entry>
<entry>1 microsecond</entry>
</row>
<row>
<entry><type>timestamp [ (<replaceable>p</replaceable>) ] with time zone</type></entry>
<entry>8 bytes</entry>
<entry>both date and time, with time zone</entry>
<entry>both date and time, with time zone conversion</entry>
<entry>4713 BC</entry>
<entry>294276 AD</entry>
<entry>1 microsecond</entry>
Expand Down Expand Up @@ -2263,8 +2263,9 @@ TIMESTAMP WITH TIME ZONE '2004-10-19 10:23:54+02'
then it is assumed to be in the time zone indicated by the system's
<xref linkend="guc-timezone"/> parameter, and is converted to UTC using the
offset for the <varname>timezone</varname> zone.
In either case, the value is stored internally as UTC, and the
originally stated or assumed time zone is not retained.
In either case, the value is stored internally as UTC. The
originally stated or assumed time zone is not retained and
<emphasis>cannot</emphasis> be retrieved later.
</para>

<para>
Expand Down
10 changes: 8 additions & 2 deletions doc/src/sgml/ddl.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -2396,7 +2396,11 @@ REVOKE ALL ON accounts FROM PUBLIC;
<listitem>
<para>
Allows creation of a foreign key constraint referencing a
table, or specific column(s) of a table.
table, or specific column(s) of a table. Great care should be taken when
granting this privilege, since a user who creates a foreign key can arrange
for enforcement of that foreign key to call an arbitrary function, such as
a cast function, and such functions will be called with the privileges of
the table owner.
</para>
</listitem>
</varlistentry>
Expand All @@ -2405,7 +2409,9 @@ REVOKE ALL ON accounts FROM PUBLIC;
<term><literal>TRIGGER</literal></term>
<listitem>
<para>
Allows creation of a trigger on a table, view, etc.
Allows creation of a trigger on a table, view, etc. Great care should be
taken when granting this privilege, since any triggers added to a table
or view will be executed with the privileges of users who modify it.
</para>
</listitem>
</varlistentry>
Expand Down
4 changes: 2 additions & 2 deletions doc/src/sgml/func/func-formatting.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@
</row>
<row>
<entry><literal>OF</literal></entry>
<entry>time-zone offset from UTC (<replaceable>HH</replaceable>
or <replaceable>HH</replaceable><literal>:</literal><replaceable>MM</replaceable>)</entry>
<entry>time-zone offset from UTC (<replaceable>hh</replaceable>
or <replaceable>hh</replaceable><literal>:</literal><replaceable>mi</replaceable>)</entry>
</row>
</tbody>
</tgroup>
Expand Down
5 changes: 5 additions & 0 deletions doc/src/sgml/func/func-info.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -3436,6 +3436,11 @@ acl | {postgres=arwdDxtm/postgres,foo=r/postgres}
<entry><type>boolean</type></entry>
</row>

<row>
<entry><structfield>logical_decoding</structfield></entry>
<entry><type>boolean</type></entry>
</row>

<row>
<entry><structfield>next_xid</structfield></entry>
<entry><type>text</type></entry>
Expand Down
85 changes: 58 additions & 27 deletions doc/src/sgml/high-availability.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,10 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
<structname>pg_stat_wal_receiver</structname></link> view. A large
difference between <function>pg_last_wal_replay_lsn</function> and the
view's <literal>flushed_lsn</literal> indicates that WAL is being
received faster than it can be replayed.
received faster than it can be replayed. Recovery state and replay
progress can also be monitored via the
<link linkend="monitoring-pg-stat-recovery-view">
<structname>pg_stat_recovery</structname></link> view.
</para>
</sect3>
</sect2>
Expand Down Expand Up @@ -1449,35 +1452,61 @@ postgres=# WAIT FOR LSN '0/306EE20';
</indexterm>

<para>
When continuous WAL archiving is used in a standby, there are two
different scenarios: the WAL archive can be shared between the primary
and the standby, or the standby can have its own WAL archive. When
the standby has its own WAL archive, set <varname>archive_mode</varname>
When continuous WAL archiving is used in a standby, there are three
different scenarios: the standby can have its own independent WAL archive,
the WAL archive can be shared between the primary and standby, or archiving
can be coordinated between them.
</para>

<para>
For an independent archive, set <varname>archive_mode</varname>
to <literal>always</literal>, and the standby will call the archive
command for every WAL segment it receives, whether it's by restoring
from the archive or by streaming replication. The shared archive can
be handled similarly, but the <varname>archive_command</varname> or <varname>archive_library</varname> must
test if the file being archived exists already, and if the existing file
has identical contents. This requires more care in the
<varname>archive_command</varname> or <varname>archive_library</varname>, as it must
be careful to not overwrite an existing file with different contents,
but return success if the exactly same file is archived twice. And
all that must be done free of race conditions, if two servers attempt
to archive the same file at the same time.
from the archive or by streaming replication.
</para>

<para>
For a shared archive where both primary and standby can write, use
<literal>always</literal> mode as well, but the <varname>archive_command</varname>
or <varname>archive_library</varname> must test if the file being archived
exists already, and if the existing file has identical contents. This requires
more care in the <varname>archive_command</varname> or <varname>archive_library</varname>,
as it must be careful to not overwrite an existing file with different contents,
but return success if the exactly same file is archived twice. And all that must
be done free of race conditions, if two servers attempt to archive the same file
at the same time.
</para>

<para>
For coordinated archiving in high availability setups, use
<varname>archive_mode</varname>=<literal>shared</literal>. In this mode, only
the primary archives WAL segments. The standby creates <literal>.ready</literal>
files for received segments but defers actual archiving. The primary periodically
sends archival status updates to the standby via streaming replication, informing
it which segments have been archived. The standby then marks these as archived
and allows them to be recycled. Upon promotion, the standby automatically starts
archiving any remaining WAL segments that weren't confirmed as archived by the
former primary. This prevents WAL history loss during failover while avoiding
the complexity of coordinating concurrent archiving. This mode works with cascading
replication, where each standby coordinates with its immediate upstream server.
</para>

<para>
If <varname>archive_mode</varname> is set to <literal>on</literal>, the
archiver is not enabled during recovery or standby mode. If the standby
server is promoted, it will start archiving after the promotion, but
will not archive any WAL or timeline history files that
it did not generate itself. To get a complete
series of WAL files in the archive, you must ensure that all WAL is
archived, before it reaches the standby. This is inherently true with
file-based log shipping, as the standby can only restore files that
are found in the archive, but not if streaming replication is enabled.
When a server is not in recovery mode, there is no difference between
<literal>on</literal> and <literal>always</literal> modes.
archiver is not enabled during recovery or standby mode, and this setting
cannot be used on a standby. If a standby with <literal>archive_mode</literal>
set to <literal>on</literal> is promoted, it will start archiving after the
promotion, but will not archive any WAL or timeline history files that it did
not generate itself. To get a complete series of WAL files in the archive, you
must ensure that all WAL is archived before it reaches the standby. This is
inherently true with file-based log shipping, as the standby can only restore
files that are found in the archive, but not if streaming replication is enabled.
</para>

<para>
When a server is not in recovery mode, <literal>on</literal>,
<literal>shared</literal>, and <literal>always</literal> modes all behave
identically, archiving completed WAL segments.
</para>
</sect2>
</sect1>
Expand Down Expand Up @@ -1801,9 +1830,11 @@ postgres=# WAIT FOR LSN '0/306EE20';
(In server versions before 14, the <varname>in_hot_standby</varname>
parameter did not exist; a workable substitute method for older servers
is <command>SHOW transaction_read_only</command>.) In addition, a set of
functions (<xref linkend="functions-recovery-info-table"/>) allow users to
access information about the standby server. These allow you to write
programs that are aware of the current state of the database. These
functions (<xref linkend="functions-recovery-info-table"/>) and the
<link linkend="monitoring-pg-stat-recovery-view">
<structname>pg_stat_recovery</structname></link> view allow users to
access information about the standby server. These facilities allow you to
write programs that are aware of the current state of the database. They
can be used to monitor the progress of recovery, or to allow you to
write complex programs that restore the database to particular states.
</para>
Expand Down
Loading