pgsql: Remove incorrect declarations in pg_wchar.h.

2025-12-15 Thread Jeff Davis
Remove incorrect declarations in pg_wchar.h. Oversight in commit 9acae56ce0. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/95a19fefdcbe8d7c511971fe3b9554d0bdd4e26a Modified Files

pgsql: Remove unused single-byte char_is_cased() API.

2025-12-15 Thread Jeff Davis
Remove unused single-byte char_is_cased() API. https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/54c41a6deb9df0868da078490ef9c26d1290e490 Modified Files -- src/backend/utils/ad

pgsql: Use multibyte-aware extraction of pattern prefixes.

2025-12-15 Thread Jeff Davis
Use multibyte-aware extraction of pattern prefixes. Previously, like_fixed_prefix() used char-at-a-time logic, which forced it to be too conservative for case-insensitive matching. Introduce like_fixed_prefix_ci(), and use that for case-insensitive pattern prefixes. It uses multibyte and locale-a

pgsql: Add pg_iswcased().

2025-12-10 Thread Jeff Davis
Add pg_iswcased(). True if character has multiple case forms. Will be a useful multibyte-aware replacement for char_is_cased(). Reviewed-by: Chao Li Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/[email protected] Branch -- master D

pgsql: Remove char_tolower() API.

2025-12-10 Thread Jeff Davis
Remove char_tolower() API. It's only useful for an ILIKE optimization for the libc provider using a single-byte encoding and a non-C locale, but it creates significant internal complexity. Reviewed-by: Chao Li Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/450ceb6260cad30d7afdf1

pgsql: Make regex "max_chr" depend on encoding, not provider.

2025-12-01 Thread Jeff Davis
Make regex "max_chr" depend on encoding, not provider. The regex mechanism scans through the first "max_chr" character values to cache character property ranges (isalpha, etc.). For single-byte encodings, there's no sense in scanning beyond UCHAR_MAX; but for UTF-8 it makes sense to cache higher c

pgsql: Change some callers to use pg_ascii_toupper().

2025-12-01 Thread Jeff Davis
Change some callers to use pg_ascii_toupper(). The input is ASCII anyway, so it's better to be clear that it's not locale-dependent. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/com

pgsql: Allow pg_locale_t APIs to work when ctype_is_c.

2025-11-26 Thread Jeff Davis
Allow pg_locale_t APIs to work when ctype_is_c. Previously, the caller needed to check ctype_is_c first for some routines and not others. Now, the APIs consistently work, and the caller can just check ctype_is_c for optimization purposes. Discussion: https://postgr.es/m/450ceb6260cad30d7afdf155d

pgsql: Add #define for UNICODE_CASEMAP_BUFSZ.

2025-11-26 Thread Jeff Davis
Add #define for UNICODE_CASEMAP_BUFSZ. Useful for mapping a single codepoint at a time into a statically-allocated buffer. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Chao Li Branch -- master Details --- https://git.postgresq

pgsql: Inline pg_ascii_tolower() and pg_ascii_toupper().

2025-11-26 Thread Jeff Davis
Inline pg_ascii_tolower() and pg_ascii_toupper(). Discussion: https://postgr.es/m/[email protected] Reviewed-by: Chao Li Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ec4997a9d733e91b614d0c2f3e6445cc2905fd16 Modified Fil

pgsql: Remove a useless length check.

2025-11-25 Thread Jeff Davis
Remove a useless length check. Author: Chao Li Discussion: https://postgr.es/m/CAEoWx2mW0P8CByavV58zm3=eb2mqhakocdef5b2ujyryc2c...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3b9c118920580b97d0f6f618954876227a50a14a Modified Files -

pgsql: Avoid global LC_CTYPE dependency in pg_locale_libc.c.

2025-11-24 Thread Jeff Davis
Avoid global LC_CTYPE dependency in pg_locale_libc.c. Call tolower_l() directly instead of through pg_tolower(), because the latter depends on the global LC_CTYPE. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- ht

pgsql: Special case C_COLLATION_OID in pg_newlocale_from_collation().

2025-11-04 Thread Jeff Davis
Special case C_COLLATION_OID in pg_newlocale_from_collation(). Allow pg_newlocale_from_collation(C_COLLATION_OID) to work even if there's no catalog access, which some extensions expect. Not known to be a bug without extensions involved, but backport to 18. Also corrects an issue in master with

