Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
9159939
doc: Fix title markup for AT TIME ZONE and AT LOCAL
danielgustafsson May 8, 2025
bb28d37
Centralize ssl tests' check for whether we're using LibreSSL.
tglsfdc May 9, 2025
a1924ca
Skip RSA-PSS ssl test when using LibreSSL.
tglsfdc May 9, 2025
adcefd6
Fix incorrect "return NULL" in BumpAllocLarge().
tglsfdc May 11, 2025
ea2b7f4
Fix comment of tsquerysend()
May 11, 2025
8de8420
Fix order of parameters in POD documentation
danielgustafsson May 13, 2025
5465a7f
Fix Assert failure in XMLTABLE parser
May 15, 2025
2d690e6
Align organization wording in copyright statement
danielgustafsson May 16, 2025
cd202c1
Make our usage of memset_s() conform strictly to the C11 standard.
tglsfdc May 18, 2025
9948e74
Don't retreat slot's confirmed_flush LSN.
May 19, 2025
5dc77ca
Fix deparsing FETCH FIRST <expr> ROWS WITH TIES
hlinnaka May 19, 2025
31af1d8
doc: Clarify use of _ccnew and _ccold in REINDEX CONCURRENTLY
michaelpq May 20, 2025
711cf66
Fix cross-version upgrade test failure
hlinnaka May 20, 2025
435442b
Fix incorrect WAL description for PREPARE TRANSACTION record.
MasaoFujii May 21, 2025
3eac9ef
Fix memory leak in XMLSERIALIZE(... INDENT).
tglsfdc May 22, 2025
f2827e5
Fix AlignedAllocRealloc to cope sanely with OOM.
tglsfdc May 23, 2025
84ee85b
Fix per-relation memory leakage in autovacuum.
tglsfdc May 23, 2025
88c3f98
doc: Fix documenation for snapshot export in logical decoding.
MasaoFujii May 26, 2025
398a9fb
Fix race condition in subscription TAP test 021_twophase
michaelpq May 26, 2025
5428415
Fix conversion of SIMILAR TO regexes for character classes
michaelpq May 27, 2025
7a2c14d
Adjust regex for test with opening parenthesis in character classes
michaelpq May 28, 2025
137e446
pg_stat_statements: Fix parameter number gaps in normalized queries
michaelpq May 29, 2025
b19f296
Fix assertion failure in pg_prewarm() on objects without storage.
MasaoFujii May 29, 2025
a8aac66
Avoid resource leaks when a dblink connection fails.
tglsfdc May 29, 2025
ba6308c
Fix broken-FK-detection query in release notes
May 30, 2025
c0edd2d
Make XactLockTableWait() and ConditionalXactLockTableWait() interrupt…
MasaoFujii May 30, 2025
332271a
Allow larger packets during GSSAPI authentication exchange.
tglsfdc May 30, 2025
10d9e75
Fix memory leakage in postgres_fdw's DirectModify code path.
tglsfdc May 30, 2025
a0da792
Ensure we have a snapshot when updating various system catalogs.
nathan-bossart May 30, 2025
1402fca
Fix MERGE into a plain inheritance parent table.
deanrasheed May 31, 2025
62f56e4
Fix edge-case resource leaks in PL/Python error reporting.
tglsfdc Jun 1, 2025
258a650
Run pgindent on the previous commit.
tglsfdc Jun 1, 2025
3a57c94
Use replay LSN as target for cascading logical WAL senders
michaelpq Jun 2, 2025
6c229b6
Disallow "=" in names of reloptions and foreign-data options.
tglsfdc Jun 2, 2025
a1b9268
doc: Remove notes about "unencrypted" passwords.
nathan-bossart Jun 4, 2025
d041ccf
Doc: you must own the target object to use SECURITY LABEL.
tglsfdc Jun 5, 2025
af2ea1a
pg_prewarm: Allow autoprewarm to use more than 1GB to dump blocks.
robertmhaas Jun 6, 2025
df3294f
Fixed signed/unsigned mismatch in test_dsm_registry.
nathan-bossart Jun 6, 2025
351db19
pg_restore: fix incompatibility with old directory-format dumps.
tglsfdc Jun 8, 2025
2325393
Don't reduce output request size on non-Unix-socket connections.
tglsfdc Jun 10, 2025
afbcb0f
Make _bt_killitems drop pins it acquired itself.
petergeoghegan Jun 11, 2025
68a325d
Keep WAL segments by the flushed value of the slot's restart LSN
akorotkov Jun 14, 2025
a65dc9a
Add TAP tests to check replication slot advance during the checkpoint
akorotkov Jun 14, 2025
c839d83
Fix re-distributing previously distributed invalidation messages duri…
MasahikoSawada Jun 17, 2025
6823c98
Improve log messages and docs for slot synchronization.
Jun 19, 2025
812702f
Correct docs about partitions and EXCLUDE constraints.
jeff-davis Jun 19, 2025
3e1dae1
Improve runtime and output of tests for replication slots checkpointing.
akorotkov Jun 19, 2025
7540a3c
Use SnapshotDirty when checking for conflicting index names.
tglsfdc Jun 20, 2025
8005baa
Doc: improve documentation about width_bucket().
tglsfdc Jun 21, 2025
ec12fdd
meson: Fix meson warning
petere Jun 22, 2025
6baa726
doc: Fix incorrect UUID index entry in function documentation.
MasaoFujii Jun 24, 2025
6142775
doc: Remove dead link to NewbieDoc Docbook Guide
danielgustafsson Jun 24, 2025
d7761fd
Test that vacuum removes tuples older than OldestXmin
melanieplageman Jun 24, 2025
c985a5e
Prevent excessive delays before launching new logrep workers.
tglsfdc Jun 24, 2025
9adbeea
Avoid scribbling of VACUUM options
michaelpq Jun 25, 2025
09f5371
Doc: Improve documentation of stream abort.
Jun 25, 2025
5c2b3ab
doc: Fix indentation of MERGE synopsis.
deanrasheed Jun 26, 2025
de3c54d
Remove unused check in heap_xlog_insert()
melanieplageman Jun 26, 2025
ffbebc9
Use correct DatumGet*() function in test_shm_mq_main().
nathan-bossart Jun 27, 2025
02c13cc
Obtain required table lock during cross-table constraint updates.
tglsfdc Jun 29, 2025
3967a8a
doc: Fix typo in pg_sync_replication_slots documentation
danielgustafsson Jun 30, 2025
abc64a5
Fix typos in comments
amitlan Jul 1, 2025
d6629c9
Make safeguard against incorrect flags for fsync more portable.
tglsfdc Jul 1, 2025
ed2a875
Make sure IOV_MAX is defined.
tglsfdc Jul 1, 2025
f761ad4
Fix outdated comment for IndexInfo
petere Jul 1, 2025
5e5d03d
Document pg_get_multixact_members().
nathan-bossart Jul 1, 2025
7c9d230
Update comment for IndexInfo.ii_NullsNotDistinct
petere Jul 1, 2025
71c61ea
Fix bug in archive streamer with LZ4 decompression
michaelpq Jul 2, 2025
ce1bb13
Fix missing FSM vacuum opportunities on tables without indexes.
MasahikoSawada Jul 2, 2025
a7e214f
Correctly copy the target host identification in PQcancelCreate.
tglsfdc Jul 2, 2025
3d1f4d6
doc: Remove incorrect note about wal_status in pg_replication_slots.
MasaoFujii Jul 3, 2025
e199289
doc: Update outdated descriptions of wal_status in pg_replication_slots.
MasaoFujii Jul 3, 2025
fe6436a
Obtain required table lock during cross-table updates, redux.
tglsfdc Jul 3, 2025
0da8244
Disable commit timestamps during bootstrap
michaelpq Jul 4, 2025
f5876ad
pg_upgrade: check for inconsistencies in not-null constraints w/inher…
Jul 4, 2025
33c457f
pg_upgrade: Add missing newline in error message
Jul 4, 2025
c758299
Fix new pg_upgrade query not to rely on regnamespace
Jul 4, 2025
d855190
Fix incompatibility with libxml2 >= 2.14
michaelpq Jul 6, 2025
caac88d
Restore the ability to run pl/pgsql expression queries in parallel.
tglsfdc Jul 7, 2025
5ed02a8
Fix low-probability memory leak in XMLSERIALIZE(... INDENT).
tglsfdc Jul 8, 2025
8af6a4b
Doc: Improve logical replication failover documentation.
Jul 9, 2025
78274f6
Fix tab-completion for COPY and \copy options.
MasahikoSawada Jul 9, 2025
643760a
pg_dump: Fix object-type sort priority for large objects.
nathan-bossart Jul 10, 2025
0a071b4
Fix the handling of two GUCs during upgrade.
Jul 11, 2025
baf7d8f
Fix inconsistent quoting of role names in ACLs.
tglsfdc Jul 11, 2025
27db585
Doc: clarify description of current-date/time functions.
tglsfdc Jul 15, 2025
15f320b
Silence uninitialized-value warnings in compareJsonbContainers().
tglsfdc Jul 15, 2025
c9456b0
Doc: clarify description of regexp fields in pg_ident.conf.
tglsfdc Jul 15, 2025
7e03b9f
doc: Fix confusing description of streaming option in START_REPLICATION.
MasaoFujii Jul 15, 2025
5fb19cb
psql: Fix note on project naming in output of \copyright.
nathan-bossart Jul 16, 2025
c8015bc
Fix dumping of comments on invalid constraints on domains
Jul 16, 2025
40fa344
doc: Add example file for COPY
danielgustafsson Jul 16, 2025
9f70e8a
Fix inconsistent LWLock tranche names for MultiXact*
michaelpq Jul 17, 2025
14ace39
Remove duplicate line
amitlan Jul 17, 2025
487c04b
Remove assertion from PortalRunMulti
Jul 17, 2025
725f2fa
Fix PQport to never return NULL unless the connection is NULL.
tglsfdc Jul 17, 2025
41e1a7b
Fix concurrent update trigger issues with MERGE in a CTE.
deanrasheed Jul 18, 2025
ff5f16e
Improve recovery test 046_checkpoint_logical_slot
akorotkov Jul 17, 2025
310214f
Improve the stability of the recovery test 047_checkpoint_physical_slot
akorotkov Jul 19, 2025
566aa2d
Fix infinite wait when reading a partially written WAL record
akorotkov Jul 19, 2025
5358fca
doc: Document reopen of output file via SIGHUP in pg_recvlogical.
MasaoFujii Jul 20, 2025
80146d9
pg_dump: include comments on not-null constraints on domains, too
Jul 21, 2025
28e5254
ecpg: Fix NULL pointer dereference during connection lookup
michaelpq Jul 22, 2025
b984588
doc: Inform about aminsertcleanup optional NULLness
michaelpq Jul 22, 2025
3922b2d
Fix build breakage on Solaris-alikes with late-model GCC.
tglsfdc Jul 23, 2025
67a5f3b
Fix duplicate transaction replay during pg_createsubscriber.
Jul 24, 2025
8885959
Limit checkpointer requests queue size
akorotkov Jul 27, 2025
c846d1e
Avoid regression in the size of XML input that we will accept.
tglsfdc Jul 28, 2025
fee4cc9
Clarify documentation for the initcap function
akorotkov Jul 29, 2025
b1b1b66
Remove unnecessary complication around xmlParseBalancedChunkMemory.
tglsfdc Jul 29, 2025
4d79ddf
Don't put library-supplied -L/-I switches before user-supplied ones.
tglsfdc Jul 29, 2025
0d70ba3
Fix ./configure checks with __cpuidex() and __cpuid()
michaelpq Jul 30, 2025
93b69a4
pg_dump: provide a stable sort order for rules.
tglsfdc Nov 4, 2024
2dc1421
Sort dump objects independent of OIDs, for the 7 holdout object types.
nmisch Jul 31, 2025
fc733f3
Fix a deadlock during ALTER SUBSCRIPTION ... DROP PUBLICATION.
Aug 1, 2025
a007f07
Allow resetting unknown custom GUCs with reserved prefixes.
nathan-bossart Aug 1, 2025
fbba021
Fix use-after-free with INSERT ON CONFLICT changes in reorderbuffer.c
michaelpq Aug 2, 2025
350b0c6
Doc: clarify the restrictions of AFTER triggers with transition tables.
Aug 2, 2025
0d93673
Fix assertion failure in pgbench when handling multiple pipeline sync…
MasaoFujii Aug 3, 2025
2682660
doc: mention unusability of dropped CHECK to verify NOT NULL
Aug 4, 2025
3f8e01f
Avoid unexpected shutdown when sync_replication_slots is enabled.
MasaoFujii Aug 4, 2025
2af0751
Fix typo in create_index.sql.
deanrasheed Aug 4, 2025
a384622
Minor test fixes in 035_standby_logical_decoding.pl
melanieplageman Aug 4, 2025
080ff1f
Fix incorrect return value in brin_minmax_multi_distance_numeric().
tglsfdc Aug 5, 2025
661c207
doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS.
MasaoFujii Aug 6, 2025
79e35bb
pg_upgrade: Improve message indentation
petere Aug 7, 2025
38ba6e2
Update ICU C++ API symbols
j-naylor Aug 7, 2025
3dbff77
Revert "Clarify documentation for the initcap function"
akorotkov Aug 7, 2025
f0eacea
Message improvements
petere Aug 7, 2025
ad61f3a
Fix checkpointer shared memory allocation
akorotkov Aug 7, 2025
57b9d3a
doc: Formatting improvements
petere Aug 7, 2025
8e90812
doc: add float as an alias for double precision.
tglsfdc Aug 7, 2025
be60167
Add information about "generation" when dropping twice pgstats entry
michaelpq Aug 8, 2025
436016f
Disallow collecting transition tuples from child foreign tables.
Aug 8, 2025
83f4ac5
pg_dump: Fix incorrect parsing of object types in pg_dump --filter.
MasaoFujii Aug 8, 2025
220f1c0
Fix oversight in FindTriggerIncompatibleWithInheritance.
Aug 8, 2025
502f655
Fix incorrect lack of Datum conversion in _int_matchsel()
petere Aug 8, 2025
decea1a
First-draft release notes for 17.6.
tglsfdc Aug 8, 2025
66df3c3
Remove, from stable branches, the new assertion of no pg_dump OID sort.
nmisch Aug 10, 2025
e819d61
Release notes for 17.6, 16.10, 15.14, 14.19, 13.22.
tglsfdc Aug 10, 2025
520fa36
Fix security checks in selectivity estimation functions.
deanrasheed Aug 11, 2025
b0c0089
Translation updates
petere Aug 11, 2025
86b3e2b
Convert newlines to spaces in names written in v11+ pg_dump comments.
nmisch Aug 11, 2025
6042e42
Restrict psql meta-commands in plain-text dumps.
nathan-bossart Aug 11, 2025
20ff7f9
Last-minute updates for release notes.
tglsfdc Aug 11, 2025
69524ca
Stamp 17.6.
tglsfdc Aug 11, 2025
c4ec594
Updated expected Percona Server version to 17.6.1
artemgavrilov Sep 2, 2025
19101d3
Update tests after sync with upstream version 17.6
artemgavrilov Sep 2, 2025
39601ca
Fix percona server version
artemgavrilov Sep 8, 2025
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
Prev Previous commit
Next Next commit
Make our usage of memset_s() conform strictly to the C11 standard.
Per the letter of the C11 standard, one must #define
__STDC_WANT_LIB_EXT1__ as 1 before including <string.h> in order to
have access to memset_s().  It appears that many platforms are lenient
about this, because we weren't doing it and yet the code appeared to
work anyway.  But we now find that with -std=c11, macOS is strict and
doesn't declare memset_s, leading to compile failures since we try to
use it anyway.  (Given the lack of prior reports, perhaps this is new
behavior in the latest SDK?  No matter, we're clearly in the wrong.)

In addition to the immediate problem, which could be fixed merely by
adding the needed #define to explicit_bzero.c, it seems possible that
our configure-time probe for memset_s() could fail in case a platform
implements the function in some odd way due to this spec requirement.
This concern can be fixed in largely the same way that we dealt with
strchrnul() in 6da2ba1: switch to using a declaration-based
configure probe instead of a does-it-link probe.

Back-patch to v13 where we started using memset_s().

Reported-by: Lakshmi Narayana Velayudam <[email protected]>
Author: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/CAA4pTnLcKGG78xeOjiBr5yS7ZeE-Rh=FaFQQGOO=nPzA1L8yEA@mail.gmail.com
Backpatch-through: 13
  • Loading branch information
tglsfdc authored and artemgavrilov committed Sep 3, 2025
commit cd202c1ad1801e5a99d4994f4ea33ae983176712
15 changes: 14 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -15419,7 +15419,7 @@ fi
LIBS_including_readline="$LIBS"
LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`

for ac_func in backtrace_symbols copyfile copy_file_range getifaddrs getpeerucred inet_pton kqueue mbstowcs_l memset_s posix_fallocate ppoll pthread_is_threaded_np setproctitle setproctitle_fast strsignal syncfs sync_file_range uselocale wcstombs_l
for ac_func in backtrace_symbols copyfile copy_file_range getifaddrs getpeerucred inet_pton kqueue mbstowcs_l posix_fallocate ppoll pthread_is_threaded_np setproctitle setproctitle_fast strsignal syncfs sync_file_range uselocale wcstombs_l
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
Expand Down Expand Up @@ -15975,6 +15975,19 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRCHRNUL $ac_have_decl
_ACEOF

ac_fn_c_check_decl "$LINENO" "memset_s" "ac_cv_have_decl_memset_s" "#define __STDC_WANT_LIB_EXT1__ 1
#include <string.h>
"
if test "x$ac_cv_have_decl_memset_s" = xyes; then :
ac_have_decl=1
else
ac_have_decl=0
fi

cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_MEMSET_S $ac_have_decl
_ACEOF


# This is probably only present on macOS, but may as well check always
ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include <fcntl.h>
Expand Down
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,6 @@ AC_CHECK_FUNCS(m4_normalize([
inet_pton
kqueue
mbstowcs_l
memset_s
posix_fallocate
ppoll
pthread_is_threaded_np
Expand Down Expand Up @@ -1839,6 +1838,8 @@ AC_CHECK_DECLS([strlcat, strlcpy, strnlen])
AC_CHECK_DECLS([preadv], [], [], [#include <sys/uio.h>])
AC_CHECK_DECLS([pwritev], [], [], [#include <sys/uio.h>])
AC_CHECK_DECLS([strchrnul], [], [], [#include <string.h>])
AC_CHECK_DECLS([memset_s], [], [], [#define __STDC_WANT_LIB_EXT1__ 1
#include <string.h>])

# This is probably only present on macOS, but may as well check always
AC_CHECK_DECLS(F_FULLFSYNC, [], [], [#include <fcntl.h>])
Expand Down
14 changes: 8 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2479,6 +2479,7 @@ decl_checks += [
['preadv', 'sys/uio.h'],
['pwritev', 'sys/uio.h'],
['strchrnul', 'string.h'],
['memset_s', 'string.h', '#define __STDC_WANT_LIB_EXT1__ 1'],
]

# Check presence of some optional LLVM functions.
Expand All @@ -2492,21 +2493,23 @@ endif
foreach c : decl_checks
func = c.get(0)
header = c.get(1)
args = c.get(2, {})
prologue = c.get(2, '')
args = c.get(3, {})
varname = 'HAVE_DECL_' + func.underscorify().to_upper()

found = cc.compiles('''
#include <@0@>
@0@
#include <@1@>

int main()
{
#ifndef @1@
(void) @1@;
#ifndef @2@
(void) @2@;
#endif

return 0;
}
'''.format(header, func),
'''.format(prologue, header, func),
name: 'test whether @0@ is declared'.format(func),
# need to add cflags_warn to get at least
# -Werror=unguarded-availability-new if applicable
Expand Down Expand Up @@ -2735,7 +2738,6 @@ func_checks = [
['inet_pton'],
['kqueue'],
['mbstowcs_l'],
['memset_s'],
['mkdtemp'],
['posix_fadvise'],
['posix_fallocate'],
Expand Down
7 changes: 4 additions & 3 deletions src/include/pg_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
`LLVMCreatePerfJITEventListener', and to 0 if you don't. */
#undef HAVE_DECL_LLVMCREATEPERFJITEVENTLISTENER

/* Define to 1 if you have the declaration of `memset_s', and to 0 if you
don't. */
#undef HAVE_DECL_MEMSET_S

/* Define to 1 if you have the declaration of `posix_fadvise', and to 0 if you
don't. */
#undef HAVE_DECL_POSIX_FADVISE
Expand Down Expand Up @@ -304,9 +308,6 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H

/* Define to 1 if you have the `memset_s' function. */
#undef HAVE_MEMSET_S

/* Define to 1 if you have the `mkdtemp' function. */
#undef HAVE_MKDTEMP

Expand Down
4 changes: 3 additions & 1 deletion src/port/explicit_bzero.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
*-------------------------------------------------------------------------
*/

#define __STDC_WANT_LIB_EXT1__ 1 /* needed to access memset_s() */

#include "c.h"

#if defined(HAVE_MEMSET_S)
#if HAVE_DECL_MEMSET_S

void
explicit_bzero(void *buf, size_t len)
Expand Down