pgsql: Fix inappropriate uses of atol()

2024-08-09 Thread Peter Eisentraut
Fix inappropriate uses of atol() Some code using atol() would not work correctly if sizeof(long)==4: - src/bin/pg_basebackup/pg_basebackup.c: Would miscount size of a tablespace over 2 TB. - src/bin/pg_basebackup/streamutil.c: Would truncate a timeline ID beyond INT32_MAX. - src/bin/pg_rewi

pgsql: libpq: Trace StartupMessage/SSLRequest/GSSENCRequest correctly

2024-08-09 Thread Alvaro Herrera
libpq: Trace StartupMessage/SSLRequest/GSSENCRequest correctly libpq tracing via PQtrace would uselessly print the wrong thing for these types of messages. With this commit, their type and contents would be correctly listed. (This can be verified with PQconnectStart(), but we don't use that in l

pgsql: Fix comment on processes being kept over a restart

2024-08-09 Thread Heikki Linnakangas
Fix comment on processes being kept over a restart All child processes except the syslogger are killed on a restart. The archiver might be already running though, if it was started during recovery. The split in the comments between "other special children" and the first group of "background tasks

pgsql: Refactor code to handle death of a backend or bgworker in postma

2024-08-09 Thread Heikki Linnakangas
Refactor code to handle death of a backend or bgworker in postmaster Currently, when a child process exits, the postmaster first scans through BackgroundWorkerList, to see if it the child process was a background worker. If not found, then it scans through BackendList to see if it was a regular ba

pgsql: Make BackgroundWorkerList doubly-linked

2024-08-09 Thread Heikki Linnakangas
Make BackgroundWorkerList doubly-linked This allows ForgetBackgroundWorker() and ReportBackgroundWorkerExit() to take a RegisteredBgWorker pointer as argument, rather than a list iterator. That feels a little more natural. But more importantly, this paves the way for more refactoring in the next c

pgsql: doc: Standardize use of dashes in references to CRC and SHA.

2024-08-09 Thread Nathan Bossart
doc: Standardize use of dashes in references to CRC and SHA. Presently, we inconsistently use dashes in references to these algorithms (e.g., CRC32C versus CRC-32C). Some popular web sources appear to prefer dashes, and with this commit, we will, too. Reviewed-by: Robert Haas Discussion: https:/

pgsql: Last-minute updates for release notes.

2024-08-09 Thread Tom Lane
Last-minute updates for release notes. Security: CVE-2024-7348 Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c04778592d6db6197819f95028347af135709e4b Modified Files -- doc/src/sgml/release-16.sgml | 39 +++ 1

pgsql: Restrict accesses to non-system views and foreign tables during

2024-08-09 Thread Masahiko Sawada
Restrict accesses to non-system views and foreign tables during pg_dump. When pg_dump retrieves the list of database objects and performs the data dump, there was possibility that objects are replaced with others of the same name, such as views, and access them. This vulnerability could result in

pgsql: Last-minute updates for release notes.

2024-08-09 Thread Tom Lane
Last-minute updates for release notes. Security: CVE-2024-7348 Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/6eca8a5673307ce52f892f083df0b958d35f09e1 Modified Files -- doc/src/sgml/release-15.sgml | 39 +++ 1

pgsql: Last-minute updates for release notes.

2024-08-09 Thread Tom Lane
Last-minute updates for release notes. Security: CVE-2024-7348 Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/1b85e65846aa16ede7aeddd67a9bd16ec73a18ae Modified Files -- doc/src/sgml/release-12.sgml | 39 +++ 1

pgsql: Restrict accesses to non-system views and foreign tables during

2024-08-09 Thread Masahiko Sawada
Restrict accesses to non-system views and foreign tables during pg_dump. When pg_dump retrieves the list of database objects and performs the data dump, there was possibility that objects are replaced with others of the same name, such as views, and access them. This vulnerability could result in

pgsql: Last-minute updates for release notes.

2024-08-09 Thread Tom Lane
Last-minute updates for release notes. Security: CVE-2024-7348 Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/429560193282f2c29a1bb9f28a055c87b7605253 Modified Files -- doc/src/sgml/release-13.sgml | 39 +++ 1

pgsql: Last-minute updates for release notes.

2024-08-09 Thread Tom Lane
Last-minute updates for release notes. Security: CVE-2024-7348 Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/b942cc42b7c659da70c205151bde5e1f9af2ece0 Modified Files -- doc/src/sgml/release-14.sgml | 39 +++ 1

pgsql: Restrict accesses to non-system views and foreign tables during

2024-08-09 Thread Masahiko Sawada
Restrict accesses to non-system views and foreign tables during pg_dump. When pg_dump retrieves the list of database objects and performs the data dump, there was possibility that objects are replaced with others of the same name, such as views, and access them. This vulnerability could result in

pgsql: Restrict accesses to non-system views and foreign tables during

2024-08-09 Thread Masahiko Sawada
Restrict accesses to non-system views and foreign tables during pg_dump. When pg_dump retrieves the list of database objects and performs the data dump, there was possibility that objects are replaced with others of the same name, such as views, and access them. This vulnerability could result in

pgsql: Restrict accesses to non-system views and foreign tables during

2024-08-09 Thread Masahiko Sawada
Restrict accesses to non-system views and foreign tables during pg_dump. When pg_dump retrieves the list of database objects and performs the data dump, there was possibility that objects are replaced with others of the same name, such as views, and access them. This vulnerability could result in

pgsql: Restrict accesses to non-system views and foreign tables during

2024-08-09 Thread Masahiko Sawada
Restrict accesses to non-system views and foreign tables during pg_dump. When pg_dump retrieves the list of database objects and performs the data dump, there was possibility that objects are replaced with others of the same name, such as views, and access them. This vulnerability could result in

pgsql: Restrict accesses to non-system views and foreign tables during

2024-08-09 Thread Masahiko Sawada
Restrict accesses to non-system views and foreign tables during pg_dump. When pg_dump retrieves the list of database objects and performs the data dump, there was possibility that objects are replaced with others of the same name, such as views, and access them. This vulnerability could result in

pgsql: doc: Fix name of CRC algorithm in "Reliability" section.

2024-08-09 Thread Nathan Bossart
doc: Fix name of CRC algorithm in "Reliability" section. This section claims we use CRC-32 for WAL records and two-phase state files, but we've actually used CRC-32C since v9.5 (commit 5028f22f6e). Fix that. Reviewed-by: Robert Haas Discussion: https://postgr.es/m/ZrUFpLP-w2zTAHqq%40nathan Backp

pgsql: doc: Fix name of CRC algorithm in "Reliability" section.

2024-08-09 Thread Nathan Bossart
doc: Fix name of CRC algorithm in "Reliability" section. This section claims we use CRC-32 for WAL records and two-phase state files, but we've actually used CRC-32C since v9.5 (commit 5028f22f6e). Fix that. Reviewed-by: Robert Haas Discussion: https://postgr.es/m/ZrUFpLP-w2zTAHqq%40nathan Backp

pgsql: doc: Fix name of CRC algorithm in "Reliability" section.

2024-08-09 Thread Nathan Bossart
doc: Fix name of CRC algorithm in "Reliability" section. This section claims we use CRC-32 for WAL records and two-phase state files, but we've actually used CRC-32C since v9.5 (commit 5028f22f6e). Fix that. Reviewed-by: Robert Haas Discussion: https://postgr.es/m/ZrUFpLP-w2zTAHqq%40nathan Backp

pgsql: doc: Fix name of CRC algorithm in "Reliability" section.

2024-08-09 Thread Nathan Bossart
doc: Fix name of CRC algorithm in "Reliability" section. This section claims we use CRC-32 for WAL records and two-phase state files, but we've actually used CRC-32C since v9.5 (commit 5028f22f6e). Fix that. Reviewed-by: Robert Haas Discussion: https://postgr.es/m/ZrUFpLP-w2zTAHqq%40nathan Backp

pgsql: doc: Fix name of CRC algorithm in "Reliability" section.

2024-08-09 Thread Nathan Bossart
doc: Fix name of CRC algorithm in "Reliability" section. This section claims we use CRC-32 for WAL records and two-phase state files, but we've actually used CRC-32C since v9.5 (commit 5028f22f6e). Fix that. Reviewed-by: Robert Haas Discussion: https://postgr.es/m/ZrUFpLP-w2zTAHqq%40nathan Backp

pgsql: doc: Fix name of CRC algorithm in "Reliability" section.

2024-08-09 Thread Nathan Bossart
doc: Fix name of CRC algorithm in "Reliability" section. This section claims we use CRC-32 for WAL records and two-phase state files, but we've actually used CRC-32C since v9.5 (commit 5028f22f6e). Fix that. Reviewed-by: Robert Haas Discussion: https://postgr.es/m/ZrUFpLP-w2zTAHqq%40nathan Backp

pgsql: doc: Fix name of CRC algorithm in "Reliability" section.

2024-08-09 Thread Nathan Bossart
doc: Fix name of CRC algorithm in "Reliability" section. This section claims we use CRC-32 for WAL records and two-phase state files, but we've actually used CRC-32C since v9.5 (commit 5028f22f6e). Fix that. Reviewed-by: Robert Haas Discussion: https://postgr.es/m/ZrUFpLP-w2zTAHqq%40nathan Backp

pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN.

2024-08-09 Thread Tom Lane
Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has be

pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN.

2024-08-09 Thread Tom Lane
Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has be

pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN.

2024-08-09 Thread Tom Lane
Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has be

pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN.

2024-08-09 Thread Tom Lane
Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has be

pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN.

2024-08-09 Thread Tom Lane
Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has be

pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN.

2024-08-09 Thread Tom Lane
Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has be

pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN.

2024-08-09 Thread Tom Lane
Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has be

Re: pgsql: Fix more holes with SLRU code in need of int64 for segment numbe

2024-08-09 Thread Peter Eisentraut
On 08.08.24 01:15, Michael Paquier wrote:  On Aug 8, 2024, at 5:05, Alexander Korotkov wrote: On Wed, Aug 7, 2024 at 10:52 PM Peter Eisentraut wrote: It looks like the commit I'm talking about here is a subset of v55-0001 from that thread? Yes, looks like this. So why is some of this be