Re: enable_incremental_sort changes query behavior

2020-10-03 Thread James Coleman
On Sat, Oct 3, 2020 at 5:44 PM Tomas Vondra wrote: > > On Sat, Oct 03, 2020 at 10:50:06AM -0400, James Coleman wrote: > >On Fri, Oct 2, 2020 at 11:16 PM James Coleman wrote: > >> > >> On Fri, Oct 2, 2020 at 7:07 PM James Coleman wrote: > >> > > >> > On Fri, Oct 2, 2020 at 6:28 PM Tomas Vondra >

Re: terminate called after throwing an instance of 'std::bad_alloc'

2020-10-03 Thread Andres Freund
Hi, On 2020-10-03 18:30:46 -0500, Justin Pryzby wrote: > On Sat, Oct 03, 2020 at 04:01:49PM -0700, Andres Freund wrote: > > > I was able to make a small, apparent leak like so. This applies to > > > postgis3.0/postgres12/LLVM5/centos7, and > > > postgis3.1alpha/postgres13/LLVM9/centos8. > > > > >

Re: terminate called after throwing an instance of 'std::bad_alloc'

2020-10-03 Thread Justin Pryzby
On Sat, Oct 03, 2020 at 04:01:49PM -0700, Andres Freund wrote: > The below turned out to be somewhat obsoleted by what you wrote below, > which I unfortunately hadn't yet read - but I think it's still good > information, so I'm not gonna delete it: Right, I understand that RES RAM might includes s

Re: terminate called after throwing an instance of 'std::bad_alloc'

2020-10-03 Thread Andres Freund
Hi, On 2020-10-03 17:02:36 -0500, Justin Pryzby wrote: > We didn't use JIT with v12, but I've been setting jit=on along with v13 > upgrades, so I was trying to convince myself that there's a change in v13, and > not just our config.. > > I've seen repeated OOMs on a small number of reports. It lo

Re: terminate called after throwing an instance of 'std::bad_alloc'

2020-10-03 Thread Justin Pryzby
On Wed, Sep 30, 2020 at 09:16:09PM -0500, Justin Pryzby wrote: > Our DBs use postgis, and today's crash JOINs to the table with geometry > columns, but does not use them at all. I'm wrong here - it does return the geometry columns. We didn't use JIT with v12, but I've been setting jit=on along wi

Re: enable_incremental_sort changes query behavior

2020-10-03 Thread Tomas Vondra
On Sat, Oct 03, 2020 at 10:50:06AM -0400, James Coleman wrote: On Fri, Oct 2, 2020 at 11:16 PM James Coleman wrote: On Fri, Oct 2, 2020 at 7:07 PM James Coleman wrote: > > On Fri, Oct 2, 2020 at 6:28 PM Tomas Vondra > wrote: > > > > On Fri, Oct 02, 2020 at 05:45:52PM -0400, James Coleman wro

Re: Add header support to text format and matching feature

2020-10-03 Thread Rémi Lapeyre
> I would agree that this is a bug because we are failing to detect > what's actually a redundant option here as the first option still > causes the flag to be set to false, but that's not something worth a > back-patch IMO. What we are looking here is something similar > to what is done with "fo

Re: Optimize memory allocation code

2020-10-03 Thread Tomas Vondra
On Fri, Sep 25, 2020 at 07:37:07PM -0500, Merlin Moncure wrote: On Fri, Sep 25, 2020 at 7:32 PM Li Japin wrote: > On Sep 26, 2020, at 8:09 AM, Julien Rouhaud wrote: > > Hi, > > On Sat, Sep 26, 2020 at 12:14 AM Li Japin wrote: >> >> Hi, hackers! >> >> I find the palloc0() is similar to the

Re: POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Alexander Korotkov
On Sat, Oct 3, 2020 at 6:37 PM Tom Lane wrote: > Alexander Korotkov writes: > > I personally don't have an exact understanding of how strict we are > > about marking functions immutable. For example, > > to_tsvector(regconfig, text) is immutable. > > Yeah. This is in fact wrong, because a TS co

Re: Incorrect assumption in heap_prepare_freeze_tuple

2020-10-03 Thread Andres Freund
Hi, On 2020-10-03 19:57:03 +0530, Kuntal Ghosh wrote: > You've also mentioned that HEAPTUPLE_DEAD case I'm referring to can > only be hit for for tuples that are *newer* than OldestXmin but become > DEAD (instead of RECENTLY_DEAD) because the inserting transaction > aborted. But, I don't see that'

Re: Add primary keys to system catalogs

2020-10-03 Thread John Naylor
On Sat, Oct 3, 2020 at 9:27 AM Craig Ringer wrote: > So a big +1 from me for the idea. Especially if we ensure psql recognises when the relation 'oid' attribute has a declared PK and includes it in the column list. Oid has been in the normal column list since v12 when it stopped being a system co

