Skip to content

[pull] master from postgres:master #1009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 1, 2025
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
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#
# $ git log --pretty=format:"%H # %cd%n# %s" $PGINDENTGITHASH -1 --date=iso

9e345415bcd3c4358350b89edfd710469b8bfaf9 # 2025-07-01 15:23:07 +0200
# Fix indentation in pg_numa code

b27644bade0348d0dafd3036c47880a349fe9332 # 2025-06-15 13:04:24 -0400
# Sync typedefs.list with the buildfarm.

Expand Down
4 changes: 2 additions & 2 deletions contrib/isn/isn.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ string2ean(const char *str, struct Node *escontext, ean13 *result,
if (type != INVALID)
goto eaninvalid;
type = ISSN;
*aux1++ = toupper((unsigned char) *aux2);
*aux1++ = pg_ascii_toupper((unsigned char) *aux2);
length++;
}
else if (length == 9 && (digit || *aux2 == 'X' || *aux2 == 'x') && last)
Expand All @@ -736,7 +736,7 @@ string2ean(const char *str, struct Node *escontext, ean13 *result,
goto eaninvalid;
if (type == INVALID)
type = ISBN; /* ISMN must start with 'M' */
*aux1++ = toupper((unsigned char) *aux2);
*aux1++ = pg_ascii_toupper((unsigned char) *aux2);
length++;
}
else if (length == 11 && digit && last)
Expand Down
2 changes: 1 addition & 1 deletion contrib/spi/refint.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ check_foreign_key(PG_FUNCTION_ARGS)
if (nrefs < 1)
/* internal error */
elog(ERROR, "check_foreign_key: %d (< 1) number of references specified", nrefs);
action = tolower((unsigned char) *(args[1]));
action = pg_ascii_tolower((unsigned char) *(args[1]));
if (action != 'r' && action != 'c' && action != 's')
/* internal error */
elog(ERROR, "check_foreign_key: invalid action %s", args[1]);
Expand Down
28 changes: 27 additions & 1 deletion doc/src/sgml/func.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -27704,6 +27704,31 @@ acl | {postgres=arwdDxtm/postgres,foo=r/postgres}
details.
</para></entry>
</row>

<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
<primary>pg_get_multixact_members</primary>
</indexterm>
<function>pg_get_multixact_members</function> ( <parameter>multixid</parameter> <type>xid</type> )
<returnvalue>setof record</returnvalue>
( <parameter>xid</parameter> <type>xid</type>,
<parameter>mode</parameter> <type>text</type> )
</para>
<para>
Returns the transaction ID and lock mode for each member of the
specified multixact ID. The lock modes <literal>forupd</literal>,
<literal>fornokeyupd</literal>, <literal>sh</literal>, and
<literal>keysh</literal> correspond to the row-level locks
<literal>FOR UPDATE</literal>, <literal>FOR NO KEY UPDATE</literal>,
<literal>FOR SHARE</literal>, and <literal>FOR KEY SHARE</literal>,
respectively, as described in <xref linkend="locking-rows"/>. Two
additional modes are specific to multixacts:
<literal>nokeyupd</literal>, used by updates that do not modify key
columns, and <literal>upd</literal>, used by updates or deletes that
modify key columns.
</para></entry>
</row>
</tbody>
</tgroup>
</table>
Expand All @@ -27712,7 +27737,8 @@ acl | {postgres=arwdDxtm/postgres,foo=r/postgres}
The internal transaction ID type <type>xid</type> is 32 bits wide and
wraps around every 4 billion transactions. However,
the functions shown in <xref linkend="functions-pg-snapshot"/>, except
<function>age</function> and <function>mxid_age</function>, use a
<function>age</function>, <function>mxid_age</function>, and
<function>pg_get_multixact_members</function>, use a
64-bit type <type>xid8</type> that does not wrap around during the life
of an installation and can be converted to <type>xid</type> by casting if
required; see <xref linkend="transaction-id"/> for details.
Expand Down
5 changes: 4 additions & 1 deletion doc/src/sgml/maintenance.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,10 @@ HINT: Execute a database-wide VACUUM in that database.
careful aging management, storage cleanup, and wraparound handling.
There is a separate storage area which holds the list of members in
each multixact, which also uses a 32-bit counter and which must also
be managed.
be managed. The system function
<function>pg_get_multixact_members()</function> described in
<xref linkend="functions-pg-snapshot"/> can be used to examine the
transaction IDs associated with a multixact ID.
</para>

<para>
Expand Down
2 changes: 1 addition & 1 deletion src/backend/commands/copyfromparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ GetDecimalFromHex(char hex)
if (isdigit((unsigned char) hex))
return hex - '0';
else
return tolower((unsigned char) hex) - 'a' + 10;
return pg_ascii_tolower((unsigned char) hex) - 'a' + 10;
}

/*
Expand Down
12 changes: 6 additions & 6 deletions src/backend/postmaster/pgarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,15 +718,15 @@ pgarch_readyXlog(char *xlog)
/*
* Store the file in our max-heap if it has a high enough priority.
*/
if (arch_files->arch_heap->bh_size < NUM_FILES_PER_DIRECTORY_SCAN)
if (binaryheap_size(arch_files->arch_heap) < NUM_FILES_PER_DIRECTORY_SCAN)
{
/* If the heap isn't full yet, quickly add it. */
arch_file = arch_files->arch_filenames[arch_files->arch_heap->bh_size];
arch_file = arch_files->arch_filenames[binaryheap_size(arch_files->arch_heap)];
strcpy(arch_file, basename);
binaryheap_add_unordered(arch_files->arch_heap, CStringGetDatum(arch_file));

/* If we just filled the heap, make it a valid one. */
if (arch_files->arch_heap->bh_size == NUM_FILES_PER_DIRECTORY_SCAN)
if (binaryheap_size(arch_files->arch_heap) == NUM_FILES_PER_DIRECTORY_SCAN)
binaryheap_build(arch_files->arch_heap);
}
else if (ready_file_comparator(binaryheap_first(arch_files->arch_heap),
Expand All @@ -744,21 +744,21 @@ pgarch_readyXlog(char *xlog)
FreeDir(rldir);

/* If no files were found, simply return. */
if (arch_files->arch_heap->bh_size == 0)
if (binaryheap_empty(arch_files->arch_heap))
return false;

/*
* If we didn't fill the heap, we didn't make it a valid one. Do that
* now.
*/
if (arch_files->arch_heap->bh_size < NUM_FILES_PER_DIRECTORY_SCAN)
if (binaryheap_size(arch_files->arch_heap) < NUM_FILES_PER_DIRECTORY_SCAN)
binaryheap_build(arch_files->arch_heap);

/*
* Fill arch_files array with the files to archive in ascending order of
* priority.
*/
arch_files->arch_files_size = arch_files->arch_heap->bh_size;
arch_files->arch_files_size = binaryheap_size(arch_files->arch_heap);
for (int i = 0; i < arch_files->arch_files_size; i++)
arch_files->arch_files[i] = DatumGetCString(binaryheap_remove_first(arch_files->arch_heap));

Expand Down
Loading