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/f379d0aeefe8effe13302a436bc28f549f09e924.ca...@j-davis.com

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/f379d0aeefe8effe13302a436bc28f549f09e924.ca...@j-davis.com

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/8ce896d1a05040905cc1a3afbc04e94d8e95669a.ca...@j-davis.com 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/8ce896d1a05040905cc1a3afbc04e94d8e95669a.ca...@j-davis.com 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/c955d292-b92d-42d1-a2a0-1ec6715a2...@illuminatedcomputing.com 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/c955d292-b92d-42d1-a2a0-1ec6715a2...@illuminatedcomputing.com 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/9875f7f9-50f1-4b5d-86fc-ee8b03e8c...@eisentraut.org 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/9875f7f9-50f1-4b5d-86fc-ee8b03e8c...@eisentraut.org 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/9875f7f9-50f1-4b5d-86fc-ee8b03e8c...@eisentraut.org 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/9875f7f9-50f1-4b5d-86fc-ee8b03e8c...@eisentraut.org 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/73959a14-267b-49c1-8293-291b17568...@manitou-mail.org 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/20250412123430.8c.nmi...@google.com 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/20250412123430.8c.nmi...@google.com 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/e852442da35b4f31acc600ed98bbee0f12e65e0c.ca...@j-davis.com 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/e852442da35b4f31acc600ed98bbee0f12e65e0c.ca...@j-davis.com 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/1cc3b400a0e8eead18ff967436fa9e42c0c14cfb.ca...@j-davis.com 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/e852442da35b4f31acc600ed98bbee0f12e65e0c.ca...@j-davis.com 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/93731.1742310...@sss.pgh.pa.us 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/CADkLM=f1n2_Vomq0gKab7xdxDHmJGgn=de48p8fzqop3mrs...@mail.gmai

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/z77ikjmmfbffn...@paquier.xyz 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

pgsql: Trial fix for old cross-version upgrades.

2025-02-20 Thread Jeff Davis
Trial fix for old cross-version upgrades. Per buildfarm and reports, it seems that 9.X to 18 upgrades were failing after commit 1fd1bd8710 due to an incorrect regex. Loosen the regex to accommodate older versions. Reported-by: vignesh C Reported-by: Andrew Dunstan Discussion: https://postgr.es

pgsql: Transfer statistics during pg_upgrade.

2025-02-20 Thread Jeff Davis
previous --schema-only and --data-only options. Statistics are in SECTION_DATA, unless the object itself is in SECTION_POST_DATA. The stats are represented as calls to pg_restore_relation_stats() and pg_restore_attribute_stats(). Author: Corey Huinker, Jeff Davis Reviewed-by: Jian He Discussion

pgsql: Update outdated comments in nodeAgg.c.

2025-02-18 Thread Jeff Davis
Update outdated comments in nodeAgg.c. Author: Zhang Mingli Reviewed-by: Richard Guo Discussion: https://postgr.es/m/198a8d1e-0792-4e7f-828e-902aa342f36e@Spark Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a1f7f80bfef105c8c02153e8832d4106df3cf459 Modified Files -

pgsql: Injection points for hash aggregation.

2025-02-11 Thread Jeff Davis
Injection points for hash aggregation. Requires adding a guard against shift-by-32. Previously, that was impossible because the number of partitions was always greater than 1, but a new injection point can force the number of partitions to 1. Discussion: https://postgr.es/m/ff4e59305e5d689e03cd2

pgsql: Lock table in ShareUpdateExclusive when importing index stats.

2025-02-10 Thread Jeff Davis
Lock table in ShareUpdateExclusive when importing index stats. Follow locking behavior of ANALYZE when importing statistics. In particular, when importing index statistics, the table must be locked in ShareUpdateExclusive mode. Fixes bug reportd by Jian He. ANALYZE doesn't update statistics on pa

pgsql: Fix PDF doc build.

2025-01-25 Thread Jeff Davis
Fix PDF doc build. Reported-by: Tom Lane Discussion: https://postgr.es/m/608525.1737781...@sss.pgh.pa.us Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d2ca16bb509c453eac181c1ef805ff55289df779 Modified Files -- doc/src/sgml/func.sgml | 12

pgsql: Add SQL function CASEFOLD().

2025-01-24 Thread Jeff Davis
Add SQL function CASEFOLD(). Useful for caseless matching. Similar to LOWER(), but avoids edge-case problems with using LOWER() for caseless matching. For collations that support it, CASEFOLD() handles characters with more than two case variations or multi-character case variations. Some characte

pgsql: Add support for Unicode case folding.

2025-01-23 Thread Jeff Davis
Add support for Unicode case folding. Expand case mapping tables to include entries for case folding, which are parsed from CaseFolding.txt. Discussion: https://postgr.es/m/a1886ddfcd8f60cb3e905c93009b646b4cfb74c5.camel%40j-davis.com Branch -- master Details --- https://git.postgresql.

