pgsql: Don't use Perl pack('Q') in 039_end_of_wal.pl.

2023-09-22 Thread Thomas Munro
Don't use Perl pack('Q') in 039_end_of_wal.pl. 'Q' for 64 bit integers turns out not to work on 32 bit Perl, as revealed by the build farm. Use 'II' instead, and deal with endianness. Back-patch to 12, like bae868ca. Discussion: https://postgr.es/m/ZQ4r1vHcryBsSi_V%40paquier.xyz Branch --

pgsql: Don't use Perl pack('Q') in 039_end_of_wal.pl.

2023-09-22 Thread Thomas Munro
Don't use Perl pack('Q') in 039_end_of_wal.pl. 'Q' for 64 bit integers turns out not to work on 32 bit Perl, as revealed by the build farm. Use 'II' instead, and deal with endianness. Back-patch to 12, like bae868ca. Discussion: https://postgr.es/m/ZQ4r1vHcryBsSi_V%40paquier.xyz Branch --

pgsql: Don't use Perl pack('Q') in 039_end_of_wal.pl.

2023-09-22 Thread Thomas Munro
Don't use Perl pack('Q') in 039_end_of_wal.pl. 'Q' for 64 bit integers turns out not to work on 32 bit Perl, as revealed by the build farm. Use 'II' instead, and deal with endianness. Back-patch to 12, like bae868ca. Discussion: https://postgr.es/m/ZQ4r1vHcryBsSi_V%40paquier.xyz Branch --

pgsql: Don't use Perl pack('Q') in 039_end_of_wal.pl.

2023-09-22 Thread Thomas Munro
Don't use Perl pack('Q') in 039_end_of_wal.pl. 'Q' for 64 bit integers turns out not to work on 32 bit Perl, as revealed by the build farm. Use 'II' instead, and deal with endianness. Back-patch to 12, like bae868ca. Discussion: https://postgr.es/m/ZQ4r1vHcryBsSi_V%40paquier.xyz Branch --

pgsql: Don't use Perl pack('Q') in 039_end_of_wal.pl.

2023-09-22 Thread Thomas Munro
Don't use Perl pack('Q') in 039_end_of_wal.pl. 'Q' for 64 bit integers turns out not to work on 32 bit Perl, as revealed by the build farm. Use 'II' instead, and deal with endianness. Back-patch to 12, like bae868ca. Discussion: https://postgr.es/m/ZQ4r1vHcryBsSi_V%40paquier.xyz Branch --

pgsql: Don't use Perl pack('Q') in 039_end_of_wal.pl.

2023-09-22 Thread Thomas Munro
Don't use Perl pack('Q') in 039_end_of_wal.pl. 'Q' for 64 bit integers turns out not to work on 32 bit Perl, as revealed by the build farm. Use 'II' instead, and deal with endianness. Back-patch to 12, like bae868ca. Discussion: https://postgr.es/m/ZQ4r1vHcryBsSi_V%40paquier.xyz Branch --

pgsql: Don't trust unvalidated xl_tot_len.

2023-09-22 Thread Thomas Munro
Don't trust unvalidated xl_tot_len. xl_tot_len comes first in a WAL record. Usually we don't trust it to be the true length until we've validated the record header. If the record header was split across two pages, previously we wouldn't do the validation until after we'd already tried to allocat

pgsql: Don't trust unvalidated xl_tot_len.

2023-09-22 Thread Thomas Munro
Don't trust unvalidated xl_tot_len. xl_tot_len comes first in a WAL record. Usually we don't trust it to be the true length until we've validated the record header. If the record header was split across two pages, previously we wouldn't do the validation until after we'd already tried to allocat

pgsql: Don't trust unvalidated xl_tot_len.

2023-09-22 Thread Thomas Munro
Don't trust unvalidated xl_tot_len. xl_tot_len comes first in a WAL record. Usually we don't trust it to be the true length until we've validated the record header. If the record header was split across two pages, previously we wouldn't do the validation until after we'd already tried to allocat

pgsql: Don't trust unvalidated xl_tot_len.

2023-09-22 Thread Thomas Munro
Don't trust unvalidated xl_tot_len. xl_tot_len comes first in a WAL record. Usually we don't trust it to be the true length until we've validated the record header. If the record header was split across two pages, previously we wouldn't do the validation until after we'd already tried to allocat

pgsql: Don't trust unvalidated xl_tot_len.

2023-09-22 Thread Thomas Munro
Don't trust unvalidated xl_tot_len. xl_tot_len comes first in a WAL record. Usually we don't trust it to be the true length until we've validated the record header. If the record header was split across two pages, previously we wouldn't do the validation until after we'd already tried to allocat

