Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for PostgreSQL 14.16.
# Generated by GNU Autoconf 2.69 for PostgreSQL 14.17.
#
# Report bugs to <pgsql-bugs@lists.postgresql.org>.
#
Expand Down Expand Up @@ -582,8 +582,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='PostgreSQL'
PACKAGE_TARNAME='postgresql'
PACKAGE_VERSION='14.16'
PACKAGE_STRING='PostgreSQL 14.16'
PACKAGE_VERSION='14.17'
PACKAGE_STRING='PostgreSQL 14.17'
PACKAGE_BUGREPORT='pgsql-bugs@lists.postgresql.org'
PACKAGE_URL='https://www.postgresql.org/'

Expand Down Expand Up @@ -1445,7 +1445,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures PostgreSQL 14.16 to adapt to many kinds of systems.
\`configure' configures PostgreSQL 14.17 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1510,7 +1510,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of PostgreSQL 14.16:";;
short | recursive ) echo "Configuration of PostgreSQL 14.17:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1682,7 +1682,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
PostgreSQL configure 14.16
PostgreSQL configure 14.17
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2435,7 +2435,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by PostgreSQL $as_me 14.16, which was
It was created by PostgreSQL $as_me 14.17, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -20737,7 +20737,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by PostgreSQL $as_me 14.16, which was
This file was extended by PostgreSQL $as_me 14.17, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -20808,7 +20808,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
PostgreSQL config.status 14.16
PostgreSQL config.status 14.17
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dnl Read the Autoconf manual for details.
dnl
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros

AC_INIT([PostgreSQL], [14.16], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
AC_INIT([PostgreSQL], [14.17], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])

m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
Untested combinations of 'autoconf' and PostgreSQL versions are not
Expand Down
2 changes: 1 addition & 1 deletion doc/src/sgml/config.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -7489,7 +7489,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
various purposes. The cluster name appears in the process title for
all server processes in this cluster. Moreover, it is the default
application name for a standby connection (see <xref
linkend="guc-synchronous-standby-names"/>.)
linkend="guc-synchronous-standby-names"/>).
</para>

<para>
Expand Down
2 changes: 1 addition & 1 deletion doc/src/sgml/libpq.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -4756,7 +4756,7 @@ PGresult *PQgetResult(PGconn *conn);
<literal>PGRES_PIPELINE_SYNC</literal> will be returned.
The result of the next query after the synchronization point follows
immediately (that is, no null pointer is returned after
the synchronization point.)
the synchronization point).
</para>

<note>
Expand Down
114 changes: 114 additions & 0 deletions doc/src/sgml/release-14.sgml
Original file line number Diff line number Diff line change
@@ -1,6 +1,120 @@
<!-- doc/src/sgml/release-14.sgml -->
<!-- See header comment in release.sgml about typical markup -->

<sect1 id="release-14-17">
<title>Release 14.17</title>

<formalpara>
<title>Release date:</title>
<para>2025-02-20</para>
</formalpara>

<para>
This release contains a few fixes from 14.16.
For information about new features in major release 14, see
<xref linkend="release-14"/>.
</para>

<sect2>
<title>Migration to Version 14.17</title>

<para>
A dump/restore is not required for those running 14.X.
</para>

<para>
However, if you are upgrading from a version earlier than 14.14,
see <xref linkend="release-14-14"/>.
</para>
</sect2>

<sect2>
<title>Changes</title>

<itemizedlist>

<listitem>
<!--
Author: Andres Freund <andres@anarazel.de>
Branch: master [efdadeb22] 2025-02-14 18:09:19 -0500
Branch: REL_17_STABLE [a92db3d02] 2025-02-14 18:09:21 -0500
Branch: REL_16_STABLE [111f4dd27] 2025-02-14 18:09:23 -0500
Branch: REL_15_STABLE [22ffbbf24] 2025-02-14 18:09:24 -0500
Branch: REL_14_STABLE [985908df1] 2025-02-14 18:09:25 -0500
Branch: REL_13_STABLE [1f7a05324] 2025-02-14 18:09:27 -0500
Author: Tom Lane <tgl@sss.pgh.pa.us>
Branch: master [9f45e6a91] 2025-02-15 16:20:21 -0500
Branch: REL_17_STABLE [3abe6e04c] 2025-02-15 16:20:21 -0500
Branch: REL_16_STABLE [991a60a9f] 2025-02-15 16:20:21 -0500
Branch: REL_15_STABLE [e782a63cc] 2025-02-15 16:20:21 -0500
Branch: REL_14_STABLE [c08309584] 2025-02-15 16:20:21 -0500
Branch: REL_13_STABLE [d6d29b213] 2025-02-15 16:20:21 -0500
Author: Tom Lane <tgl@sss.pgh.pa.us>
Branch: master [a7f95859e] 2025-02-16 12:46:35 -0500
Branch: REL_17_STABLE [3977bd298] 2025-02-16 12:46:35 -0500
Branch: REL_16_STABLE [644b7d686] 2025-02-16 12:46:35 -0500
Branch: REL_15_STABLE [2226a2e26] 2025-02-16 12:46:35 -0500
Branch: REL_14_STABLE [f864a4cdf] 2025-02-16 12:46:35 -0500
Branch: REL_13_STABLE [9f052613e] 2025-02-16 12:46:35 -0500
-->
<para>
Improve behavior of <application>libpq</application>'s quoting
functions (Andres Freund, Tom Lane)
<ulink url="&commit_baseurl;985908df1">&sect;</ulink>
<ulink url="&commit_baseurl;c08309584">&sect;</ulink>
<ulink url="&commit_baseurl;f864a4cdf">&sect;</ulink>
</para>

<para>
The changes made for CVE-2025-1094 had one serious oversight:
<function>PQescapeLiteral()</function>
and <function>PQescapeIdentifier()</function> failed to honor their
string length parameter, instead always reading to the input
string's trailing null. This resulted in including unwanted text in
the output, if the caller intended to truncate the string via the
length parameter. With very bad luck it could cause a crash due to
reading off the end of memory.
</para>

<para>
In addition, modify all these quoting functions so that when invalid
encoding is detected, an invalid sequence is substituted for just
the first byte of the presumed character, not all of it. This
reduces the risk of problems if a calling application performs
additional processing on the quoted string.
</para>
</listitem>

<listitem>
<!--
note: no actual bug in v15 and later
Author: Michael Paquier <michael@paquier.xyz>
Branch: master [773c51dd3] 2025-02-13 16:30:58 +0900
Branch: REL_17_STABLE [6342d49d8] 2025-02-13 16:31:05 +0900
Branch: REL_16_STABLE [139beb035] 2025-02-13 16:31:08 +0900
Branch: REL_15_STABLE [a37c83d1e] 2025-02-13 16:31:10 +0900
Branch: REL_14_STABLE [8e58f8024] 2025-02-13 16:31:11 +0900
Branch: REL_13_STABLE [520905824] 2025-02-13 16:31:12 +0900
-->
<para>
Fix crash involving triggers on partitioned tables that make use of
transition tables (Kyotaro Horiguchi)
<ulink url="&commit_baseurl;8e58f8024">&sect;</ulink>
</para>

<para>
If there are both <literal>AFTER UPDATE</literal>
and <literal>AFTER DELETE</literal> triggers, the need for
transition tables was determined incorrectly, leading to a crash
during cross-partition updates.
</para>
</listitem>

</itemizedlist>

</sect2>
</sect1>

<sect1 id="release-14-16">
<title>Release 14.16</title>

Expand Down
36 changes: 20 additions & 16 deletions src/backend/commands/trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -4511,8 +4511,10 @@ TransitionCaptureState *
MakeTransitionCaptureState(TriggerDesc *trigdesc, Oid relid, CmdType cmdType)
{
TransitionCaptureState *state;
bool need_old,
need_new;
bool need_old_upd,
need_new_upd,
need_old_del,
need_new_ins;
AfterTriggersTableData *table;
MemoryContext oldcxt;
ResourceOwner saveResourceOwner;
Expand All @@ -4524,23 +4526,25 @@ MakeTransitionCaptureState(TriggerDesc *trigdesc, Oid relid, CmdType cmdType)
switch (cmdType)
{
case CMD_INSERT:
need_old = false;
need_new = trigdesc->trig_insert_new_table;
need_old_upd = need_old_del = need_new_upd = false;
need_new_ins = trigdesc->trig_insert_new_table;
break;
case CMD_UPDATE:
need_old = trigdesc->trig_update_old_table;
need_new = trigdesc->trig_update_new_table;
need_old_upd = trigdesc->trig_update_old_table;
need_new_upd = trigdesc->trig_update_new_table;
need_old_del = need_new_ins = false;
break;
case CMD_DELETE:
need_old = trigdesc->trig_delete_old_table;
need_new = false;
need_old_del = trigdesc->trig_delete_old_table;
need_old_upd = need_new_upd = need_new_ins = false;
break;
default:
elog(ERROR, "unexpected CmdType: %d", (int) cmdType);
need_old = need_new = false; /* keep compiler quiet */
/* keep compiler quiet */
need_old_upd = need_new_upd = need_old_del = need_new_ins = false;
break;
}
if (!need_old && !need_new)
if (!need_old_upd && !need_new_upd && !need_new_ins && !need_old_del)
return NULL;

/* Check state, like AfterTriggerSaveEvent. */
Expand Down Expand Up @@ -4570,20 +4574,20 @@ MakeTransitionCaptureState(TriggerDesc *trigdesc, Oid relid, CmdType cmdType)
saveResourceOwner = CurrentResourceOwner;
CurrentResourceOwner = CurTransactionResourceOwner;

if (need_old && table->old_tuplestore == NULL)
if ((need_old_upd || need_old_del) && table->old_tuplestore == NULL)
table->old_tuplestore = tuplestore_begin_heap(false, false, work_mem);
if (need_new && table->new_tuplestore == NULL)
if ((need_new_upd || need_new_ins) && table->new_tuplestore == NULL)
table->new_tuplestore = tuplestore_begin_heap(false, false, work_mem);

CurrentResourceOwner = saveResourceOwner;
MemoryContextSwitchTo(oldcxt);

/* Now build the TransitionCaptureState struct, in caller's context */
state = (TransitionCaptureState *) palloc0(sizeof(TransitionCaptureState));
state->tcs_delete_old_table = trigdesc->trig_delete_old_table;
state->tcs_update_old_table = trigdesc->trig_update_old_table;
state->tcs_update_new_table = trigdesc->trig_update_new_table;
state->tcs_insert_new_table = trigdesc->trig_insert_new_table;
state->tcs_delete_old_table = need_old_del;
state->tcs_update_old_table = need_old_upd;
state->tcs_update_new_table = need_new_upd;
state->tcs_insert_new_table = need_new_ins;
state->tcs_private = table;

return state;
Expand Down
4 changes: 3 additions & 1 deletion src/backend/executor/execMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -2533,13 +2533,15 @@ bool
EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot)
{
ExecAuxRowMark *earm = epqstate->relsubs_rowmark[rti - 1];
ExecRowMark *erm = earm->rowmark;
ExecRowMark *erm;
Datum datum;
bool isNull;

Assert(earm != NULL);
Assert(epqstate->origslot != NULL);

erm = earm->rowmark;

if (RowMarkRequiresRowShareLock(erm->markType))
elog(ERROR, "EvalPlanQual doesn't support locking rowmarks");

Expand Down
Loading