pgsql: Special case C_COLLATION_OID in pg_newlocale_from_collation().

2025-11-04 Thread Jeff Davis
Special case C_COLLATION_OID in pg_newlocale_from_collation(). Allow pg_newlocale_from_collation(C_COLLATION_OID) to work even if there's no catalog access, which some extensions expect. Not known to be a bug without extensions involved, but backport to 18. Also corrects an issue in master with

pgsql: Remove redundant memset() introduced by a0942f4.

2025-11-04 Thread Jeff Davis
Remove redundant memset() introduced by a0942f4. Reported-by: Chao Li Discussion: https://postgr.es/m/CAEoWx2kAkNaDa01O0nKsQmkfEmxsDvm09SU=f1t0cv8ew3q...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4bfaea11d2d686a06487c2e33297bf17f12732d7 Modif

pgsql: Use C11 char16_t and char32_t for Unicode code points.

2025-10-29 Thread Jeff Davis
Use C11 char16_t and char32_t for Unicode code points. Reviewed-by: Tatsuo Ishii Reviewed-by: Thomas Munro Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/bedcc93d06203dfd89815b10f815ca2de8626e85.camel%40j-davis.com Branch -- master Details --- https://git.postgresql.or

pgsql: Move comment about casts from pg_wchar.

2025-10-28 Thread Jeff Davis
Move comment about casts from pg_wchar. Suggested-by: Thomas Munro Discussion: https://postgr.es/m/ca+hukglxquyk7cq5kblggtwo7pors7yhbwo1aenzt7xtybl...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4da12e9e2e3c011a3fc8354ca451d6a82c017fa3 Modified

pgsql: Comment typo fixes: pg_wchar_t should be pg_wchar.

2025-10-26 Thread Jeff Davis
Comment typo fixes: pg_wchar_t should be pg_wchar. Reported-by: Thomas Munro Discussion: https://postgr.es/m/CA+hUKGJ5Xh0KxLYXDZuPvw1_fHX=yuzb4xxtam1cr6tpzz1...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/371a302eecdc82274b0ae2967d18fd726a0aa6a1

pgsql: Make char2wchar() static.

2025-10-21 Thread Jeff Davis
Make char2wchar() static. Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ff53907c35713a9c0c8cbdcc8d82c54954cf8234 Modified Files

pgsql: tsearch: use database default collation for parsing.

2025-10-21 Thread Jeff Davis
tsearch: use database default collation for parsing. Previously, tsearch used the database's CTYPE setting, which only matches the database default collation if the locale provider is libc. Note that tsearch types (tsvector and tsquery) are not collatable types. The locale affects parsing the ori

pgsql: Remove obsolete global database_ctype_is_c.

2025-10-21 Thread Jeff Davis
Remove obsolete global database_ctype_is_c. Now that tsearch uses the database default locale, there's no need to track the database CTYPE separately. Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/[email protected] Branch -- master

pgsql: Add pg_database_locale() to retrieve database default locale.

2025-10-18 Thread Jeff Davis
Add pg_database_locale() to retrieve database default locale. Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e533524b23b8dd504d38c09c9f84b3828

pgsql: Add pg_iswxdigit(), useful for tsearch.

2025-10-18 Thread Jeff Davis
Add pg_iswxdigit(), useful for tsearch. Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/67a8b49e96caf0782b556521c8d6650e78f2d88e Modified File

pgsql: pg_regc_locale.c: rename some static functions.

2025-10-18 Thread Jeff Davis
pg_regc_locale.c: rename some static functions. Use the more specific prefix "regc_" rather than the generic prefix "pg_". A subsequent commit will create generic versions of some of these functions that can be called from other modules. Discussion: https://postgr.es/m/0151ad01239e2cc7b31396443

pgsql: Add pg_iswalpha() and related functions.

2025-10-17 Thread Jeff Davis
Add pg_iswalpha() and related functions. Per-character pg_locale_t APIs. Useful for tsearch parsing and potentially other places. Significant overlap with the regc_wc_isalpha() and related functions in regc_pg_locale.c, but this change leaves those intact for now. Discussion: https://postgr.es/

pgsql: meson: build checksums with extra optimization flags.

