pgsql: Remove lc_ctype_is_c().

2024-09-06 Thread Jeff Davis
Remove lc_ctype_is_c(). Instead always fetch the locale and look at the ctype_is_c field. hba.c relies on regexes working for the C locale without needing catalog access, which worked before due to a special case for C_COLLATION_OID in lc_ctype_is_c(). Move the special case to pg_set_regex_collat

pgsql: Be more careful with error paths in pg_set_regex_collation().

2024-09-05 Thread Jeff Davis
Be more careful with error paths in pg_set_regex_collation(). Set global variables after error paths so that they don't end up in an inconsistent state. The inconsistent state doesn't lead to an actual problem, because after an error, pg_set_regex_collation() will be called again before the globa

pgsql: Remove lc_collate_is_c().

2024-09-04 Thread Jeff Davis
Remove lc_collate_is_c(). Instead just look up the collation and check collate_is_c field. Author: Andreas Karlsson Discussion: https://postgr.es/m/60929555-4709-40a7-b136-bcb44cff5...@proxel.se Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/06421b08436414b42cd169

pgsql: Remember last collation to speed up collation cache.

2024-09-03 Thread Jeff Davis
Remember last collation to speed up collation cache. This optimization is to avoid a performance regression in an upcoming patch that will remove lc_collate_is_c(). Discussion: https://postgr.es/m/96a559be83329bc66074a3925ebcfa8ceb16dfc5.ca...@j-davis.com Discussion: https://postgr.es/m/646f662

pgsql: Fix obsolete comments in varstr_cmp().

2024-08-21 Thread Jeff Davis
Fix obsolete comments in varstr_cmp(). Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a8395677840c37f6988d7d6420d551d0b744e6bd Modified Files -- src/backend/utils/adt/varlena.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-)

pgsql: Slightly refactor varstr_sortsupport() to improve readability.

2024-08-20 Thread Jeff Davis
Slightly refactor varstr_sortsupport() to improve readability. Author: Andreas Karlsson Discussion: https://postgr.es/m/69c2a864-846f-4309-bd5a-aaa1c34f9...@proxel.se Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a95ff1fe2eb4926b13e0940ad1f37d048704bdb0 Modified

pgsql: Improve configure error for ICU libraries if pkg-config is absen

2024-08-20 Thread Jeff Davis
Improve configure error for ICU libraries if pkg-config is absent. If pkg-config is not installed, the ICU libraries cannot be found, but the custom configure error message did not mention this. This might lead to confusion about the actual problem. To improve this, remove the explicit error messa

pgsql: Fix doc typo: unicode_assigned() return type.

2024-08-14 Thread Jeff Davis
Fix doc typo: unicode_assigned() return type. Reported-by: Hironobu SUZUKI Discussion: https://postgr.es/m/5dd88820-bb00-4b90-904b-738ea2e4e...@interdb.jp Backpatch-through: 17 Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/225483238d3e46669c9d73f8faead7aff5

pgsql: Fix doc typo: unicode_assigned() return type.

2024-08-14 Thread Jeff Davis
Fix doc typo: unicode_assigned() return type. Reported-by: Hironobu SUZUKI Discussion: https://postgr.es/m/5dd88820-bb00-4b90-904b-738ea2e4e...@interdb.jp Backpatch-through: 17 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a3c6aa42ee0d625a55e73e17230db3eaeed3566c

pgsql: Remove unnecessary check for NULL locale, per Coverity.

2024-08-12 Thread Jeff Davis
Remove unnecessary check for NULL locale, per Coverity. Discussion: https://postgr.es/m/3804933.1723394...@sss.pgh.pa.us Reported-by: Tom Lane Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a459ac504cc62421c08c9ee1ddc3e6f9be61f384 Modified Files -- src

pgsql: selfuncs.c: use pg_strxfrm() instead of strxfrm().

2024-08-06 Thread Jeff Davis
selfuncs.c: use pg_strxfrm() instead of strxfrm(). pg_strxfrm() takes a pg_locale_t, so it works properly with all providers. This improves estimates for ICU when performing linear interpolation within a histogram bin. Previously, convert_string_datum() always used strxfrm() and relied on setloca

pgsql: Remove support for null pg_locale_t most places.

2024-08-05 Thread Jeff Davis
Remove support for null pg_locale_t most places. Previously, passing NULL for pg_locale_t meant "use the libc provider and the server environment". Now that the database collation is represented as a proper pg_locale_t (not dependent on setlocale()), remove special cases for NULL. Leave wchar2cha

pgsql: Small refactoring around ExecCreateTableAs().

2024-08-02 Thread Jeff Davis
Small refactoring around ExecCreateTableAs(). Since commit 4b74ebf726, the refresh logic is used to populate materialized views, so we can simplify the error message in ExecCreateTableAs(). Also, RefreshMatViewByOid() is moved to just after create_ctas_nodata() call to improve code readability.