pgsql: Support Unicode full case mapping and conversion.

2025-01-17 Thread Jeff Davis
Support Unicode full case mapping and conversion. Generate tables from Unicode SpecialCasing.txt to support more sophisticated case mapping behavior: * support case mappings to multiple codepoints, such as "ß" uppercasing to "SS" * support conditional case mappings, such as the "final sigma"

pgsql: Support PG_UNICODE_FAST locale in the builtin collation provider

2025-01-17 Thread Jeff Davis
Support PG_UNICODE_FAST locale in the builtin collation provider. The PG_UNICODE_FAST locale uses code point sort order (fast, memcmp-based) combined with Unicode character semantics. The character semantics are based on Unicode full case mapping. Full case mapping can map a single codepoint to m

pgsql: Revert "TupleHashTable: store additional data along with tuple."

2025-01-13 Thread Jeff Davis
Revert "TupleHashTable: store additional data along with tuple." This reverts commit e0ece2a981ee9068f50c4423e303836c2585eb02 due to performance regressions. Reported-by: David Rowley Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b4a07f532b40a64fb4714a3f7ab606343

pgsql: Fix redefinition of type in commit e0ece2a981.

2025-01-10 Thread Jeff Davis
Fix redefinition of type in commit e0ece2a981. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ceb2855522940d5aaae4c6e5eed493d60e3196ce Modified Files -- src/backend/executor/execGrouping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

pgsql: TupleHashTable: store additional data along with tuple.

2025-01-10 Thread Jeff Davis
TupleHashTable: store additional data along with tuple. Previously, the caller needed to allocate the memory and the TupleHashTable would store a pointer to it. That wastes space for the palloc overhead as well as the size of the pointer itself. Now, the TupleHashTable relies on the caller to cor

pgsql: Fix duplicate typedef from commit a2f17f004d.

2025-01-08 Thread Jeff Davis
Fix duplicate typedef from commit a2f17f004d. Reported-by: Thomas Munro Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/229e7793d96954739d3fb9b37e2ccf77c2803f07 Modified Files -- src/include/utils/pg_locale.h | 2 -- 1 file changed, 2 deletions(-)

pgsql: Control collation behavior with a method table.

2025-01-08 Thread Jeff Davis
Control collation behavior with a method table. Previously, behavior branched based on the provider. A method table is less error-prone and more flexible. The ctype behavior will be addressed in an upcoming commit. Reviewed-by: Andreas Karlsson Discussion: https://postgr.es/m/2830211e1b6e6a2e26

pgsql: Move code for collation version into provider-specific files.

2025-01-08 Thread Jeff Davis
Move code for collation version into provider-specific files. Author: Andreas Karlsson Discussion: https://postgr.es/m/4548a168-62cd-457b-8d06-9ba7b985c477%40proxel.se Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4f5cef2607c1f8804d4b54250642aaf586745b0e Modified

pgsql: ExecInitAgg: update aggstate->numaggs and ->numtrans earlier.

2025-01-07 Thread Jeff Davis
ExecInitAgg: update aggstate->numaggs and ->numtrans earlier. Functions hash_agg_entry_size() and build_hash_tables() make use of those values for memory size estimates. Because this change only affects memory estimates, don't backpatch. Discussion: https://postgr.es/m/7530bd8783b1a78d53a3c7038

pgsql: nodeSetOp.c: missing additionalsize for BuildTupleHashTable().

2025-01-07 Thread Jeff Davis
nodeSetOp.c: missing additionalsize for BuildTupleHashTable(). Provide additionalsize argument, which can affect the calculations for 'nbuckets'. Also, future work for Hash Aggregation will rely on the correct additionalsize. Discussion: https://postgr.es/m/7530bd8783b1a78d53a3c70383e38d8da0a5ff

pgsql: Remove unused TupleHashTableData->entrysize.

2025-01-07 Thread Jeff Davis
Remove unused TupleHashTableData->entrysize. Discussion: https://postgr.es/m/7530bd8783b1a78d53a3c70383e38d8da0a5ffe5.camel%40j-davis.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8a96faedc408b447acd1570d2f51300bcec34959 Modified Files -- src/bac

pgsql: Add missing typedefs.list entry for AggStatePerGroupData.

2025-01-07 Thread Jeff Davis
Add missing typedefs.list entry for AggStatePerGroupData. Discussion: https://postgr.es/m/7530bd8783b1a78d53a3c70383e38d8da0a5ffe5.camel%40j-davis.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/834c9e807cf12e355f06479a8b1f7a82aba77315 Modified Files -

pgsql: Refactor string case conversion into provider-specific files.