2025-09-09 Thread Jeff Davis
meson: build checksums with extra optimization flags. Use -funroll-loops and -ftree-vectorize when building checksum.c to match what autoconf does. Missed backport of 9af672bcb2, noticed by Nathan Bossart. Reported-by: Nathan Bossart Discussion: https://postgr.es/m/a81f2f7ef34afc24a89c613671ea

pgsql: meson: build checksums with extra optimization flags.

2025-09-09 Thread Jeff Davis
meson: build checksums with extra optimization flags. Use -funroll-loops and -ftree-vectorize when building checksum.c to match what autoconf does. Missed backport of 9af672bcb2, noticed by Nathan Bossart. Reported-by: Nathan Bossart Discussion: https://postgr.es/m/a81f2f7ef34afc24a89c613671ea

pgsql: meson: build checksums with extra optimization flags.

2025-09-09 Thread Jeff Davis
meson: build checksums with extra optimization flags. Use -funroll-loops and -ftree-vectorize when building checksum.c to match what autoconf does. Missed backport of 9af672bcb2, noticed by Nathan Bossart. Reported-by: Nathan Bossart Discussion: https://postgr.es/m/a81f2f7ef34afc24a89c613671ea

pgsql: meson: build checksums with extra optimization flags.

2025-09-08 Thread Jeff Davis
meson: build checksums with extra optimization flags. Use -funroll-loops and -ftree-vectorize when building checksum.c to match what autoconf does. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Andres Freund Branch -- master Detail

pgsql: Check for more Unicode functions during upgrade.

2025-08-26 Thread Jeff Davis
Check for more Unicode functions during upgrade. When checking for expression indexes that may be affected by a Unicode update during upgrade, check for a few more functions. Specifically, check for documented regexp functions, as well as the new CASEFOLD() function. Also, fully-qualify reference

pgsql: Check for more Unicode functions during upgrade.

2025-08-26 Thread Jeff Davis
Check for more Unicode functions during upgrade. When checking for expression indexes that may be affected by a Unicode update during upgrade, check for a few more functions. Specifically, check for documented regexp functions, as well as the new CASEFOLD() function. Also, fully-qualify reference

pgsql: Don't copy datlocale from template unless provider matches.

2025-08-05 Thread Jeff Davis
Don't copy datlocale from template unless provider matches. During CREATE DATABASE, if changing the locale provider, require that a new locale is specified rather than trying to reinterpret the template's locale using the new provider. This only affects the behavior when the template uses the bui

pgsql: Don't copy datlocale from template unless provider matches.

2025-08-05 Thread Jeff Davis
Don't copy datlocale from template unless provider matches. During CREATE DATABASE, if changing the locale provider, require that a new locale is specified rather than trying to reinterpret the template's locale using the new provider. This only affects the behavior when the template uses the bui

pgsql: Simplify options in pg_dump and pg_restore.

2025-08-02 Thread Jeff Davis
Simplify options in pg_dump and pg_restore. Remove redundant options --with-data and --with-schema, and rename --with-statistics to just --statistics. Reviewed-by: Nathan Bossart Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/[email protected]

pgsql: Simplify options in pg_dump and pg_restore.

2025-08-02 Thread Jeff Davis
Simplify options in pg_dump and pg_restore. Remove redundant options --with-data and --with-schema, and rename --with-statistics to just --statistics. Reviewed-by: Nathan Bossart Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/[email protected]

pgsql: pg_dump: reject combination of "only" and "with"

2025-08-01 Thread Jeff Davis
pg_dump: reject combination of "only" and "with" Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/[email protected] Backpatch-through: 18 Branch -- REL_18_STABLE Details --- https://git.postgresql.org/pg/commitdiff/60121890f7f23311c1e

pgsql: pg_dump: reject combination of "only" and "with"

2025-08-01 Thread Jeff Davis
pg_dump: reject combination of "only" and "with" Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/[email protected] Backpatch-through: 18 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/0ed92cf50cc428dad1732a5e60

pgsql: Force LC_COLLATE to C in postmaster.

2025-07-16 Thread Jeff Davis
Force LC_COLLATE to C in postmaster. Avoid dependence on setlocale(). strcoll(), etc., are not called directly; all collation-sensitive calls should go through pg_locale.c and use the appropriate provider. By setting LC_COLLATE to C, we avoid accidentally depending on libc behavior when using a d

pgsql: pg_dumpall: Skip global objects with --statistics-only or --no-s