pgsql: Add is_create parameter to RefreshMatviewByOid().

2024-07-31 Thread Jeff Davis
Add is_create parameter to RefreshMatviewByOid(). RefreshMatviewByOid is used for both REFRESH and CREATE MATERIALIZED VIEW. This flag is currently just used for handling internal error messages, but also aimed to improve code-readability. Author: Yugo Nagata Discussion: https://postgr.es/m/202

pgsql: Remove unused ParamListInfo argument from ExecRefreshMatView.

2024-07-31 Thread Jeff Davis
Remove unused ParamListInfo argument from ExecRefreshMatView. Author: Yugo Nagata Discussion: https://postgr.es/m/20240726122630.70e889f63a4d7e26f8549...@sraoss.co.jp Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f683d3a4ca6dc441a86ed90070f126c20ea46b45 Modified

pgsql: Relax check for return value from second call of pg_strnxfrm().

2024-07-30 Thread Jeff Davis
Relax check for return value from second call of pg_strnxfrm(). strxfrm() is not guaranteed to return the exact number of bytes needed to store the result; it may return a higher value. Discussion: https://postgr.es/m/32f85d88d1f64395abfe5a10dd97a62a4d3474ce.ca...@j-davis.com Reviewed-by: Heikki

pgsql: Relax check for return value from second call of pg_strnxfrm().

2024-07-30 Thread Jeff Davis
Relax check for return value from second call of pg_strnxfrm(). strxfrm() is not guaranteed to return the exact number of bytes needed to store the result; it may return a higher value. Discussion: https://postgr.es/m/32f85d88d1f64395abfe5a10dd97a62a4d3474ce.ca...@j-davis.com Reviewed-by: Heikki

pgsql: Relax check for return value from second call of pg_strnxfrm().

2024-07-30 Thread Jeff Davis
Relax check for return value from second call of pg_strnxfrm(). strxfrm() is not guaranteed to return the exact number of bytes needed to store the result; it may return a higher value. Discussion: https://postgr.es/m/32f85d88d1f64395abfe5a10dd97a62a4d3474ce.ca...@j-davis.com Reviewed-by: Heikki

pgsql: Make collation not depend on setlocale().

2024-07-30 Thread Jeff Davis
Make collation not depend on setlocale(). Now that the result of pg_newlocale_from_collation() is always non-NULL, then we can move the collate_is_c and ctype_is_c flags into pg_locale_t. That simplifies the logic in lc_collate_is_c() and lc_ctype_is_c(), removing the dependence on setlocale(). T

pgsql: Do not return NULL from pg_newlocale_from_collation().

2024-07-29 Thread Jeff Davis
Do not return NULL from pg_newlocale_from_collation(). Previously, pg_newlocale_from_collation() returned NULL as a special case for the DEFAULT_COLLATION_OID if the provider was libc. In that case the behavior would depend on the last call to setlocale(). Now, consistent with the other providers

pgsql: Refactor pg_set_regex_collation() for clarity.

2024-07-28 Thread Jeff Davis
Refactor pg_set_regex_collation() for clarity. Discussion: https://postgr.es/m/63409030-2746-462e-beac-759bd4303...@proxel.se Reviewed-by: Andreas Karlsson Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2e68077b07cc597ef6bdfacffb5acbd17e179237 Modified Files -

pgsql: Fix whitespace in commit 005c6b833f.

2024-07-28 Thread Jeff Davis
Fix whitespace in commit 005c6b833f. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c0ef1234dfb68bb0b5c926c0eafd82881ad78374 Modified Files -- src/backend/utils/adt/pg_locale.c | 4 ++-- src/tools/pgindent/typedefs.list | 1 + 2 files changed, 3 insertio

pgsql: Refactor: make default_locale internal to pg_locale.c.

2024-07-28 Thread Jeff Davis
Refactor: make default_locale internal to pg_locale.c. Discussion: https://postgr.es/m/2228884bb1f1a02614b39f71a90c94d2cc8a3a2f.ca...@j-davis.com Reviewed-by: Peter Eisentraut, Andreas Karlsson Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1c461a8d8d3c7a4655fdb94

pgsql: Change collation cache to use simplehash.h.

2024-07-28 Thread Jeff Davis
Change collation cache to use simplehash.h. Speeds up text comparison expressions when using a collation other than the database default collation. Does not affect larger operations such as ORDER BY, because the lookup is only done once. Discussion: https://postgr.es/m/7bb9f018d20a7b30b9a7f6231e

pgsql: When creating materialized views, use REFRESH to load data.

