pgsql: Doc: Add relfrozenxid Tip to XID wraparound section.

2022-04-02 Thread Peter Geoghegan
Doc: Add relfrozenxid Tip to XID wraparound section. VACUUM VERBOSE and autovacuum log reports were taught to report the details of how VACUUM advanced relfrozenxid (and relminmxid) by commit 872770fd. Highlight this by adding a "Tip" to the documentation, next to related discussion of age(relfro

Re: pgsql: Specialize tuplesort routines for different kinds of abbreviated

2022-04-02 Thread Andres Freund
Hi, On 2022-04-02 13:15:57 -0700, Andres Freund wrote: > There's definitely something borked - looks like this is ending up with bogus > pointers? Using rr to set a watchpoint on isnull1, and continuing backward I > see the memory written to with the following stack: Looks like it's just plain ol

Re: pgsql: Specialize tuplesort routines for different kinds of abbreviated

2022-04-02 Thread Andres Freund
Hi, On 2022-04-02 13:15:57 -0700, Andres Freund wrote: > I get a backtrace to investigate. Unfortunately abort_on_error=1 also removes > the nicer error message :(. So I ran both. This bit was just me being stupid and missing the error message... > with that applied > CFLAGS=-fsanitize=alignmen

Re: pgsql: Specialize tuplesort routines for different kinds of abbreviated

2022-04-02 Thread Andres Freund
Hi, On 2022-04-02 16:06:40 +0700, John Naylor wrote: > So far, kestrel and tamandua don't like this, and they both use > "-fsanitize=undefined,alignment". I'll try to reproduce locally in a > bit. Just hit this in my development environment. FWIW, I found it hard to work with ubsan without apply

pgsql: Fix overflow hazards in interval input and output conversions.

2022-04-02 Thread Tom Lane
Fix overflow hazards in interval input and output conversions. DecodeInterval (interval input) was careless about integer-overflow hazards, allowing bogus results to be obtained for sufficiently large input values. Also, since it initially converted the input to a "struct tm", it was impossible t

pgsql: Doc: Clarify the role of aggressive VACUUMs.

2022-04-02 Thread Peter Geoghegan
Doc: Clarify the role of aggressive VACUUMs. Adjust the documentation's coverage of aggressive VACUUMs to make it clearer that aggressive vacuuming isn't always strictly necessary. It's possible for non-aggressive VACUUMs to advance relfrozenxid/relminmxid without fail, given the right workload c

pgsql: Add a couple more tests for interval input decoding.

2022-04-02 Thread Tom Lane
Add a couple more tests for interval input decoding. Cover some cases that would have been broken by a proposed patch, but we failed to notice for lack of test coverage. I'm pushing this separately mainly to memorialize that it *is* our historical behavior. Discussion: https://postgr.es/m/134449

pgsql: vacuumlazy.c: Clean up variable declarations.

2022-04-02 Thread Peter Geoghegan
vacuumlazy.c: Clean up variable declarations. Move some of the heap_vacuum_rel() instrumentation related variables to the scope where they're actually needed. Also reorder some of the variable declarations at the start of heap_vacuum_rel() so that related variables appear together. Branch --

pgsql: Use has_privs_for_roles for predefined role checks: round 2

2022-04-02 Thread Joe Conway
Use has_privs_for_roles for predefined role checks: round 2 Similar to commit 6198420ad, replace is_member_of_role with has_privs_for_role for predefined role access checks in recently committed basebackup code. In passing fix a double-word error in a nearby comment. Discussion: https://postgr.e

pgsql: Allow CLUSTER on partitioned tables

2022-04-02 Thread Alvaro Herrera
Allow CLUSTER on partitioned tables This is essentially the same as applying VACUUM FULL to a partitioned table, which has been supported since commit 3c3bb99330aa (March 2017). While there's no great use case in applying CLUSTER to partitioned tables, we don't have any strong reason not to allow

pgsql: Doc: Remove MultiXact wraparound section link.

2022-04-02 Thread Peter Geoghegan
Doc: Remove MultiXact wraparound section link. Remove circular "25.1.5.1. Multixacts And Wraparound" link that references the section that the link itself appears in. An explanation of MultiXactId age appears only a few sentences before the link, so there's no question that the link is superfluou

pgsql: Doc: Remove MultiXact wraparound section link.

2022-04-02 Thread Peter Geoghegan
Doc: Remove MultiXact wraparound section link. Remove circular "25.1.5.1. Multixacts And Wraparound" link that references the section that the link itself appears in. An explanation of MultiXactId age appears only a few sentences before the link, so there's no question that the link is superfluou

pgsql: Remove excess semicolon in MERGE docs

2022-04-02 Thread Alvaro Herrera
Remove excess semicolon in MERGE docs Author: Euler Taveira Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/0af504733c6e9198067705822e7527dc4e60b4f6 Modified Files -

Re: pgsql: SQL/JSON query functions

2022-04-02 Thread Andrew Dunstan
On 4/2/22 01:20, Tom Lane wrote: > Michael Paquier writes: >> On Tue, Mar 29, 2022 at 08:57:37PM +, Andrew Dunstan wrote: >>> SQL/JSON query functions >> Some of the tests introduced in this commit are a bit unstable when >> run through a primary/standby setup. > Yeah, looks like some of the

pgsql: Use ORDER BY in catalog results in SQL/JSON tests

2022-04-02 Thread Andrew Dunstan
Use ORDER BY in catalog results in SQL/JSON tests The buildfarm has revealed some instability in results from catalog queries in tests from commit 1a36bc9dba8. Cure this by adding ORDER BY to such queries. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c6dc6a0124fa

Re: pgsql: Specialize tuplesort routines for different kinds of abbreviated

2022-04-02 Thread John Naylor
So far, kestrel and tamandua don't like this, and they both use "-fsanitize=undefined,alignment". I'll try to reproduce locally in a bit. -- John Naylor EDB: http://www.enterprisedb.com

pgsql: Specialize tuplesort routines for different kinds of abbreviated

2022-04-02 Thread John Naylor
Specialize tuplesort routines for different kinds of abbreviated keys Previously, the specialized tuplesort routine inlined handling for reverse-sort and NULLs-ordering but called the datum comparator via a pointer in the SortSupport struct parameter. Testing has showed that we can get a useful pe