2025-07-16 Thread Jeff Davis
pg_dumpall: Skip global objects with --statistics-only or --no-schema. Previously, pg_dumpall would still dump global objects such as roles and tablespaces even when --statistics-only or --no-schema was specified. Since these global objects are treated as schema-level data, they should be skipped

pgsql: pg_dumpall: Skip global objects with --statistics-only or --no-s

2025-07-16 Thread Jeff Davis
pg_dumpall: Skip global objects with --statistics-only or --no-schema. Previously, pg_dumpall would still dump global objects such as roles and tablespaces even when --statistics-only or --no-schema was specified. Since these global objects are treated as schema-level data, they should be skipped

pgsql: Change wchar2char() and char2wchar() to accept a locale_t.

2025-07-09 Thread Jeff Davis
Change wchar2char() and char2wchar() to accept a locale_t. These are libc-specific functions, so should require a locale_t rather than a pg_locale_t (which could use another provider). Discussion: https://postgr.es/m/a8666c391dfcabe79868d95f7160eac533ace718.camel%40j-davis.com Branch -- mas

pgsql: Remove provider field from pg_locale_t.

2025-07-01 Thread Jeff Davis
Remove provider field from pg_locale_t. The behavior of pg_locale_t is specified by methods, so a separate provider field is no longer necessary. Reviewed-by: Andreas Karlsson Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/2830211e1b6e6a2e26d845780b03e125281ea17b.camel%40j-davis

pgsql: Control ctype behavior internally with a method table.

2025-07-01 Thread Jeff Davis
Control ctype behavior internally with a method table. Previously, pattern matching and case mapping behavior branched based on the provider. Refactor to use a method table, which is less error-prone. This is also a step toward multiple provider versions, which we may want to support in the futur

pgsql: Use pg_ascii_tolower()/pg_ascii_toupper() where appropriate.

2025-07-01 Thread Jeff Davis
Use pg_ascii_tolower()/pg_ascii_toupper() where appropriate. Avoids unnecessary dependence on setlocale(). No behavior change. This commit reverts e1458f2f1b, which reverted some changes unintentionally committed before the branch for 19. Reviewed-by: Peter Eisentraut Discussion: https://postg

pgsql: Correct docs about partitions and EXCLUDE constraints.

2025-06-19 Thread Jeff Davis
docs for CREATE TABLE still said that they were not supported. This commit fixes that. Author: Paul A. Jungwirth Co-authored-by: Jeff Davis Discussion: https://postgr.es/m/[email protected] Backpatch-through: 17 Branch -- REL_17_STABLE Details

pgsql: Correct docs about partitions and EXCLUDE constraints.

2025-06-19 Thread Jeff Davis
docs for CREATE TABLE still said that they were not supported. This commit fixes that. Author: Paul A. Jungwirth Co-authored-by: Jeff Davis Discussion: https://postgr.es/m/[email protected] Backpatch-through: 17 Branch -- master Details

pgsql: Comment fixups from 626df47ad9.

2025-06-13 Thread Jeff Davis
Comment fixups from 626df47ad9. Reported-by: Peter Smith Discussion: https://postgr.es/m/cahut+pspbhqmrcbl1c-opojetukuafffuqjd2rhdzqwurwc...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a0c7b765372d949cec54960dafcaadbc04b3204e Modified Files ---

pgsql: Revert a few small patches that were intended for version 19.

2025-06-11 Thread Jeff Davis
Revert a few small patches that were intended for version 19. - 4c787a24e7e220a60022e47c1776f22f72902899 - 78bd364ee39ca70a8f9cb8719282389866a08e14 - 7a6880fadc177873d5663961ec3a02d67e34dcbe - 8898082a5d3e94eef073f0e08124137e096e78ef Suggested-by: Robert Haas Discussion: https://postgr.es/m/CA+

Re: pgsql: copyfromparse.c: use pg_ascii_tolower() rather than tolower().

2025-06-11 Thread Jeff Davis
Nobody seemed terribly upset about it so I left them. But for the sake of ending any confusion I just reverted them. I will reapply them in a few weeks after the branch. Regards, Jeff Davis

Re: pgsql: inet_net_pton.c: use pg_ascii_tolower() rather than tolower().

