pgsql: pg_dump: Preserve NO INHERIT on NOT NULL on inheritance children

2026-02-26 Thread Álvaro Herrera
pg_dump: Preserve NO INHERIT on NOT NULL on inheritance children When the constraint is printed without the column, we were not printing the NO INHERIT flag. Author: Jian He Backpatch-through: 18 Discussion: https://postgr.es/m/CACJufxEDEOO09G+OQFr=hmfr9zdlzbrov7+pj58h3_wej_k...@mail.gmail.com

pgsql: pg_dump: Preserve NO INHERIT on NOT NULL on inheritance children

2026-02-26 Thread Álvaro Herrera
pg_dump: Preserve NO INHERIT on NOT NULL on inheritance children When the constraint is printed without the column, we were not printing the NO INHERIT flag. Author: Jian He Backpatch-through: 18 Discussion: https://postgr.es/m/CACJufxEDEOO09G+OQFr=hmfr9zdlzbrov7+pj58h3_wej_k...@mail.gmail.com

pgsql: Reduce includes in pgstat.h

2026-02-26 Thread Álvaro Herrera
Reduce includes in pgstat.h The lack of fallout here is somewhat surprising. Author: Andres Freund Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7bb50dd7d6b9f3cbad005aeb6eb9e4a065481b25 Modified

pgsql: Add non-text output formats to pg_dumpall

2026-02-26 Thread Andrew Dunstan
Add non-text output formats to pg_dumpall pg_dumpall can now produce output in custom, directory, or tar formats in addition to plain text SQL scripts. When using non-text formats, pg_dumpall creates a directory containing: - toc.glo: global data (roles and tablespaces) in custom format - map.dat:

pgsql: instrumentation: Rename INSTR_TIME_LT macro to INSTR_TIME_GT

2026-02-26 Thread Andres Freund
instrumentation: Rename INSTR_TIME_LT macro to INSTR_TIME_GT This was incorrectly named "LT" for "larger than" in e5a5e0a90750d66, but that is against existing conventions, where "LT" means "less than". Clarify by using "GT" for "greater than" in macro name, and add a missing comment at the top of

pgsql: instrumentation: Drop INSTR_TIME_SET_CURRENT_LAZY macro

2026-02-26 Thread Andres Freund
instrumentation: Drop INSTR_TIME_SET_CURRENT_LAZY macro This macro had exactly one user in InstrStartNode, and the caller can instead use INSTR_TIME_IS_ZERO / INSTR_TIME_SET_CURRENT directly. This supports a future change that intends to modify the time source being used in the InstrStartNode cas

pgsql: Use CXXFLAGS instead of CFLAGS for linking C++ code

2026-02-26 Thread Tom Lane
Use CXXFLAGS instead of CFLAGS for linking C++ code Otherwise, this would break if using C and C++ compilers from different families and they understand different options. It already used the right flags for compiling, this is only for linking. Also, the meson setup already did this correctly.

pgsql: Use CXXFLAGS instead of CFLAGS for linking C++ code

2026-02-26 Thread Tom Lane
Use CXXFLAGS instead of CFLAGS for linking C++ code Otherwise, this would break if using C and C++ compilers from different families and they understand different options. It already used the right flags for compiling, this is only for linking. Also, the meson setup already did this correctly.

pgsql: Use CXXFLAGS instead of CFLAGS for linking C++ code

2026-02-26 Thread Tom Lane
Use CXXFLAGS instead of CFLAGS for linking C++ code Otherwise, this would break if using C and C++ compilers from different families and they understand different options. It already used the right flags for compiling, this is only for linking. Also, the meson setup already did this correctly.

pgsql: Use CXXFLAGS instead of CFLAGS for linking C++ code

2026-02-26 Thread Tom Lane
Use CXXFLAGS instead of CFLAGS for linking C++ code Otherwise, this would break if using C and C++ compilers from different families and they understand different options. It already used the right flags for compiling, this is only for linking. Also, the meson setup already did this correctly.

pgsql: Don't include latch.h in libpq/libpq.h

2026-02-26 Thread Álvaro Herrera
Don't include latch.h in libpq/libpq.h This reduces the inclusion footprint of latch.h a bit. Per suggestion from Andres Freund. Discussion: https://postgr.es/m/pap7mzhcxvuwlfdebjkh646ntyk4brtwm4dbocfpllwdccta5t@w3d7wz6mjpwv Branch -- master Details --- https://git.postgresql.org/pg/c

pgsql: Fix memory leaks in pg_locale_icu.c.

2026-02-26 Thread Jeff Davis
Fix memory leaks in pg_locale_icu.c. The backport prior to 18 requires minor modification due to code refactoring. Discussion: https://postgr.es/m/[email protected] Backpatch-through: 16 Branch -- REL_16_STABLE Details --- https://git.postgresql

pgsql: Fix memory leaks in pg_locale_icu.c.

2026-02-26 Thread Jeff Davis
Fix memory leaks in pg_locale_icu.c. The backport prior to 18 requires minor modification due to code refactoring. Discussion: https://postgr.es/m/[email protected] Backpatch-through: 16 Branch -- REL_18_STABLE Details --- https://git.postgresql

pgsql: Fix memory leaks in pg_locale_icu.c.

2026-02-26 Thread Jeff Davis
Fix memory leaks in pg_locale_icu.c. The backport prior to 18 requires minor modification due to code refactoring. Discussion: https://postgr.es/m/[email protected] Backpatch-through: 16 Branch -- REL_17_STABLE Details --- https://git.postgresql

pgsql: Fix memory leaks in pg_locale_icu.c.

2026-02-26 Thread Jeff Davis
Fix memory leaks in pg_locale_icu.c. The backport prior to 18 requires minor modification due to code refactoring. Discussion: https://postgr.es/m/[email protected] Backpatch-through: 16 Branch -- master Details --- https://git.postgresql.org/pg