2024-07-16 Thread Jeff Davis
When creating materialized views, use REFRESH to load data. Previously, CREATE MATERIALIZED VIEW ... WITH DATA populated the MV the same way as CREATE TABLE ... AS. Instead, reuse the REFRESH logic, which locks down security-restricted operations and restricts the search_path. This reduces the ch

pgsql: When creating materialized views, use REFRESH to load data.

2024-07-16 Thread Jeff Davis
When creating materialized views, use REFRESH to load data. Previously, CREATE MATERIALIZED VIEW ... WITH DATA populated the MV the same way as CREATE TABLE ... AS. Instead, reuse the REFRESH logic, which locks down security-restricted operations and restricts the search_path. This reduces the ch

pgsql: Add missing RestrictSearchPath() calls.

2024-07-15 Thread Jeff Davis
Add missing RestrictSearchPath() calls. Reported-by: Noah Misch Backpatch-through: 17 Discussion: https://postgr.es/m/20240630222344.db.nmi...@google.com Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/a15b0edb5dd9d2a3731f374b576485799c00431c Modified Files

pgsql: Add missing RestrictSearchPath() calls.

2024-07-15 Thread Jeff Davis
Add missing RestrictSearchPath() calls. Reported-by: Noah Misch Backpatch-through: 17 Discussion: https://postgr.es/m/20240630222344.db.nmi...@google.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8e28778ce396c3dac74a5fa8724e1ca7cea16d19 Modified Files ---

pgsql: Fix missing invalidations for search_path cache.

2024-07-09 Thread Jeff Davis
Fix missing invalidations for search_path cache. Reported-by: Noah Misch Discussion: https://postgr.es/m/20240630223047.1f.nmi...@google.com Backpatch-through: 17 Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/d3e076549b99d1130053223adb9c1fa909d75dc0 Modifi

pgsql: Fix missing invalidations for search_path cache.

2024-07-09 Thread Jeff Davis
Fix missing invalidations for search_path cache. Reported-by: Noah Misch Discussion: https://postgr.es/m/20240630223047.1f.nmi...@google.com Backpatch-through: 17 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b3bd18294ee471c5a6f1db69be57f08c1e00f1a6 Modified File

pgsql: Collation documentation fixes.

2024-06-06 Thread Jeff Davis
Collation documentation fixes. Discussion: https://postgr.es/m/9beecdf7-e8c8-4eab-adc7-fa225c2fe...@eisentraut.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8ba34c698d19450ccae9a5aea59a6d0bc8b75c0e Modified Files -- doc/src/sgml/catalogs.sgml | 1

Re: pgsql: Support C.UTF-8 locale in the new builtin collation provider.

2024-05-07 Thread Jeff Davis
think it would be best to remove the comment altogether and let > the > code speak for itself.) Thank you, committed. Regards, Jeff Davis

pgsql: Remove obsolete comment.

2024-05-07 Thread Jeff Davis
Remove obsolete comment. Per suggestion from Peter, the comment was not helpful, so remove it rather than fixing it. Reported-by: Peter Eisentraut Discussion: https://postgr.es/m/d9421b21-e759-4b74-a039-c487b469c...@eisentraut.org Branch -- master Details --- https://git.postgresql.org

Re: pgsql: Introduce "builtin" collation provider.

2024-04-30 Thread Jeff Davis
On Tue, 2024-04-23 at 11:23 +0200, Peter Eisentraut wrote: > I think I found a small bug in this commit. Good catch, thank you. Committed a fix. Regards, Jeff Davis

pgsql: Fix locale options checking in CREATE DATABASE.

2024-04-30 Thread Jeff Davis
Fix locale options checking in CREATE DATABASE. Discussion: https://postgr.es/m/4ea13583-7305-40b0-8525-58381533e...@eisentraut.org Reported-by: Peter Eisentraut Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7562a9bd7100702ce7878a17f4aaac1df08a8e09 Modified File

pgsql: Fix test failures when language environment is not UTF-8.

2024-04-04 Thread Jeff Davis
Fix test failures when language environment is not UTF-8. For tests that depend on UTF-8 encoding, force LC_COLLATE=C and LC_CTYPE=C to avoid an encoding mismatch. Reported-by: Thomas Munro Discussion: https://postgr.es/m/CA+hUKGK-ZqV1njkG_=xcCqXh2fcMkz85FTMnhS2opm4ZerH=x...@mail.gmail.com Bran

pgsql: CREATE INDEX: do not update stats during binary upgrade.

2024-04-03 Thread Jeff Davis
CREATE INDEX: do not update stats during binary upgrade. During binary upgrade, indexes are created before the data is moved into place, so it will always be zero. This is not currently a major problem, but will be when we try to preserve statistics during upgrade. Author: Corey Huinker Discussi

pgsql: Add unicode_strtitle() for Unicode Default Case Conversion.