2025-06-10 Thread Jeff Davis
On Tue, 2025-06-10 at 18:24 +, Jeff Davis wrote: > inet_net_pton.c: use pg_ascii_tolower() rather than tolower(). These 4 small patches were somewhat of a "false start" on 19 -- sorry about that. Not sure if it's worth it to revert them and reapply in a couple weeks, a

pgsql: copyfromparse.c: use pg_ascii_tolower() rather than tolower().

2025-06-10 Thread Jeff Davis
copyfromparse.c: use pg_ascii_tolower() rather than tolower(). Avoid dependence on setlocale(). No behavior change. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Peter Eisentraut Branch -- master Details --- https://git.postgresql.org

pgsql: isn.c: use pg_ascii_toupper() instead of toupper().

2025-06-10 Thread Jeff Davis
isn.c: use pg_ascii_toupper() instead of toupper(). Avoid dependence on setlocale(). No behavior change. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Peter Eisentraut Branch -- master Details --- https://git.postgresql.org/pg/commitd

pgsql: contrib/spi/refint.c: use pg_ascii_tolower() instead.

2025-06-10 Thread Jeff Davis
contrib/spi/refint.c: use pg_ascii_tolower() instead. Avoid dependence on setlocale(). No behavior change. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Peter Eisentraut Branch -- master Details --- https://git.postgresql.org/pg/commi

pgsql: inet_net_pton.c: use pg_ascii_tolower() rather than tolower().

2025-06-10 Thread Jeff Davis
inet_net_pton.c: use pg_ascii_tolower() rather than tolower(). Avoid dependence on setlocale(). No behavior change. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Peter Eisentraut Branch -- master Details --- https://git.postgresql.org

pgsql: Improve CREATE DATABASE error message for invalid libc locale.

2025-06-06 Thread Jeff Davis
Improve CREATE DATABASE error message for invalid libc locale. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Daniel Verite Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/5b40feab594c3019fd6b09e46f97f5b367050cf9

pgsql: Change pg_dump default for statistics export.

2025-05-27 Thread Jeff Davis
Change pg_dump default for statistics export. Set the default behavior of pg_dump and pg_dumpall to be --no-statistics. Leave the default for pg_restore and pg_upgrade to be --with-statistics. Discussion: https://postgr.es/m/CA+TgmoZ9=rnwccozikyyjzs_aw1p4qxcw--h4dollhuf1om...@mail.gmail.com Rev

pgsql: Fix INITCAP() word boundaries for PG_UNICODE_FAST.

2025-04-21 Thread Jeff Davis
Fix INITCAP() word boundaries for PG_UNICODE_FAST. Word boundaries are based on whether a character is alphanumeric or not. For the PG_UNICODE_FAST collation, alphanumeric includes non-ASCII digits; whereas for the PG_C_UTF8 collation, it only includes digits 0-9. Pass down the right information f

pgsql: Improve comment in regc_pg_locale.c.

2025-04-16 Thread Jeff Davis
Improve comment in regc_pg_locale.c. Reported-by: Noah Misch Reviewed-by: Noah Misch Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b107744ce73782a996aaa65dfd9d1bb3c543503d Modified Files --

pgsql: Another unintentional behavior change in commit e9931bfb75.

2025-04-16 Thread Jeff Davis
Another unintentional behavior change in commit e9931bfb75. Reported-by: Noah Misch Reviewed-by: Noah Misch Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2e5353be2534aed99a714f99c8a193f85777e64a

Re: pgsql: Transfer statistics during pg_upgrade.

2025-04-08 Thread Jeff Davis
ame: mytable3; Type: STATISTICS DATA; ... If you still see a problem, please let me know. Regards, Jeff Davis

Re: pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-04-06 Thread Jeff Davis
to where 2a083ab807db has been applied. My mistake, backported through 16 now. Regards, Jeff Davis

pgsql: Fix unintentional 'NULL' string literal in pg_upgrade.

2025-04-06 Thread Jeff Davis
Fix unintentional 'NULL' string literal in pg_upgrade. Introduced in 2a083ab807. Note: backport of commit 945126234b, which was missed at the time. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Michael Paquier Backpatch-through: 16 Bra

pgsql: Fix unintentional 'NULL' string literal in pg_upgrade.

2025-04-06 Thread Jeff Davis
Fix unintentional 'NULL' string literal in pg_upgrade. Introduced in 2a083ab807. Note: backport of commit 945126234b, which was missed at the time. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Michael Paquier Backpatch-through: 16 Bra