pgsql: Fix more multibyte issues in ltree.

2026-02-26 Thread Jeff Davis
Fix more multibyte issues in ltree. Commit 84d5efa7e3 missed some multibyte issues caused by short-circuit logic in the callers. The callers assumed that if the predicate string is longer than the label string, then it couldn't possibly be a match, but it can be when using case-insensitive matchin

pgsql: Fix more multibyte issues in ltree.

2026-02-26 Thread Jeff Davis
Fix more multibyte issues in ltree. Commit 84d5efa7e3 missed some multibyte issues caused by short-circuit logic in the callers. The callers assumed that if the predicate string is longer than the label string, then it couldn't possibly be a match, but it can be when using case-insensitive matchin

pgsql: Fix more multibyte issues in ltree.

2026-02-26 Thread Jeff Davis
Fix more multibyte issues in ltree. Commit 84d5efa7e3 missed some multibyte issues caused by short-circuit logic in the callers. The callers assumed that if the predicate string is longer than the label string, then it couldn't possibly be a match, but it can be when using case-insensitive matchin

pgsql: Fix more multibyte issues in ltree.

2026-02-26 Thread Jeff Davis
Fix more multibyte issues in ltree. Commit 84d5efa7e3 missed some multibyte issues caused by short-circuit logic in the callers. The callers assumed that if the predicate string is longer than the label string, then it couldn't possibly be a match, but it can be when using case-insensitive matchin

pgsql: Fix more multibyte issues in ltree.

2026-02-26 Thread Jeff Davis
Fix more multibyte issues in ltree. Commit 84d5efa7e3 missed some multibyte issues caused by short-circuit logic in the callers. The callers assumed that if the predicate string is longer than the label string, then it couldn't possibly be a match, but it can be when using case-insensitive matchin

pgsql: Fix more multibyte issues in ltree.

2026-02-26 Thread Jeff Davis
Fix more multibyte issues in ltree. Commit 84d5efa7e3 missed some multibyte issues caused by short-circuit logic in the callers. The callers assumed that if the predicate string is longer than the label string, then it couldn't possibly be a match, but it can be when using case-insensitive matchin

pgsql: Remove table_scan_analyze_next_tuple unneeded parameter OldestXm

2026-02-26 Thread Melanie Plageman
Remove table_scan_analyze_next_tuple unneeded parameter OldestXmin heapam_scan_analyze_next_tuple() doesn't distinguish between dead and recently dead tuples when counting them, so it doesn't need OldestXmin. GetOldestNonRemovableTransactionId() isn't free, so removing it is a win. Looking at oth

pgsql: Simplify visibility check in heap_page_would_be_all_visible()

2026-02-26 Thread Melanie Plageman
Simplify visibility check in heap_page_would_be_all_visible() heap_page_would_be_all_visible() does not need to distinguish between HEAPTUPLE_RECENTLY_DEAD and HEAPTUPLE_DEAD tuples: any tuple in a state other than HEAPTUPLE_LIVE means the page is not all-visible and heap_page_would_be_all_visible

pgsql: Yet another ltree fix for REL_18_STABLE.

2026-02-26 Thread Jeff Davis
Yet another ltree fix for REL_18_STABLE. Fix buildfarm failure from code that's only present in version 18, introduced by commit b3c2a3d386. Reported-by: Tom Lane Discussion: https://postgr.es/m/[email protected] Branch -- REL_18_STABLE Details --- https://git.postgresql.

Re: pgsql: Fix more multibyte issues in ltree.

2026-02-26 Thread Jeff Davis
On Thu, 2026-02-26 at 16:40 -0500, Tom Lane wrote: > Jeff Davis writes: > > Fix more multibyte issues in ltree. > > Buildfarm is showing there is something wrong with this, > but only in v18 branch: Investigating... Regards, Jeff Davis

pgsql: Fix Solution.pm for change in pg_config.h contents.

2026-02-26 Thread Tom Lane
Fix Solution.pm for change in pg_config.h contents. In commits 1d97e4788 et al, I forgot that pre-v17 branches require updating Solution.pm when changing the set of symbols generated in pg_config.h. Per buildfarm. Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitd

pgsql: Fix Solution.pm for change in pg_config.h contents.

2026-02-26 Thread Tom Lane
Fix Solution.pm for change in pg_config.h contents. In commits 1d97e4788 et al, I forgot that pre-v17 branches require updating Solution.pm when changing the set of symbols generated in pg_config.h. Per buildfarm. Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitd

pgsql: Fix Solution.pm for change in pg_config.h contents.

2026-02-26 Thread Tom Lane
Fix Solution.pm for change in pg_config.h contents. In commits 1d97e4788 et al, I forgot that pre-v17 branches require updating Solution.pm when changing the set of symbols generated in pg_config.h. Per buildfarm. Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitd

pgsql: Rename LVRelState VM-related logging counters

2026-02-26 Thread Melanie Plageman
Rename LVRelState VM-related logging counters The LVRelState fields that track newly all-visible/all-frozen pages were previously named vm_new_visible_pages, vm_new_frozen_pages, and vm_new_visible_frozen_pages. The correct terminology is all-visible and all-frozen; omitting “all” was open to misi

Re: pgsql: Fix more multibyte issues in ltree.

2026-02-26 Thread Tom Lane
Jeff Davis writes: > Fix more multibyte issues in ltree. Buildfarm is showing there is something wrong with this, but only in v18 branch: diff -U3 /Users/buildfarm/bf-data/REL_18_STABLE/pgsql.build/contrib/ltree/expected/ltree.out /Users/buildfarm/bf-data/REL_18_STABLE/pgsql.build/contrib/ltr