2024-03-29 Thread Jeff Davis
Add unicode_strtitle() for Unicode Default Case Conversion. This brings the titlecasing implementation for the builtin provider out of formatting.c and into unicode_case.c, along with unicode_strlower() and unicode_strupper(). Accepts an arbitrary word boundary callback. Simple for now, but can b

pgsql: Use version for builtin collations.

2024-03-29 Thread Jeff Davis
Use version for builtin collations. Given that the version field already exists, there's little reason not to use it. Suggestion from Peter Eisentraut. Discussion: https://postgr.es/m/613c120a-5413-4fa7-a501-6590eae55...@eisentraut.org Reviewed-by: Peter Eisentraut Branch -- master Details

pgsql: Run perltidy on generate-unicode_version.pl.

2024-03-27 Thread Jeff Davis
Run perltidy on generate-unicode_version.pl. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b0be28761ec5958bb7bbf9a03d94ee6e1bc59849 Modified Files -- src/common/unicode/generate-unicode_version.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

pgsql: Clarify comment for LogicalTapeSetBlocks().

2024-03-25 Thread Jeff Davis
Clarify comment for LogicalTapeSetBlocks(). Discussion: https://postgr.es/m/1229327.1711160...@sss.pgh.pa.us Backpatch-through: 13 Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/abcea19abf3bd9dfbb4d4b9571ee7a522eb52893 Modified Files -- src/back

pgsql: Clarify comment for LogicalTapeSetBlocks().

2024-03-25 Thread Jeff Davis
Clarify comment for LogicalTapeSetBlocks(). Discussion: https://postgr.es/m/1229327.1711160...@sss.pgh.pa.us Backpatch-through: 13 Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/24d1b9989134e96f643ba31cd0e379fce5062534 Modified Files -- src/back

pgsql: Clarify comment for LogicalTapeSetBlocks().

2024-03-25 Thread Jeff Davis
Clarify comment for LogicalTapeSetBlocks(). Discussion: https://postgr.es/m/1229327.1711160...@sss.pgh.pa.us Backpatch-through: 13 Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/b74e4a08b9835e18a14fd3f23e19ddd460ed5b88 Modified Files -- src/back

pgsql: Clarify comment for LogicalTapeSetBlocks().

2024-03-25 Thread Jeff Davis
Clarify comment for LogicalTapeSetBlocks(). Discussion: https://postgr.es/m/1229327.1711160...@sss.pgh.pa.us Backpatch-through: 13 Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/022068ea2c60fd0b1ec9b9be5d1cc680b640335c Modified Files -- src/back

pgsql: Clarify comment for LogicalTapeSetBlocks().

2024-03-25 Thread Jeff Davis
Clarify comment for LogicalTapeSetBlocks(). Discussion: https://postgr.es/m/1229327.1711160...@sss.pgh.pa.us Backpatch-through: 13 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/bc5fcaa289a92941a1c7b191c7c9311bd742e172 Modified Files -- src/backend/uti

pgsql: Fix convert_case(), introduced in 5c40364dd6.

2024-03-24 Thread Jeff Davis
Fix convert_case(), introduced in 5c40364dd6. Check source length before checking for NUL terminator to avoid reading one byte past the string end. Also fix unreachable bug when caller does not expect NUL-terminated result. Add unit test coverage of convert_case() in case_test.c, which makes it e

pgsql: Remove incorrect Assert introduced in c8aeaf3ab.

2024-03-23 Thread Jeff Davis
Remove incorrect Assert introduced in c8aeaf3ab. Already removed incidentally in version 15 (c4649cce3), so this commit is only applied to versions 13 and 14. The comment above is misleading in all versions 13 and later, so that will be fixed in a separate commit. Discussion: https://postgr.es/

pgsql: Remove incorrect Assert introduced in c8aeaf3ab.

2024-03-23 Thread Jeff Davis
Remove incorrect Assert introduced in c8aeaf3ab. Already removed incidentally in version 15 (c4649cce3), so this commit is only applied to versions 13 and 14. The comment above is misleading in all versions 13 and later, so that will be fixed in a separate commit. Discussion: https://postgr.es/

pgsql: Inline basic UTF-8 functions.

2024-03-20 Thread Jeff Davis
Inline basic UTF-8 functions. Shows a measurable speedup when processing UTF-8 data, such as with the new builtin collation provider. Discussion: https://postgr.es/m/163f4e2190cdf67f67016044e503c5004547e5a9.ca...@j-davis.com Reviewed-by: Peter Eisentraut Branch -- master Details --- ht

pgsql: Support C.UTF-8 locale in the new builtin collation provider.

2024-03-19 Thread Jeff Davis
Support C.UTF-8 locale in the new builtin collation provider. The builtin C.UTF-8 locale has similar semantics to the libc locale of the same name. That is, code point sort order (fast, memcmp-based) combined with Unicode semantics for character operations such as pattern matching, regular express