Re: Add primary keys to system catalogs

2020-10-03 Thread Bruce Momjian
On Sat, Oct 3, 2020 at 09:27:02PM +0800, Craig Ringer wrote: > > > On Sat, 3 Oct 2020, 14:40 Peter Eisentraut, > wrote: > > I saw someone ask once for a schema diagram of the system catalogs. > Things like that have occasionally been produced manually, but they are > not regularly

Re: vs formatting in the docs

2020-10-03 Thread Bruce Momjian
On Sat, Oct 3, 2020 at 04:57:34PM +0200, Peter Eisentraut wrote: > On 2020-09-25 07:38, Peter Eisentraut wrote: > > So, based on that, I think the patch proposed here is not the right one, > > and we should instead be marking up the link sources appropriately. > > I have committed a fix for this:

Re: buildfarm animal shoveler failing with "Illegal instruction"

2020-10-03 Thread Tom Lane
Andres Freund writes: > On 2020-10-02 10:45:58 -0700, Mark Wong wrote: >> I went ahead and stopped the jobs to run with clang 3.9. This is also >> the same system that was running clang 3.8 too. I tried looking for EOL >> dates, but had trouble finding anything... But I can change the >> optimi

Re: POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Tom Lane
Alexander Korotkov writes: > I personally don't have an exact understanding of how strict we are > about marking functions immutable. For example, > to_tsvector(regconfig, text) is immutable. Yeah. This is in fact wrong, because a TS configuration can *very* easily be changed by the user. We h

Re: POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Tom Lane
Tomas Vondra writes: > As for the patch, I wonder if we want to make this change. I'm not very > familiar with how unaccent works, but if changes to unicode rules would > really silently break indexes, it's kinda similar to the collation > issues caused by glibc updates. And we've generally consid

Re: POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Alexander Korotkov
On Sat, Oct 3, 2020 at 4:01 PM Tomas Vondra wrote: > On Sat, Oct 03, 2020 at 02:13:01PM +0200, Petru Ghita wrote: > >As instructed by Alexander Korotkov, I'm linking the patch: > > > >https://github.com/petru-ghita/postgres/commit/d6d1f340cd34db8176744ede7f0fe588d870a33f > > > > Please submit an a

Re: vs formatting in the docs

2020-10-03 Thread Peter Eisentraut
On 2020-09-25 07:38, Peter Eisentraut wrote: > So, based on that, I think the patch proposed here is not the right one, > and we should instead be marking up the link sources appropriately. I have committed a fix for this: Improve vs. formatting in the documentation SQL commands are ge

Re: enable_incremental_sort changes query behavior

2020-10-03 Thread Jaime Casanova
On Sat, 3 Oct 2020 at 08:15, James Coleman wrote: > > Jaime: was the backtrace in the original report by any chance record > from breakpointing in the first call to get_sortgroupref_tle() (and > one that successfully returned a sort group ref) rather than a call > that hit the elog error on line 3

Re: enable_incremental_sort changes query behavior

2020-10-03 Thread James Coleman
On Fri, Oct 2, 2020 at 11:16 PM James Coleman wrote: > > On Fri, Oct 2, 2020 at 7:07 PM James Coleman wrote: > > > > On Fri, Oct 2, 2020 at 6:28 PM Tomas Vondra > > wrote: > > > > > > On Fri, Oct 02, 2020 at 05:45:52PM -0400, James Coleman wrote: > > > >On Fri, Oct 2, 2020 at 4:56 PM Tomas Vondr

Re: Incorrect assumption in heap_prepare_freeze_tuple