pgsql: Create accessor functions for TupleHashEntry.

2025-04-05 Thread Jeff Davis
Create accessor functions for TupleHashEntry. Refactor for upcoming optimizations. Reviewed-by: David Rowley Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4d143509cbfae02

pgsql: Oversight in commit b81ffa13e3.

2025-04-04 Thread Jeff Davis
Oversight in commit b81ffa13e3. Should warn if a materialized view may be affected, as well. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3556c89321e8baa2242288bd4f015efd1e9d6be0 Modified Files -- src/bin/pg_upgrade/check.c | 4 1 file changed, 4

pgsql: Fix unintentional 'NULL' string literal in pg_upgrade.

2025-04-03 Thread Jeff Davis
Fix unintentional 'NULL' string literal in pg_upgrade. Introduced in 2a083ab807. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Michael Paquier Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/945126234bbc03

pgsql: pg_upgrade check for Unicode-dependent relations.

2025-04-03 Thread Jeff Davis
pg_upgrade check for Unicode-dependent relations. This check will not cause an upgrade failure, only a warning. Discussion: https://postgr.es/m/ef03d678b39a64392f4b12e0f59d1495c740969e.camel%40j-davis.com Reviewed-by: Peter Eisentraut Branch -- master Details --- https://git.postgresq

pgsql: Add relallfrozen to pg_dump statistics.

2025-03-30 Thread Jeff Davis
Add relallfrozen to pg_dump statistics. Author: Corey Huinker Discussion: https://postgr.es/m/CADkLM=descuf3dvhasadvduvrmb-5go0mhmo5u9nzgv6i7u...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4694aedf63bf5b5d91f766cb6d6d6d14a9e4434b Modified File

Re: pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-03-30 Thread Jeff Davis
back more versions successfully. I'm not sure what all of the reasons are, though. Regards, Jeff Davis From 64b895188c164795e0419c76470fb8c1aa5bfd06 Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Sun, 30 Mar 2025 09:22:03 -0700 Subject: [PATCH] fixup --- src/bin/pg_upgrade/pg_

Re: pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-03-29 Thread Jeff Davis
like you failed 1 test of 16. Looking at the commit, it seems you are escaping NULL as a literal. Regards, Jeff Davis

pgsql: Matview statistics depend on matview data.

2025-03-28 Thread Jeff Davis
Matview statistics depend on matview data. REFRESH MATERIALIZED VIEW replaces the storage, which resets statistics, so statistics must be restored afterward. If both statistics and data are being dumped for a materialized view, add a dependency from the former to the latter. Defer the statistics

pgsql: Add pg_dump --with-{schema|data|statistics} options.

2025-03-25 Thread Jeff Davis
Add pg_dump --with-{schema|data|statistics} options. By adding the positive variants of options, in addition to the negative variants that already exist, users can be explicit about what pg_dump should produce. Discussion: https://postgr.es/m/bd0513e4b1ea2b2f2d06f02720c6579711cb62a6.ca...@j-davi

pgsql: Stats: use schemaname/relname instead of regclass.

2025-03-25 Thread Jeff Davis
Stats: use schemaname/relname instead of regclass. For import and export, use schemaname/relname rather than regclass. This is more natural during export, fits with the other arguments better, and it gives better control over error handling in case we need to downgrade more errors to warnings. A

pgsql: Minor doc update for commit 99f8f3fbbc.

2025-03-25 Thread Jeff Davis
Minor doc update for commit 99f8f3fbbc. Author: Corey Huinker Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2a420f7995e415f4813fccf1c42ab29a3a32182f Modified Files -- doc/src/sgml/func.sgml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

pgsql: Add ExecCopySlotMinimalTupleExtra().

2025-03-24 Thread Jeff Davis
Add ExecCopySlotMinimalTupleExtra(). Allows an "extra" argument that allocates extra memory at the end of the MinimalTuple. This is important for callers that need to store additional data, but do not want to perform an additional allocation. Suggested-by: David Rowley Discussion: https://postg

pgsql: Remove 'additional' pointer from TupleHashEntryData.

2025-03-24 Thread Jeff Davis
Remove 'additional' pointer from TupleHashEntryData. Reduces memory required for hash aggregation by avoiding an allocation and a pointer in the TupleHashEntryData structure. That structure is used for all buckets, whether occupied or not, so the savings is substantial. Discussion: https://postg