pgsql: Fix documentation oversights from 2d819a08a1.

2024-03-18 Thread Jeff Davis
Fix documentation oversights from 2d819a08a1. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/bb5604ba9e53e3a0fb9967f960e36cff4d36b0ab Modified Files -- doc/src/sgml/ref/create_database.sgml | 3 ++- doc/src/sgml/ref/createdb.sgml| 10 ++

pgsql: Update src/common/unicode/README.

2024-03-18 Thread Jeff Davis
Update src/common/unicode/README. Change the test description to include the case mapping test. Oversight in 5c40364dd6. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f9f3fb1cb71a6cf28283a8cc3185599ec0ce94d3 Modified Files -- src/common/unicode/README

pgsql: Fix another warning, introduced by 846311051e.

2024-03-18 Thread Jeff Davis
Fix another warning, introduced by 846311051e. Discussion: https://postgr.es/m/3703896.1710799...@sss.pgh.pa.us Reported-by: Tom Lane Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/60769c62dc85680ee357aec92461fe97c715aebb Modified Files -- src/backend/

pgsql: Address more review comments on commit 2d819a08a1.

2024-03-18 Thread Jeff Davis
Address more review comments on commit 2d819a08a1. Based on comments from Peter Eisentraut. * Document CREATE DATABASE ... BUILTIN_LOCALE. * Determine required encoding based on locale name for CREATE COLLATION. Use -1 for "C" (requires catversion bump). * initdb output fixups. * Make ctyp

pgsql: Fix unreachable code warning from commit 2d819a08a1.

2024-03-18 Thread Jeff Davis
Fix unreachable code warning from commit 2d819a08a1. Found by Coverity. Discussion: https://postgr.es/m/3422201.1710711...@sss.pgh.pa.us Reported-by: Tom Lane Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/61f352ece9e7eb89c7154da178d0c3bc69fc72c9 Modified Files -

pgsql: Introduce "builtin" collation provider.

2024-03-13 Thread Jeff Davis
Introduce "builtin" collation provider. New provider for collations, like "libc" or "icu", but without any external dependency. Initially, the only locale supported by the builtin provider is "C", which is identical to the libc provider's "C" locale. The libc provider's "C" locale has always been

pgsql: Fix version check in 002_pg_upgrade.pl.

2024-03-12 Thread Jeff Davis
Fix version check in 002_pg_upgrade.pl. Commit f696c0cd5f tried to account for the version in a way that includes development versions, but it was broken. Fix with suggestion from Tom Lane. Discussion: https://postgr.es/m/1553991.1710191...@sss.pgh.pa.us Reported-by: Tom Lane Branch -- maste

Re: pgsql: Catalog changes preparing for builtin collation provider.

2024-03-11 Thread Jeff Davis
h makes simple grepping harder. I found a few cases -- attached a patch. Something is better than nothing. I'm not sure that I got the /.*/ cases right, but they don't seem to be expecting any output, so /.*/ seemed like the right pattern. Regards, Jeff Davis From be5aa677e37180a8c1b0

Re: pgsql: Catalog changes preparing for builtin collation provider.

2024-03-11 Thread Jeff Davis
On Mon, 2024-03-11 at 17:08 -0400, Tom Lane wrote: > Jeff Davis writes: > > was perfectly correct as it stood, because pg_version is a > PostgreSQL::Version object.  Why did you feel a need to > editorialize on that? The goal was to do a version check for 17 that's incl

Re: pgsql: Catalog changes preparing for builtin collation provider.

2024-03-11 Thread Jeff Davis
still confused on a couple of points here, such as: why does my example work fine on newer versions of perl? But I agree: if the empty pattern is magical, we should get rid of it, even if we don't understand the exact conditions under which it behaves magically. Reagrds, Jeff Davis

pgsql: Fix 002_pg_upgrade.pl.

2024-03-11 Thread Jeff Davis
Fix 002_pg_upgrade.pl. Commit f696c0cd5f caused a test failure in 002_pg_upgrade.pl, because an earlier s/// operator caused qr// to no longer match the empty string. Use qr/^$/ instead, which is a better test anyway, because we expect the stderr to be empty. Initially this appeared to be a perl

Re: pgsql: Catalog changes preparing for builtin collation provider.

2024-03-11 Thread Jeff Davis
or expect qr// to work. I am inclined toward #1, because if we use qr/^$/, other tests are likely to copy it and they will be safe as well. Though I'm still not sure what's going on with longfin. Thoughts? Regards, Jeff Davis

Re: pgsql: Catalog changes preparing for builtin collation provider.

2024-03-09 Thread Jeff Davis
On Sat, 2024-03-09 at 22:50 +, Jeff Davis wrote: > Catalog changes preparing for builtin collation provider. This is causing problems on a couple buildfarm members (mantid, lapwing, snakefly) that all look like this: # Running: pg_upgrade --no-sync -d /home/postgres/buildroot/H