2020-10-03 Thread Kuntal Ghosh
On Sat, Oct 3, 2020 at 1:06 PM Andres Freund wrote: > On 2020-10-03 12:58:01 +0530, Kuntal Ghosh wrote: > > IIUC, there can be a HOT-updated tuple which is not initially pruned > > by heap_page_prune but later diagnosed HEAPTUPLE_DEAD by > > HeapTupleSatisfiesVacuum (Since OldestXmin can be update

Re: Add primary keys to system catalogs

2020-10-03 Thread Craig Ringer
On Sat, 3 Oct 2020, 14:40 Peter Eisentraut, < peter.eisentr...@2ndquadrant.com> wrote: > I saw someone ask once for a schema diagram of the system catalogs. > Things like that have occasionally been produced manually, but they are > not regularly updated. That made me wonder, why can't we add pri

Re: VACUUM PARALLEL option vs. max_parallel_maintenance_workers

2020-10-03 Thread Masahiko Sawada
On Sat, 3 Oct 2020 at 20:03, Amit Kapila wrote: > > On Wed, Sep 30, 2020 at 9:23 PM Robert Haas wrote: > > > > On Tue, Sep 22, 2020 at 3:20 AM David Rowley wrote: > > > It would be good if we were consistent with these parallel options. > > > Right now max_parallel_workers_per_gather will restri

Re: enable_incremental_sort changes query behavior

2020-10-03 Thread James Coleman
On Fri, Oct 2, 2020 at 2:25 PM Tomas Vondra wrote: > > The backtrace looks like this: > > #0 get_sortgroupref_tle > #1 0x00808ab9 in prepare_sort_from_pathkeys > #2 0x0080926c in make_sort_from_pathkeys > #3 0x00801032 in create_sort_plan > #4

Re: POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Tomas Vondra
On Sat, Oct 03, 2020 at 02:13:01PM +0200, Petru Ghita wrote: As instructed by Alexander Korotkov, I'm linking the patch: https://github.com/petru-ghita/postgres/commit/d6d1f340cd34db8176744ede7f0fe588d870a33f Please submit an actual patch, not just a link to github commit. That may disappear

RE: POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Petru Ghita
As instructed by Alexander Korotkov, I'm linking the patch: https://github.com/petru-ghita/postgres/commit/d6d1f340cd34db8176744ede7f0fe588d870a33f Kind regards, petru ghita

Re: Retry Cached Remote Connections for postgres_fdw in case remote backend gets killed/goes away

2020-10-03 Thread Bharath Rupireddy
On Fri, Oct 2, 2020 at 11:30 PM Fujii Masao wrote: > > > Attaching v8 patch, please review it.. Both make check and make > > check-world passes on v8. > > Thanks for updating the patch! It basically looks good to me. > I tweaked the patch as follows. > > + if (!entry->conn || > +

Re: a misbehavior of partition row movement (?)

2020-10-03 Thread Amit Langote
On Sat, Oct 3, 2020 at 8:15 PM Tomas Vondra wrote > On Sat, Oct 03, 2020 at 11:42:21AM +0900, Amit Langote wrote: > >On Fri, Oct 2, 2020 at 11:32 PM David G. Johnston > > wrote: > >> On Friday, October 2, 2020, Amit Langote > >> wrote: > >>> > >>> > >>> Reporter on that thread says that the last

Re: a misbehavior of partition row movement (?)

2020-10-03 Thread Tomas Vondra
On Sat, Oct 03, 2020 at 11:42:21AM +0900, Amit Langote wrote: On Fri, Oct 2, 2020 at 11:32 PM David G. Johnston wrote: On Friday, October 2, 2020, Amit Langote wrote: Reporter on that thread says that the last update should have failed and I don't quite see a workable alternative to that.

Re: VACUUM PARALLEL option vs. max_parallel_maintenance_workers

2020-10-03 Thread Amit Kapila
On Wed, Sep 30, 2020 at 9:23 PM Robert Haas wrote: > > On Tue, Sep 22, 2020 at 3:20 AM David Rowley wrote: > > It would be good if we were consistent with these parallel options. > > Right now max_parallel_workers_per_gather will restrict the > > parallel_workers reloption. I'd say this > > max_

POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Petru Ghita
Hi, Would it be possible to mark functions in contrib/unnaccent [1] as IMMUTABLE? We would gain the possibility to use it to enforce uniqueness. I understand that the main drawback is that unicode rules are periodically updated. So it would be needed to reindex indices on unaccent() after upgrad

Re: Parallel copy

2020-10-03 Thread Amit Kapila
On Sat, Oct 3, 2020 at 6:20 AM Tomas Vondra wrote: > > Hello Vignesh, > > I've done some basic benchmarking on the v4 version of the patches (but > AFAIKC the v5 should perform about the same), and some initial review. > > For the benchmarking, I used the lineitem table from TPC-H - for 75GB > dat

Re: Resetting spilled txn statistics in pg_stat_replication

2020-10-03 Thread Amit Kapila
On Sat, Oct 3, 2020 at 9:26 AM Masahiko Sawada wrote: > > When we discussed this before, I was thinking that we could have other > statistics for physical slots in the same statistics view in the > future. Having the view show only logical slots also makes sense to me > but I’m concerned a bit tha

Re: Incorrect assumption in heap_prepare_freeze_tuple

2020-10-03 Thread Andres Freund
Hi, On 2020-10-03 12:58:01 +0530, Kuntal Ghosh wrote: > IIUC, there can be a HOT-updated tuple which is not initially pruned > by heap_page_prune but later diagnosed HEAPTUPLE_DEAD by > HeapTupleSatisfiesVacuum (Since OldestXmin can be updated by the time > we call HeapTupleSatisfiesVacuum and xma

Re: Incorrect assumption in heap_prepare_freeze_tuple

2020-10-03 Thread Kuntal Ghosh
On Sat, Oct 3, 2020 at 12:05 AM Andres Freund wrote: Thank you for your quick response and detailed explanation. > > > * It is assumed that the caller has checked the tuple with > > * HeapTupleSatisfiesVacuum() and determined that it is not HEAPTUPLE_DEAD > > * (else we should be removing the