pgsql: HashAgg: use Bump allocator for hash TupleHashTable entries.

2025-03-24 Thread Jeff Davis
HashAgg: use Bump allocator for hash TupleHashTable entries. The entries aren't freed until the entire hash table is destroyed, so use the Bump allocator to improve allocation speed, avoid wasting space on the chunk header, and avoid wasting space due to the power-of-two allocations. Discussion:

pgsql: Fix headerscheck warning.

2025-03-18 Thread Jeff Davis
Fix headerscheck warning. Reported-by: Tom Lane Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/549ea06e4217aca10d3a73dc09cf5018c51bc23a Modified Files -- src/common/unicode/generate-unicod

pgsql: Optimization for lower(), upper(), casefold() functions.

2025-03-15 Thread Jeff Davis
Optimization for lower(), upper(), casefold() functions. Improve performance and reduce table sizes for case mapping. The main case mapping table stores only 16-bit offsets, which can be used to look up the mapped code point in any of the case tables (fold, lower, upper, or title case). Simple ca

pgsql: Organize and deduplicate statistics import tests.

2025-03-15 Thread Jeff Davis
Organize and deduplicate statistics import tests. Author: Corey Huinker Reported-by: Melanie Plageman Discussion: https://postgr.es/m/CAAKRu_bWEqUfxhODfJ-XbZC75vq=P6DYOKK6biyey=ym1ah...@mail.gmail.com Discussion: https://postgr.es/m/[email protected]

pgsql: Refactor convert_case() to prepare for optimizations.

2025-03-12 Thread Jeff Davis
Refactor convert_case() to prepare for optimizations. Upcoming optimizations will add complexity to convert_case(). This patch reorganizes slightly so that the complexity can be contained within the logic to convert the case of a single character, rather than mixing it in with logic to iterate thr

pgsql: Don't convert to and from floats in pg_dump.

2025-03-08 Thread Jeff Davis
Don't convert to and from floats in pg_dump. Commit 8f427187db improved performance by remembering relation stats as native types rather than issuing a new query for each relation. Using native types is fine for integers like relpages; but reltuples is floating point. The commit controllled for t

pgsql: Address stats export review comments.

2025-03-07 Thread Jeff Davis
Address stats export review comments. Per discussion, did not use Jian He's patch exactly. Reported-by: jian he Reviewed-by: Corey Huinker Discussion: https://postgr.es/m/CACJufxFVq=tq9u1zrhwysbmi1t07gs9ff0ljscmco4hzmtz...@mail.gmail.com Discussion: https://postgr.es/m/CADkLM=f1n2_Vomq0gKab7x

pgsql: CREATE INDEX: don't update table stats if autovacuum=off.

2025-03-07 Thread Jeff Davis
CREATE INDEX: don't update table stats if autovacuum=off. We previously fixed this for binary upgrade in 71b66171d0, but a similar problem remained when dumping statistics without data. Fix by not opportunistically updating table stats during CREATE INDEX when autovacuum is disabled. For stats to

pgsql: Address stats import review comments.

2025-03-05 Thread Jeff Davis
Address stats import review comments. Reported-by: jian he Discussion: https://postgr.es/m/cacjufxhg9mbqozbjq4jrbcrbuo+t+sx4qlzx092rs_9b4sr...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/298944e8d80252820531309e5b73d7de7d85e2df Modified Files -

pgsql: Adjust pg_dump tag for relation stats.

2025-02-27 Thread Jeff Davis
Adjust pg_dump tag for relation stats. Do not use fmtId(), just use dobj->name directly, like for table data. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/424ededc580b03e1bcf8aff18a735e519c80061f Modified Files -- src/bin/pg_dump/pg_dump.c | 7 +-

pgsql: Remove stray diff introduced by a5cbdeb98a.

2025-02-26 Thread Jeff Davis
Remove stray diff introduced by a5cbdeb98a. Reported-by: Michael Paquier Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/15df9d7b5123b2b478886175c17cd0c0359d9996 Modified Files -- src/include

pgsql: Avoid unnecessary relation stats query in pg_dump.

2025-02-25 Thread Jeff Davis
Avoid unnecessary relation stats query in pg_dump. The few fields we need can be easily collected in getTables() and getIndexes() and stored in RelStatsInfo. Reviewed-by: Tom Lane Reported-by: Andres Freund Co-authored-by: Corey Huinker Co-authored-by: Jeff Davis Discussion: https

