Re: pgsql: Fix our Windows stat() emulation to handle file sizes > 4GB.

2024-11-08 Thread Thomas Munro
On Sat, Nov 9, 2024 at 9:30 AM Andrew Dunstan wrote: > My impression was that this was something we just didn't get around to. I > wouldn't have pushed these so close to release if this hadn't been code > already tested for a long time in release 16+. Maybe we missed something, but > I doubt it

pgsql: Fix sign-compare warnings in pg_iovec.h.

2024-11-08 Thread Nathan Bossart
Fix sign-compare warnings in pg_iovec.h. The code in question (pg_preadv() and pg_pwritev()) has been around for a while, but commit 15c9ac3629 moved it to a header file. If third-party code that includes this header file is built with -Wsign-compare on a system without preadv() or pwritev(), war

pgsql: Fix sign-compare warnings in pg_iovec.h.

2024-11-08 Thread Nathan Bossart
Fix sign-compare warnings in pg_iovec.h. The code in question (pg_preadv() and pg_pwritev()) has been around for a while, but commit 15c9ac3629 moved it to a header file. If third-party code that includes this header file is built with -Wsign-compare on a system without preadv() or pwritev(), war

pgsql: First-draft release notes for 17.1.

2024-11-08 Thread Tom Lane
First-draft release notes for 17.1. (We lack a query for identifying broken foreign keys in the first changelog item, but the rest of this is in reviewable shape.) As usual, the release notes for other branches will be made by cutting these down, but put them up for community review first. Also

pgsql: Assert consistency of currPage that ended scan.

2024-11-08 Thread Peter Geoghegan
Assert consistency of currPage that ended scan. When _bt_readnextpage is called with our nbtree parallel scan already seized (i.e. when it is directly called by _bt_first), we never expect a prior call to _bt_readpage for lastcurrblkno to already indicate that the scan should end -- the _bt_first

Re: pgsql: Fix our Windows stat() emulation to handle file sizes > 4GB.

2024-11-08 Thread Andrew Dunstan
On Sat, Nov 9, 2024 at 2:33 AM Tom Lane wrote: > Robert Haas writes: > > On Thu, Nov 7, 2024 at 6:19 PM Andrew Dunstan > wrote: > >> Juan José Santamaría Flecha, reviewed by Emil Iggland; > >> based on prior work by Michael Paquier, Sergey Zubkovsky, and others > >> > >> Author: Alexandra Wang

Re: pgsql: Fix our Windows stat() emulation to handle file sizes > 4GB.

2024-11-08 Thread Andrew Dunstan
On Sat, Nov 9, 2024 at 6:11 AM Tom Lane wrote: > I wrote: > > I'm also confused about how to document them in the release notes. > > Alexandra should get some credit I guess for collecting and testing > > the patches, but she's not the original author(s). > > After thinking for awhile, I'm going

pgsql: Move check for USE_AVX512_POPCNT_WITH_RUNTIME_CHECK.

2024-11-08 Thread Nathan Bossart
Move check for USE_AVX512_POPCNT_WITH_RUNTIME_CHECK. Unlike TRY_POPCNT_FAST, which is defined in pg_bitutils.h, this macro is defined in c.h (via pg_config.h), so we can check for it earlier and avoid some unnecessary #includes on systems that lack AVX-512 support. Oversight in commit f78667bd91.

Re: pgsql: Fix our Windows stat() emulation to handle file sizes > 4GB.

2024-11-08 Thread Tom Lane
I wrote: > I'm also confused about how to document them in the release notes. > Alexandra should get some credit I guess for collecting and testing > the patches, but she's not the original author(s). After thinking for awhile, I'm going to fold all of these into one release-note entry:

pgsql: Improve fix for not entering parallel mode when holding interrup

2024-11-08 Thread Tom Lane
Improve fix for not entering parallel mode when holding interrupts. Commit ac04aa84a put the shutoff for this into the planner, which is not ideal because it doesn't prevent us from re-using a previously made parallel plan. Revert the planner change and instead put the shutoff into InitializePara

pgsql: Improve fix for not entering parallel mode when holding interrup

2024-11-08 Thread Tom Lane
Improve fix for not entering parallel mode when holding interrupts. Commit ac04aa84a put the shutoff for this into the planner, which is not ideal because it doesn't prevent us from re-using a previously made parallel plan. Revert the planner change and instead put the shutoff into InitializePara

pgsql: Improve fix for not entering parallel mode when holding interrup

2024-11-08 Thread Tom Lane
Improve fix for not entering parallel mode when holding interrupts. Commit ac04aa84a put the shutoff for this into the planner, which is not ideal because it doesn't prevent us from re-using a previously made parallel plan. Revert the planner change and instead put the shutoff into InitializePara

pgsql: Improve fix for not entering parallel mode when holding interrup

2024-11-08 Thread Tom Lane
Improve fix for not entering parallel mode when holding interrupts. Commit ac04aa84a put the shutoff for this into the planner, which is not ideal because it doesn't prevent us from re-using a previously made parallel plan. Revert the planner change and instead put the shutoff into InitializePara

