pgsql: Improve tests of date_trunc() with infinity and unsupported unit

2025-08-06 Thread Michael Paquier
Improve tests of date_trunc() with infinity and unsupported units Commit d85ce012f99f has added some new error handling code to date_trunc() of timestamp, timestamptz, and interval with infinite values. However, the new test cases added by that commit did not actually test all of the new code, mi

pgsql: Improve tests of date_trunc() with infinity and unsupported unit

2025-08-06 Thread Michael Paquier
Improve tests of date_trunc() with infinity and unsupported units Commit d85ce012f99f has added some new error handling code to date_trunc() of timestamp, timestamptz, and interval with infinite values. However, the new test cases added by that commit did not actually test all of the new code, mi

pgsql: Fix incorrect Datum conversion in timestamptz_trunc_internal()

2025-08-06 Thread Michael Paquier
Fix incorrect Datum conversion in timestamptz_trunc_internal() The code used a PG_RETURN_TIMESTAMPTZ() where the return type is TimestampTz and not a Datum. On 64-bit systems, there is no effect since this just ends up casting 64-bit integers back and forth. On 32-bit systems, timestamptz is pas

pgsql: Fix incorrect Datum conversion in timestamptz_trunc_internal()

2025-08-06 Thread Michael Paquier
Fix incorrect Datum conversion in timestamptz_trunc_internal() The code used a PG_RETURN_TIMESTAMPTZ() where the return type is TimestampTz and not a Datum. On 64-bit systems, there is no effect since this just ends up casting 64-bit integers back and forth. On 32-bit systems, timestamptz is pas

pgsql: Expand usage of macros for protocol characters.

2025-08-06 Thread Nathan Bossart
Expand usage of macros for protocol characters. This commit makes use of the existing PqMsg_* macros in more places and adds new PqReplMsg_* and PqBackupMsg_* macros for use in special replication and backup messages, respectively. Author: Dave Cramer Co-authored-by: Fabrízio de Royes Mello Rev

pgsql: Rename transformRelOptions()'s "namspace" parameter to "nameSpac

2025-08-06 Thread Nathan Bossart
Rename transformRelOptions()'s "namspace" parameter to "nameSpace". The name "namspace" looks like a typo, but it was presumably meant to avoid using the "namespace" C++ keyword. This commit renames the parameter to "nameSpace" to prevent future confusion while still avoiding the keyword. Review

pgsql: Fix typo in comment.

2025-08-06 Thread Fujii Masao
Fix typo in comment. Author: Chao Li Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/99139c46cbf2bda7880592c4e5da1ebf177888ac Modified Files -- sr

pgsql: Refactor int128.h, bringing the native and non-native code toget

2025-08-06 Thread Dean Rasheed
Refactor int128.h, bringing the native and non-native code together. This rearranges the code in src/include/common/int128.h, so that the native and non-native implementations of each function are together inside the function body (as they are in src/include/common/int.h), rather than being in sep

pgsql: Fix printf format specfiers in test_int128 module.

2025-08-06 Thread Dean Rasheed
Fix printf format specfiers in test_int128 module. Compiler warnings introduced by 8c7445a0081. Author: Dean Rasheed Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/811633105a38bc40ff2f75879a4b9a1113bb0347 Modified Files -- src/test/modules/test_int12

pgsql: Remove INT64_HEX_FORMAT and UINT64_HEX_FORMAT

2025-08-06 Thread Peter Eisentraut
Remove INT64_HEX_FORMAT and UINT64_HEX_FORMAT These were introduced (commit efdc7d74753) at the same time as we were moving to using the standard inttypes.h format macros (commit a0ed19e0a9e). It doesn't seem useful to keep a new already-deprecated interface like this with only a few users, so re

pgsql: Remove INT64_HEX_FORMAT and UINT64_HEX_FORMAT

2025-08-06 Thread Peter Eisentraut
Remove INT64_HEX_FORMAT and UINT64_HEX_FORMAT These were introduced (commit efdc7d74753) at the same time as we were moving to using the standard inttypes.h format macros (commit a0ed19e0a9e). It doesn't seem useful to keep a new already-deprecated interface like this with only a few users, so re

pgsql: Convert src/tools/testint128.c into a test module.

2025-08-06 Thread Dean Rasheed
Convert src/tools/testint128.c into a test module. This creates a new test module src/test/modules/test_int128 and moves src/tools/testint128.c into it so that it can be built using the normal build system, allowing the 128-bit integer arithmetic functions in src/include/common/int128.h to be test

pgsql: Add regression test for short varlenas saved in TOAST relations

2025-08-06 Thread Michael Paquier
Add regression test for short varlenas saved in TOAST relations toast_save_datum() has for a very long time some code able to handle short varlenas (values up to 126 bytes reduced to a 1-byte header), converting such varlenas to an external on-disk TOAST pointer with the value saved uncompressed i

pgsql: doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS.

2025-08-06 Thread Fujii Masao
doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS. ALTER TABLE ... SET EXPRESSION AS removes statistics for the target column, so running ANALYZE afterward is recommended. But this was previously not documented, even though a similar recommendation exists for ALTER TABLE ... SET DATA

pgsql: doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS.

2025-08-06 Thread Fujii Masao
doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS. ALTER TABLE ... SET EXPRESSION AS removes statistics for the target column, so running ANALYZE afterward is recommended. But this was previously not documented, even though a similar recommendation exists for ALTER TABLE ... SET DATA

pgsql: doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS.

2025-08-06 Thread Fujii Masao
doc: Recommend ANALYZE after ALTER TABLE ... SET EXPRESSION AS. ALTER TABLE ... SET EXPRESSION AS removes statistics for the target column, so running ANALYZE afterward is recommended. But this was previously not documented, even though a similar recommendation exists for ALTER TABLE ... SET DATA