pgsql: pg_dump: prepare attribute stats query.

2025-02-25 Thread Jeff Davis
pg_dump: prepare attribute stats query. Follow precedent in pg_dump for preparing queries to improve performance. Also, simplify the query by removing unnecessary joins. Reviewed-by: Tom Lane Reported-by: Andres Freund Co-authored-by: Corey Huinker Co-authored-by: Jeff Davis Discussion

pgsql: Remove redundant pg_set_*_stats() variants.

2025-02-25 Thread Jeff Davis
Remove redundant pg_set_*_stats() variants. After commit f3dae2ae58, the primary purpose of separating the pg_set_*_stats() from the pg_restore_*_stats() variants was eliminated. Leave pg_restore_relation_stats() and pg_restore_attribute_stats(), which satisfy both purposes, and remove pg_set_rel

pgsql: Missing doc update for f3dae2ae58.

2025-02-24 Thread Jeff Davis
Missing doc update for f3dae2ae58. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/15601fa21a5509b83a871c39ab98671f560da905 Modified Files -- doc/src/sgml/func.sgml | 8 1 file changed, 8 deletions(-)

pgsql: Do not use in-place updates for statistics import.

2025-02-24 Thread Jeff Davis
Do not use in-place updates for statistics import. The use of in-place updates was originally there to follow the precedent of ANALYZE and to reduce the potential for bloat on pg_class. Per discussion, it's not worth the risks. Reported-by: Andres Freund Discussion: https://postgr.es/m/cpdanvzy

Re: pgsql: Trial fix for old cross-version upgrades.

2025-02-24 Thread Jeff Davis
x27;ll submit a patch to the -hackers thread. There are a few minor choices here that might get some discussion. Regards, Jeff Davis

Re: pgsql: Trial fix for old cross-version upgrades.

2025-02-22 Thread Jeff Davis
xversion-upgrade-REL_12_STABLE-HEAD I was puzzling through whether the attribute name uniqueness logic was doing something strange, but it's very simple. And the table and index should both be locked at the point of the syscache lookup. Regards, Jeff Davis

pgsql: Documentation fixups for dumping statistics.

2025-02-22 Thread Jeff Davis
Documentation fixups for dumping statistics. Reported-by: Hayato Kuroda (Fujitsu) Reported-by: Andrew Dunstan Discussion: https://postgr.es/m/oscpr01mb149665630030e7f54fda8b27bf5...@oscpr01mb14966.jpnprd01.prod.outlook.com Discussion: https://postgr.es/m/25d26774-25fa-46f2-9888-c6a707d1f...@du

Re: pgsql: Trial fix for old cross-version upgrades.

2025-02-21 Thread Jeff Davis
ormation to know which branches still work. That's a good idea and would be a big help. Regards, Jeff Davis

Re: pgsql: Trial fix for old cross-version upgrades.

2025-02-21 Thread Jeff Davis
cluster, autovacuum did have a chance to run, just not after the first dumpall. Regards, Jeff Davis

Re: pgsql: Trial fix for old cross-version upgrades.

2025-02-21 Thread Jeff Davis
On Thu, 2025-02-20 at 13:17 -0800, Jeff Davis wrote: > On Thu, 2025-02-20 at 18:30 +0000, Jeff Davis wrote: > > Trial fix for old cross-version upgrades. > > That fixed one problem, but there are other problems with 9.2 > upgrades. The version that I committed had the f

pgsql: Fix for pg_restore_attribute_stats().

2025-02-20 Thread Jeff Davis
Fix for pg_restore_attribute_stats(). Use RelationGetIndexExpressions() rather than rd_indexprs directly. Author: Corey Huinker Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b50a554cc84066577f0f0a3baafe2f1fac302006 Modified Files -- src/backend/stat

Re: pgsql: Trial fix for old cross-version upgrades.

2025-02-20 Thread Jeff Davis
On Thu, 2025-02-20 at 18:30 +, Jeff Davis wrote: > Trial fix for old cross-version upgrades. That fixed one problem, but there are other problems with 9.2 upgrades. And it looks like there's also a problem with upgrades from 12. Investigating... Regards, Jeff Davis

  1   2   3   4   5   6   >