pgsql: Don't trust unvalidated xl_tot_len.

2023-09-22 Thread Thomas Munro
Don't trust unvalidated xl_tot_len. xl_tot_len comes first in a WAL record. Usually we don't trust it to be the true length until we've validated the record header. If the record header was split across two pages, previously we wouldn't do the validation until after we'd already tried to allocat

pgsql: Doc: copy-edit the introductory para for the pg_class catalog.

2023-09-22 Thread Tom Lane
Doc: copy-edit the introductory para for the pg_class catalog. The previous wording had a faint archaic whiff to it, and more importantly used "catalogs" as a verb, which while cutely self-referential seems likely to provoke confusion in this particular context. Also consistently use "kind" not "

pgsql: Doc: copy-edit the introductory para for the pg_class catalog.

2023-09-22 Thread Tom Lane
Doc: copy-edit the introductory para for the pg_class catalog. The previous wording had a faint archaic whiff to it, and more importantly used "catalogs" as a verb, which while cutely self-referential seems likely to provoke confusion in this particular context. Also consistently use "kind" not "

pgsql: Doc: copy-edit the introductory para for the pg_class catalog.

2023-09-22 Thread Tom Lane
Doc: copy-edit the introductory para for the pg_class catalog. The previous wording had a faint archaic whiff to it, and more importantly used "catalogs" as a verb, which while cutely self-referential seems likely to provoke confusion in this particular context. Also consistently use "kind" not "

pgsql: Doc: copy-edit the introductory para for the pg_class catalog.

2023-09-22 Thread Tom Lane
Doc: copy-edit the introductory para for the pg_class catalog. The previous wording had a faint archaic whiff to it, and more importantly used "catalogs" as a verb, which while cutely self-referential seems likely to provoke confusion in this particular context. Also consistently use "kind" not "

pgsql: Doc: copy-edit the introductory para for the pg_class catalog.

2023-09-22 Thread Tom Lane
Doc: copy-edit the introductory para for the pg_class catalog. The previous wording had a faint archaic whiff to it, and more importantly used "catalogs" as a verb, which while cutely self-referential seems likely to provoke confusion in this particular context. Also consistently use "kind" not "

pgsql: Doc: copy-edit the introductory para for the pg_class catalog.

2023-09-22 Thread Tom Lane
Doc: copy-edit the introductory para for the pg_class catalog. The previous wording had a faint archaic whiff to it, and more importantly used "catalogs" as a verb, which while cutely self-referential seems likely to provoke confusion in this particular context. Also consistently use "kind" not "

pgsql: Doc: copy-edit the introductory para for the pg_class catalog.

2023-09-22 Thread Tom Lane
Doc: copy-edit the introductory para for the pg_class catalog. The previous wording had a faint archaic whiff to it, and more importantly used "catalogs" as a verb, which while cutely self-referential seems likely to provoke confusion in this particular context. Also consistently use "kind" not "

pgsql: Avoid using internal test methods in SSL tests

2023-09-22 Thread Daniel Gustafsson
Avoid using internal test methods in SSL tests The SSL tests for pg_ctl restart with an incorrect key passphrase used the internal _update_pid method to set the pidfile after running pg_ctl manually instead of using the supplied ->restart method. This refactors the ->restart method to accept a fai

pgsql: Avoid potential pfree on NULL on OpenSSL errors

2023-09-22 Thread Daniel Gustafsson
Avoid potential pfree on NULL on OpenSSL errors Guard against the pointer being NULL before pfreeing upon an error returned from OpenSSL. Also handle errors from X509_NAME_print_ex which also can return -1 on memory allocation errors. Backpatch down to v15 where the code was added. Author: Serg

pgsql: Avoid potential pfree on NULL on OpenSSL errors

2023-09-22 Thread Daniel Gustafsson
Avoid potential pfree on NULL on OpenSSL errors Guard against the pointer being NULL before pfreeing upon an error returned from OpenSSL. Also handle errors from X509_NAME_print_ex which also can return -1 on memory allocation errors. Backpatch down to v15 where the code was added. Author: Serg

pgsql: Avoid potential pfree on NULL on OpenSSL errors

2023-09-22 Thread Daniel Gustafsson
Avoid potential pfree on NULL on OpenSSL errors Guard against the pointer being NULL before pfreeing upon an error returned from OpenSSL. Also handle errors from X509_NAME_print_ex which can return -1 on memory allocation errors. Backpatch down to v15 where the code was added. Author: Sergey Sh