2024-12-16 Thread Jeff Davis
Refactor string case conversion into provider-specific files. Create API entry points pg_strlower(), etc., that work with any provider and give the caller control over the destination buffer. Then, move provider-specific logic into pg_locale_builtin.c, pg_locale_icu.c, and pg_locale_libc.c as appr

pgsql: Use in-place updates for pg_restore_relation_stats().

2024-12-10 Thread Jeff Davis
Use in-place updates for pg_restore_relation_stats(). This matches the behavior of vac_update_relstats(), which is important to avoid bloating pg_class. Author: Corey Huinker Discussion: https://postgr.es/m/CADkLM=fc3je+ufv3gshqjjssf+t8674rxpuxw62el55mueq...@mail.gmail.com Branch -- master

pgsql: Comment fix: "buffer context lock" to "buffer content lock".

2024-12-06 Thread Jeff Davis
Comment fix: "buffer context lock" to "buffer content lock". The term "buffer context lock" is outdated as of commit 5d5087363d. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ffe003cae1ff28b698f1769e46e3dc14b5516070 Modified Files -- src/backend/acces

pgsql: Move check for ucol_strcollUTF8 to pg_locale_icu.c

2024-12-03 Thread Jeff Davis
Move check for ucol_strcollUTF8 to pg_locale_icu.c The result of the check is only used by pg_locale_icu.c. Author: Andreas Karlsson Discussion: https://postgr.es/m/4548a168-62cd-457b-8d06-9ba7b985c...@proxel.se Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7167e

pgsql: Perform provider-specific initialization in new functions.

2024-12-02 Thread Jeff Davis
Perform provider-specific initialization in new functions. Reviewed-by: Andreas Karlsson Discussion: https://postgr.es/m/4548a168-62cd-457b-8d06-9ba7b985c...@proxel.se Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1ba0782ce90cb4261098de59b49ae5cb2326566b Modified

pgsql: Fix unintentional behavior change in commit e9931bfb75.

2024-12-02 Thread Jeff Davis
Fix unintentional behavior change in commit e9931bfb75. Prior to that commit, there was special case to use ASCII case mapping behavior for the libc provider with a single-byte encoding when that's the default collation. Commit e9931bfb75 mistakenly eliminated that special case; this commit restor

pgsql: Disallow modifying statistics on system columns.

2024-11-22 Thread Jeff Davis
Disallow modifying statistics on system columns. Reported-by: Heikki Linnakangas Discussion: https://postgr.es/m/df3e1c41-4e6c-40ad-9636-98deefe48...@iki.fi Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/869ee4f10eca2acda3d2210198a46d5029a569fc Modified Files

pgsql: Fix lc_collate_is_c() when LC_COLLATE != LC_CTYPE.

2024-11-06 Thread Jeff Davis
Fix lc_collate_is_c() when LC_COLLATE != LC_CTYPE. An unfortunate typo in commit 2d819a08a1 can cause wrong results when the default collation provider is libc, LC_CTYPE=C, and LC_COLLATE is a real locale. Users with this combination of settings must REINDEX all affected indexes. The same typo ca

pgsql: Add missing CommandCounterIncrement() in stats import functions.

2024-10-29 Thread Jeff Davis
Add missing CommandCounterIncrement() in stats import functions. Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/98b2fcf0-f701-369e-d63d-6be9739ce...@gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f22e436bff779fee4e1ce49733ba5791d4634fb1 Mo

pgsql: Refactor the code to create a pg_locale_t into new function.

2024-10-25 Thread Jeff Davis
Refactor the code to create a pg_locale_t into new function. Reviewed-by: Andreas Karlsson Discussion: https://postgr.es/m/59da7ee4-5e1a-4727-b464-a603c6ed8...@proxel.se Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3aa2373c114124f62e80016d8939331fcb4d5586 Modifi

pgsql: Add functions pg_restore_relation_stats(), pg_restore_attribute_

2024-10-24 Thread Jeff Davis
Add functions pg_restore_relation_stats(), pg_restore_attribute_stats(). Similar to the pg_set_*_stats() functions, except with a variadic signature that's designed to be more future-proof. Additionally, most problems are reported as WARNINGs rather than ERRORs, allowing most stats to be restored

pgsql: Improve pg_set_attribute_stats() error message.

2024-10-23 Thread Jeff Davis
Improve pg_set_attribute_stats() error message. Previously, an invalid attribute name was caught, but the error message was unhelpful. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4b096c67e0eed81e287094b9692fff72b9ea3eef Modified Files -- src/backend

pgsql: Another documentation fixup.

2024-10-23 Thread Jeff Davis
Another documentation fixup. Reported-by: Erik Rijkers Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/0a3f9838218f6f7ff825bb0af00177681fef83ce Modified Files -- doc/src/sgml/func.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

  1   2   3   4   5   6   >