Re: pgsql: xlog.c: Remove global variables ReadRecPtr and EndRecPtr.

2021-11-26 Thread Andres Freund
Hi, On November 26, 2021 5:53:31 PM PST, Andres Freund wrote: >Hi, > >On November 26, 2021 7:24:15 AM PST, Robert Haas wrote: >>Fortunately, it seems to have been only a minor oversight. > Agreed. I wonder if we should turn some of these ifdefs into something boiling down to if (0) { ifdef

pgsql: Harden be-gssapi-common.h for headerscheck

2021-11-26 Thread Alvaro Herrera
Harden be-gssapi-common.h for headerscheck Surround the contents with a test that the feature is enabled by configure, to silence header checking tools on systems without GSSAPI installed. Backpatch to 12, where the file appeared. Discussion: https://postgr.es/m/20261709.u3pbx5lxdimt@alvherr

pgsql: Harden be-gssapi-common.h for headerscheck

2021-11-26 Thread Alvaro Herrera
Harden be-gssapi-common.h for headerscheck Surround the contents with a test that the feature is enabled by configure, to silence header checking tools on systems without GSSAPI installed. Backpatch to 12, where the file appeared. Discussion: https://postgr.es/m/20261709.u3pbx5lxdimt@alvherr

pgsql: Harden be-gssapi-common.h for headerscheck

2021-11-26 Thread Alvaro Herrera
Harden be-gssapi-common.h for headerscheck Surround the contents with a test that the feature is enabled by configure, to silence header checking tools on systems without GSSAPI installed. Backpatch to 12, where the file appeared. Discussion: https://postgr.es/m/20261709.u3pbx5lxdimt@alvherr

pgsql: Harden be-gssapi-common.h for headerscheck

2021-11-26 Thread Alvaro Herrera
Harden be-gssapi-common.h for headerscheck Surround the contents with a test that the feature is enabled by configure, to silence header checking tools on systems without GSSAPI installed. Backpatch to 12, where the file appeared. Discussion: https://postgr.es/m/20261709.u3pbx5lxdimt@alvherr

pgsql: Go back to considering HOT on pages marked full.

2021-11-26 Thread Peter Geoghegan
Go back to considering HOT on pages marked full. Commit 2fd8685e7f simplified the checking of modified attributes that takes place within heap_update(). This included a micro-optimization affecting pages marked PD_PAGE_FULL: don't even try to use HOT to save a few cycles on determining HOT safety

pgsql: Copy-edit vacuuumdb --analyze-in-stages doc blurb

2021-11-26 Thread Alvaro Herrera
Copy-edit vacuuumdb --analyze-in-stages doc blurb I had made a few typos, and Nikolai Berkoff made a wording change suggestion. Discussion: https://postgr.es/m/VMwe7-sGegrQPQ7fJjSCdsEbESKeJFOb6G4DFxxNrf45I7DzHio7sNUH88wWRMnAy5a5G0-FB31dxPM47ldigW6WdiCPncHgqO9bNl6F240=@pm.me Branch -- master

pgsql: Document units for max_slot_wal_keep_size

2021-11-26 Thread Alvaro Herrera
Document units for max_slot_wal_keep_size The doc blurb failed to mention units, as well as lacking the point about changeability. Backpatch to 13. Reviewed-by: Kyotaro Horiguchi Reported by: [email protected] Discussion: https://postgr.es/m/[email protected]

pgsql: Document units for max_slot_wal_keep_size

2021-11-26 Thread Alvaro Herrera
Document units for max_slot_wal_keep_size The doc blurb failed to mention units, as well as lacking the point about changeability. Backpatch to 13. Reviewed-by: Kyotaro Horiguchi Reported by: [email protected] Discussion: https://postgr.es/m/[email protected]

pgsql: Document units for max_slot_wal_keep_size

2021-11-26 Thread Alvaro Herrera
Document units for max_slot_wal_keep_size The doc blurb failed to mention units, as well as lacking the point about changeability. Backpatch to 13. Reviewed-by: Kyotaro Horiguchi Reported by: [email protected] Discussion: https://postgr.es/m/[email protected]

pgsql: Fix determination of broken LSN in OVERWRITTEN_CONTRECORD

2021-11-26 Thread Alvaro Herrera
Fix determination of broken LSN in OVERWRITTEN_CONTRECORD In commit ff9f111bce24 I mixed up inconsistent definitions of the LSN of the first record in a page, when the previous record ends exactly at the page boundary. The correct LSN is adjusted to skip the WAL page header; I failed to use that

pgsql: Fix determination of broken LSN in OVERWRITTEN_CONTRECORD

2021-11-26 Thread Alvaro Herrera
Fix determination of broken LSN in OVERWRITTEN_CONTRECORD In commit ff9f111bce24 I mixed up inconsistent definitions of the LSN of the first record in a page, when the previous record ends exactly at the page boundary. The correct LSN is adjusted to skip the WAL page header; I failed to use that

pgsql: Fix determination of broken LSN in OVERWRITTEN_CONTRECORD

2021-11-26 Thread Alvaro Herrera
Fix determination of broken LSN in OVERWRITTEN_CONTRECORD In commit ff9f111bce24 I mixed up inconsistent definitions of the LSN of the first record in a page, when the previous record ends exactly at the page boundary. The correct LSN is adjusted to skip the WAL page header; I failed to use that

pgsql: Fix determination of broken LSN in OVERWRITTEN_CONTRECORD

2021-11-26 Thread Alvaro Herrera
Fix determination of broken LSN in OVERWRITTEN_CONTRECORD In commit ff9f111bce24 I mixed up inconsistent definitions of the LSN of the first record in a page, when the previous record ends exactly at the page boundary. The correct LSN is adjusted to skip the WAL page header; I failed to use that

pgsql: Fix determination of broken LSN in OVERWRITTEN_CONTRECORD

2021-11-26 Thread Alvaro Herrera
Fix determination of broken LSN in OVERWRITTEN_CONTRECORD In commit ff9f111bce24 I mixed up inconsistent definitions of the LSN of the first record in a page, when the previous record ends exactly at the page boundary. The correct LSN is adjusted to skip the WAL page header; I failed to use that

pgsql: Fix determination of broken LSN in OVERWRITTEN_CONTRECORD

2021-11-26 Thread Alvaro Herrera
Fix determination of broken LSN in OVERWRITTEN_CONTRECORD In commit ff9f111bce24 I mixed up inconsistent definitions of the LSN of the first record in a page, when the previous record ends exactly at the page boundary. The correct LSN is adjusted to skip the WAL page header; I failed to use that

Re: pgsql: xlog.c: Remove global variables ReadRecPtr and EndRecPtr.

2021-11-26 Thread Robert Haas
On Thu, Nov 25, 2021 at 11:02 PM Tom Lane wrote: > Robert Haas writes: > > On Wed, Nov 24, 2021 at 8:01 PM Andres Freund wrote: > >> Pushed the obvious fix for that. Somehow thought I'd seen more compile > >> failure > >> than the one WAL_DEBUG... > > > Hmm, thanks. I guess i put too much trust

pgsql: Fix GRANTED BY support in REVOKE ROLE statements

2021-11-26 Thread Daniel Gustafsson
Fix GRANTED BY support in REVOKE ROLE statements Commit 676bb added support for the GRANTED BY clause in GRANT and REVOKE statements, but missed adding support for checking the role in the REVOKE ROLE case. Fix by checking that the parsed role matches the CURRENT_ROLE/CURRENT_USER requirement,

pgsql: Add test for REVOKE ADMIN OPTION

2021-11-26 Thread Daniel Gustafsson
Add test for REVOKE ADMIN OPTION The REVOKE ADMIN OPTION FOR syntax didn't have ample test coverage. Fix by adding coverage in the privileges test suite. Author: Mark Dilger Discussion: https://postgr.es/m/[email protected] Branch -- master Details ---

pgsql: Fix GRANTED BY support in REVOKE ROLE statements

2021-11-26 Thread Daniel Gustafsson
Fix GRANTED BY support in REVOKE ROLE statements Commit 676bb added support for the GRANTED BY clause in GRANT and REVOKE statements, but missed adding support for checking the role in the REVOKE ROLE case. Fix by checking that the parsed role matches the CURRENT_ROLE/CURRENT_USER requirement,

pgsql: Update comments

2021-11-26 Thread Peter Eisentraut
Update comments Various places wanted to point out that tuple descriptors don't contain the variable-length fields of pg_attribute. This started when attacl was added, but more fields have been added since, and these comments haven't been kept up to date consistently. Reword so that the purpose