pgsql: Catalog changes preparing for builtin collation provider.

2024-03-09 Thread Jeff Davis
Catalog changes preparing for builtin collation provider. Rename pg_collation.colliculocale to colllocale, and pg_database.daticulocale to datlocale. These names reflects that the fields will be useful for the upcoming builtin provider as well, not just for ICU. This is purely a rename; no change

Re: pgsql: Further further fix pg_upgrade crossversion test for adminpack.

2024-03-09 Thread Jeff Davis
so better to fix that now.  Please push your fix and > then I'll clean up the unnecessary DROPs. Thank you for looking. Pushed, and separately ran perltidy. Regards, Jeff Davis

pgsql: Run perltidy on 002_pg_upgrade.pl.

2024-03-09 Thread Jeff Davis
Run perltidy on 002_pg_upgrade.pl. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b0289574bdf1202248201a3143d1459bdf5727fd Modified Files -- src/bin/pg_upgrade/t/002_pg_upgrade.pl | 8 1 file changed, 4 insertions(+), 4 deletions(-)

pgsql: Fix cross-version pg_upgrade test.

2024-03-09 Thread Jeff Davis
Fix cross-version pg_upgrade test. Pass each statement as a separate '-c' arg, so they don't get combined into a single transaction. Discussion: https://postgr.es/m/bca97aecb50b2026b7dbc26604bf31861c819a64.ca...@j-davis.com Reviewed-by: Tom Lane Branch -- master Details --- https://git

Re: pgsql: Further further fix pg_upgrade crossversion test for adminpack.

2024-03-08 Thread Jeff Davis
in a transaction block, which doesn't work for DROP DATABASE. I'm not sure how this test is succeeding for others, so perhaps I'm doing something wrong? Patch attached, though I'm not particularly great with perl and the array flattening in my implementation might be too

Re: pgsql: Unicode case mapping tables and functions.

2024-03-08 Thread Jeff Davis
On Fri, 2024-03-08 at 10:24 +0200, Heikki Linnakangas wrote: > On 07/03/2024 21:18, Jeff Davis wrote: > > Unicode case mapping tables and functions. > > With -Wtype-limits, I'm seeing this warning: Thank you, fixed. Somehow I lost that flag from my script. Can you please

pgsql: Fix type signedness error in commit 5c40364dd6.

2024-03-08 Thread Jeff Davis
Fix type signedness error in commit 5c40364dd6. Use ssize_t instead of size_t. Discussion: https://postgr.es/m/b20d6d97-7338-48ea-ba33-837a1c8ef...@iki.fi Reported-by: Heikki Linnakangas Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/33ee2550d30bebb938238846369b2a

pgsql: Unicode case mapping tables and functions.

2024-03-07 Thread Jeff Davis
Unicode case mapping tables and functions. Implements Unicode simple case mapping, in which all code points map to exactly one other code point unconditionally. These tables are generated from UnicodeData.txt, which is already being used by other infrastructure in src/common/unicode. The tables a

pgsql: Add Unicode property tables.

2024-03-06 Thread Jeff Davis
Add Unicode property tables. Provide functions to test for Unicode properties, such as Alphabetic or Cased. These functions use tables derived from Unicode data files, similar to the tables for Unicode normalization or general category, and those tables can be updated with the 'update-unicode' bui

pgsql: Run pgindent again on the same file.

2024-03-05 Thread Jeff Davis
Run pgindent again on the same file. Apparently, pgindent got confused by the double space. The first time I ran it, it moved the function name to the next line. The second time I ran it, it moved the function name back, but without the double space. Now the results appear stable. Branch --

pgsql: Run pgindent for commit ef4cfdce0e.

2024-03-05 Thread Jeff Davis
Run pgindent for commit ef4cfdce0e. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b406af1806e9fc5c090e58282c7d98f22a4b397f Modified Files -- src/backend/utils/activity/backend_status.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

pgsql: docs: Update HOT update docs for 19d8e2308b

2024-03-05 Thread Jeff Davis
docs: Update HOT update docs for 19d8e2308b Commit 19d8e2308b changed when the HOT update optimization is possible but neglected to update the Heap-Only Tuples (HOT) documentation. This patch updates that documentation accordingly. Author: Elizabeth Christensen Backpatch-through: 16 Reviewed-By:

pgsql: docs: Update HOT update docs for 19d8e2308b

2024-03-05 Thread Jeff Davis
docs: Update HOT update docs for 19d8e2308b Commit 19d8e2308b changed when the HOT update optimization is possible but neglected to update the Heap-Only Tuples (HOT) documentation. This patch updates that documentation accordingly. Author: Elizabeth Christensen Backpatch-through: 16 Reviewed-By:

pgsql: Update sepgsql expected output.

2024-03-05 Thread Jeff Davis
Update sepgsql expected output. Fix for buildfarm member rhinoceros after commit 2af07e2f74. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c7ea3f42291bf5c74be8f957c775c5e7b3f78592 Modified Files -- contrib/sepgsql/expected/ddl.out | 37 +++

pgsql: Fix buildfarm failures from 2af07e2f74.

2024-03-04 Thread Jeff Davis
Fix buildfarm failures from 2af07e2f74. Use GUC_ACTION_SAVE rather than GUC_ACTION_SET, necessary for working with parallel query. Now that the call requires more arguments, wrap the call in a new function to avoid code duplication and offer a place for a comment. Discussion: https://postgr.es/m

Re: pgsql: Fix search_path to a safe value during maintenance operations.

2024-03-04 Thread Jeff Davis
On Mon, 2024-03-04 at 21:15 -0500, Tom Lane wrote: > Jeff Davis writes: > > Fix search_path to a safe value during maintenance operations. > > The buildfarm seems pretty unhappy with this. Looks like I need to use GUC_ACTION_SAVE. I will remedy it shortly. Regards, Jeff Davis

pgsql: Fix search_path to a safe value during maintenance operations.

2024-03-04 Thread Jeff Davis
Fix search_path to a safe value during maintenance operations. While executing maintenance operations (ANALYZE, CLUSTER, REFRESH MATERIALIZED VIEW, REINDEX, or VACUUM), set search_path to 'pg_catalog, pg_temp' to prevent inconsistent behavior. Functions that are used for functional indexes, in in

pgsql: Documentation update for Standard Collations.

2024-03-02 Thread Jeff Davis
Documentation update for Standard Collations. Correct out-of-date text that said the "default" collation is always based on LC_COLLATE and LC_CTYPE. Also reformat into a list to make it easier to understand and compare the available collations, and briefly document the stability characteristics o

pgsql: Pass correct count to WALRead().

2024-02-16 Thread Jeff Davis
Pass correct count to WALRead(). Previously, some callers requested XLOG_BLCKSZ bytes unconditionally. While this did not cause a problem, because the extra bytes are ignored, it's confusing and makes it harder to add safety checks. Additionally, the comment about zero padding was incorrect. With

pgsql: Add assert to WALReadFromBuffers().

2024-02-16 Thread Jeff Davis
Add assert to WALReadFromBuffers(). Per suggestion from Andres. Discussion: https://postgr.es/m/20240214025508.6mcblauossthv...@awork3.anarazel.de Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9ecbf54075a91ed155cc779fcc1870de0fff5fef Modified Files

pgsql: Read WAL directly from WAL buffers.

2024-02-12 Thread Jeff Davis
Read WAL directly from WAL buffers. If available, read directly from WAL buffers, avoiding the need to go through the filesystem. Only for physical replication for now, but can be expanded to other callers. In preparation for replicating unflushed WAL data. Author: Bharath Rupireddy Discussion:

pgsql: Fix buildfarm error from commit 5c31669058.

2024-01-18 Thread Jeff Davis
Fix buildfarm error from commit 5c31669058. Skip test when not using unix domain sockets. Discussion: https://postgr.es/m/caldanm29-8oozsbwo9h6dn_tb_3ya1qjrjput-khan8ncdj...@mail.gmail.com Backpatch-through: 16 Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdif

pgsql: Fix buildfarm error from commit 5c31669058.

2024-01-18 Thread Jeff Davis
Fix buildfarm error from commit 5c31669058. Skip test when not using unix domain sockets. Discussion: https://postgr.es/m/caldanm29-8oozsbwo9h6dn_tb_3ya1qjrjput-khan8ncdj...@mail.gmail.com Backpatch-through: 16 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/dd3ca

Re: pgsql: Re-validate connection string in libpqrcv_connect().

2024-01-12 Thread Jeff Davis
On Fri, 2024-01-12 at 21:43 +, Jeff Davis wrote: > Re-validate connection string in libpqrcv_connect(). Looks like the test is causing problems on drogo: ERROR: could not connect to the publisher: connection to server at "127.0.0.1", port 54707 failed: FATAL: SSPI authenticati

pgsql: Fix memory leak in connection string validation.

2024-01-12 Thread Jeff Davis
Fix memory leak in connection string validation. Introduced in commit c3afe8cf5a. Discussion: https://postgr.es/m/066a65233d3cb4ea27a9e0778d2f1d0dc764b222.ca...@j-davis.com Reviewed-by: Nathan Bossart, Tom Lane Backpatch-through: 16 Branch -- REL_16_STABLE Details --- https://git.postg

pgsql: Fix memory leak in connection string validation.