pgsql: Improve fix for not entering parallel mode when holding interrup

2024-11-08 Thread Tom Lane
Improve fix for not entering parallel mode when holding interrupts. Commit ac04aa84a put the shutoff for this into the planner, which is not ideal because it doesn't prevent us from re-using a previously made parallel plan. Revert the planner change and instead put the shutoff into InitializePara

pgsql: Improve fix for not entering parallel mode when holding interrup

2024-11-08 Thread Tom Lane
Improve fix for not entering parallel mode when holding interrupts. Commit ac04aa84a put the shutoff for this into the planner, which is not ideal because it doesn't prevent us from re-using a previously made parallel plan. Revert the planner change and instead put the shutoff into InitializePara

pgsql: Improve fix for not entering parallel mode when holding interrup

2024-11-08 Thread Tom Lane
Improve fix for not entering parallel mode when holding interrupts. Commit ac04aa84a put the shutoff for this into the planner, which is not ideal because it doesn't prevent us from re-using a previously made parallel plan. Revert the planner change and instead put the shutoff into InitializePara

pgsql: Avoid nbtree parallel scan currPos confusion.

2024-11-08 Thread Peter Geoghegan
Avoid nbtree parallel scan currPos confusion. Commit 1bd4bc85, which refactored nbtree sibling link traversal, made _bt_parallel_seize reset the scan's currPos so that things were consistent with the state of a serial backend moving between pages. This overlooked the fact that _bt_readnextpage rel

Re: pgsql: Fix our Windows stat() emulation to handle file sizes > 4GB.

2024-11-08 Thread Tom Lane
Robert Haas writes: > On Thu, Nov 7, 2024 at 6:19 PM Andrew Dunstan wrote: >> Juan José Santamaría Flecha, reviewed by Emil Iggland; >> based on prior work by Michael Paquier, Sergey Zubkovsky, and others >> >> Author: Alexandra Wang > This authorship information is confusing. Yes. Worse, th

Re: pgsql: Fix our Windows stat() emulation to handle file sizes > 4GB.

2024-11-08 Thread Robert Haas
On Thu, Nov 7, 2024 at 6:19 PM Andrew Dunstan wrote: > Juan José Santamaría Flecha, reviewed by Emil Iggland; > based on prior work by Michael Paquier, Sergey Zubkovsky, and others > > Author: Alexandra Wang This authorship information is confusing. -- Robert Haas EDB: http://www.enterprisedb.

pgsql: Add pg_constraint rows for not-null constraints

2024-11-08 Thread Álvaro Herrera
Add pg_constraint rows for not-null constraints We now create contype='n' pg_constraint rows for not-null constraints on user tables. Only one such constraint is allowed for a column. We propagate these constraints to other tables during operations such as adding inheritance relationships, creat

pgsql: Disallow partitionwise join when collations don't match

2024-11-08 Thread Amit Langote
Disallow partitionwise join when collations don't match If the collation of any join key column doesn’t match the collation of the corresponding partition key, partitionwise joins can yield incorrect results. For example, rows that would match under the join key collation might be located in diffe

pgsql: Disallow partitionwise join when collations don't match

2024-11-08 Thread Amit Langote
Disallow partitionwise join when collations don't match If the collation of any join key column doesn’t match the collation of the corresponding partition key, partitionwise joins can yield incorrect results. For example, rows that would match under the join key collation might be located in diffe

pgsql: Disallow partitionwise join when collations don't match

2024-11-08 Thread Amit Langote
Disallow partitionwise join when collations don't match If the collation of any join key column doesn’t match the collation of the corresponding partition key, partitionwise joins can yield incorrect results. For example, rows that would match under the join key collation might be located in diffe

pgsql: Disallow partitionwise join when collations don't match

2024-11-08 Thread Amit Langote
Disallow partitionwise join when collations don't match If the collation of any join key column doesn’t match the collation of the corresponding partition key, partitionwise joins can yield incorrect results. For example, rows that would match under the join key collation might be located in diffe

pgsql: Disallow partitionwise join when collations don't match

2024-11-08 Thread Amit Langote
Disallow partitionwise join when collations don't match If the collation of any join key column doesn’t match the collation of the corresponding partition key, partitionwise joins can yield incorrect results. For example, rows that would match under the join key collation might be located in diffe

pgsql: Disallow partitionwise join when collations don't match

2024-11-08 Thread Amit Langote
Disallow partitionwise join when collations don't match If the collation of any join key column doesn’t match the collation of the corresponding partition key, partitionwise joins can yield incorrect results. For example, rows that would match under the join key collation might be located in diffe

pgsql: Disallow partitionwise join when collations don't match

2024-11-08 Thread Amit Langote
Disallow partitionwise join when collations don't match If the collation of any join key column doesn’t match the collation of the corresponding partition key, partitionwise joins can yield incorrect results. For example, rows that would match under the join key collation might be located in diffe