2024-01-12 Thread Jeff Davis
Fix memory leak in connection string validation. Introduced in commit c3afe8cf5a. Discussion: https://postgr.es/m/066a65233d3cb4ea27a9e0778d2f1d0dc764b222.ca...@j-davis.com Reviewed-by: Nathan Bossart, Tom Lane Backpatch-through: 16 Branch -- master Details --- https://git.postgresql.o

pgsql: Re-validate connection string in libpqrcv_connect().

2024-01-12 Thread Jeff Davis
password from another source (like a password file or the PGPASSWORD environment variable), which should not have been allowed. This commit adds a step to re-validate the connection string before connecting. Reported-by: Jeff Davis Author: Vignesh C Reviewed-by: Peter Smith, Robert Haas, Amit

pgsql: Re-validate connection string in libpqrcv_connect().

2024-01-12 Thread Jeff Davis
password from another source (like a password file or the PGPASSWORD environment variable), which should not have been allowed. This commit adds a step to re-validate the connection string before connecting. Reported-by: Jeff Davis Author: Vignesh C Reviewed-by: Peter Smith, Robert Haas, Amit

pgsql: Cleanup for unicode-update build target and test.

2024-01-11 Thread Jeff Davis
Cleanup for unicode-update build target and test. In preparation for adding more Unicode tables. Discussion: https://postgr.es/m/63cd8625-68fa-4760-844a-6b7f64333...@ardentperf.com Reviewed-by: Jeremy Schneider Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/cf64d

Re: pgsql: Make all Perl warnings fatal

2023-12-29 Thread Jeff Davis
On Fri, 2023-12-29 at 17:46 +, Peter Eisentraut wrote: > Make all Perl warnings fatal This seems to be causing problems in the buildfarm: Use of uninitialized value $ENV{"PG_TEST_EXTRA"} in pattern match (m//) at t/001_mutated_bindpasswd.pl line 23. Regards, Jeff Davis

pgsql: Fix collate.windows.win1252 test.

2023-12-29 Thread Jeff Davis
Fix collate.windows.win1252 test. Do not rely on the OS recognizing a particular locale; find the right locale by querying the "en_US" collation. Author: Alexander Lakhin Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/ae73f6f5-8221-c112-4640-5cda812a6...@gmail.com Branch -- ma

pgsql: Initialize data directories with --lc-messages=C for tests.

2023-12-21 Thread Jeff Davis
Initialize data directories with --lc-messages=C for tests. Commit db6d9891e8 changed them to be initialized with --no-locale, but that reduced the test coverage for non-C locales. Discussion: https://postgr.es/m/0d47e5ecc037b3908149aad5f2a987793cf938bd.camel%40j-davis.com Branch -- master

pgsql: Use 64-bit atomics for xlblocks array elements.

2023-12-19 Thread Jeff Davis
Use 64-bit atomics for xlblocks array elements. In preparation for reading the contents of WAL buffers without a lock. Also, avoids the previously-needed comment in GetXLogBuffer() explaining why it's safe from torn reads. Author: Bharath Rupireddy Discussion: https://postgr.es/m/calj2acvffmfqd5

pgsql: Additional write barrier in AdvanceXLInsertBuffer().

2023-12-19 Thread Jeff Davis
Additional write barrier in AdvanceXLInsertBuffer(). First, mark the xlblocks member with InvalidXLogRecPtr, then issue a write barrier, then initialize it. That ensures that the xlblocks member doesn't appear valid while the contents are being initialized. In preparation for reading WAL buffer c

pgsql: Cache opaque handle for GUC option to avoid repeasted lookups.

2023-12-08 Thread Jeff Davis
Cache opaque handle for GUC option to avoid repeasted lookups. When setting GUCs from proconfig, performance is important, and hash lookups in the GUC table are significant. Per suggestion from Robert Haas. Discussion: https://postgr.es/m/ca+tgmoypkxhr3hod9syk2xwcauvpa0+ba0xpnwwbcyxtklk...@mail

pgsql: Shrink Unicode category table.

2023-12-07 Thread Jeff Davis
Shrink Unicode category table. Missing entries can implicitly be considered "unassigned". Discussion: https://postgr.es/m/ff4c2f2f9c8fc7ca27c1c24ae37ecaeaeaff6b53.ca...@j-davis.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/719b342d36ce9a049137817e93e6a18a711

pgsql: Optimize SearchPathCache by saving the last entry.

2023-12-04 Thread Jeff Davis
Optimize SearchPathCache by saving the last entry. Repeated lookups are common, so it's worth it to check the last entry before doing another hash lookup. Discussion: https://postgr.es/m/04c8592dbd694e4114a3ed87139a7a04e4363030.camel%40j-davis.com Branch -- master Details --- https://g

  1   2   3   4   >