Re: PANIC: wrong buffer passed to visibilitymap_clear

2021-04-10 Thread Tom Lane
I've managed to reproduce this locally, by dint of running the src/bin/scripts tests over and over and tweaking the timing by trying different "taskset" parameters to vary the number of CPUs available. I find that I duplicated the report from spurfowl, particularly (gdb) bt #0 0x7f67bb6807d5

Re: TRUNCATE on foreign table

2021-04-10 Thread Justin Pryzby
On Thu, Apr 08, 2021 at 10:14:17PM +0900, Fujii Masao wrote: > On 2021/04/08 22:02, Kohei KaiGai wrote: > > > Anyway, attached is the updated version of the patch. This is still based > > > on the latest Kazutaka-san's patch. That is, extra list for ONLY is still > > > passed to FDW. What about c

Re: Add header support to text format and matching feature

2021-04-10 Thread Zhihong Yu
On Sat, Apr 10, 2021 at 4:17 PM Rémi Lapeyre wrote: > > > > > Michael, since the issue of duplicated options has been fixed do either > of these patches look like they are ready for commit? > > > > Here’s a rebased version of the patch. > > > Cheers, > Rémi > > > > Regards, > > -- > > -David > >

Re: pgsql: autovacuum: handle analyze for partitioned tables

2021-04-10 Thread Justin Pryzby
On Thu, Apr 08, 2021 at 04:11:49PM -0400, Alvaro Herrera wrote: > On 2021-Apr-08, Tom Lane wrote: > > > > So I tend to think that my initial instinct was the better direction: we > > > should not be doing any find_all_inheritors() here at all, but instead > > > rely on pg_class.reltuples to be set

Re: PL/R regression on windows, but not linux with master.

2021-04-10 Thread Dave Cramer
On Sat, 10 Apr 2021 at 20:56, Tomas Vondra wrote: > On 4/11/21 2:38 AM, Dave Cramer wrote: > > > > > > > > > > On Sat, 10 Apr 2021 at 20:34, Tom Lane > > wrote: > > > > Dave Cramer mailto:davecra...@gmail.com>> > writes: > > > On Sat, 10 Apr 2021 at 20:24, Tom

Re: PL/R regression on windows, but not linux with master.

2021-04-10 Thread Tomas Vondra
On 4/11/21 2:38 AM, Dave Cramer wrote: > > > > > On Sat, 10 Apr 2021 at 20:34, Tom Lane > wrote: > > Dave Cramer mailto:davecra...@gmail.com>> writes: > > On Sat, 10 Apr 2021 at 20:24, Tom Lane > wrote: > >> That's quite b

Re: PL/R regression on windows, but not linux with master.

2021-04-10 Thread Dave Cramer
On Sat, 10 Apr 2021 at 20:34, Tom Lane wrote: > Dave Cramer writes: > > On Sat, 10 Apr 2021 at 20:24, Tom Lane wrote: > >> That's quite bizarre. What is the actual error level according to > >> the source code, and where is the error being thrown exactly? > > > Well it really is an ERROR, and

Re: PL/R regression on windows, but not linux with master.

2021-04-10 Thread Tom Lane
Dave Cramer writes: > On Sat, 10 Apr 2021 at 20:24, Tom Lane wrote: >> That's quite bizarre. What is the actual error level according to >> the source code, and where is the error being thrown exactly? > Well it really is an ERROR, and is being downgraded on windows to WARNING. That seems quit

Re: PL/R regression on windows, but not linux with master.

2021-04-10 Thread Dave Cramer
On Sat, 10 Apr 2021 at 20:24, Tom Lane wrote: > Dave Cramer writes: > > One of our tests purposely throws an error which returns > > "ERROR: R interpreter parse error" on linux > > and > > "WARNING: R interpreter parse error" on windows. > > That's quite bizarre. What is the actual error leve

Re: PL/R regression on windows, but not linux with master.

2021-04-10 Thread Tom Lane
Dave Cramer writes: > One of our tests purposely throws an error which returns > "ERROR: R interpreter parse error" on linux > and > "WARNING: R interpreter parse error" on windows. That's quite bizarre. What is the actual error level according to the source code, and where is the error being

PL/R regression on windows, but not linux with master.

2021-04-10 Thread Dave Cramer
One of our tests purposely throws an error which returns "ERROR: R interpreter parse error" on linux and "WARNING: R interpreter parse error" on windows. I'm hoping someone can point me to the code that may be responsible? Was there a change in the error handling that might be attributed to th

Re: Add header support to text format and matching feature

2021-04-10 Thread Rémi Lapeyre
> > Michael, since the issue of duplicated options has been fixed do either of > these patches look like they are ready for commit? > Here’s a rebased version of the patch. Cheers, Rémi > Regards, > -- > -David > da...@pgmasters.net v8-0001-Add-header-support-to-COPY-TO-text-format.pa

Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays

2021-04-10 Thread Tomas Vondra
On 4/11/21 12:03 AM, David Rowley wrote: > On Sat, 10 Apr 2021 at 10:32, Tomas Vondra > wrote: >> But I think the puzzle is not so much about v5 vs v6, but more about v5 >> vs. master. I still don't understand how v5 managed to be faster than >> master, but maybe I'm missing something. > > Wel

Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays

2021-04-10 Thread David Rowley
On Sat, 10 Apr 2021 at 10:32, Tomas Vondra wrote: > But I think the puzzle is not so much about v5 vs v6, but more about v5 > vs. master. I still don't understand how v5 managed to be faster than > master, but maybe I'm missing something. Well, v5 wrapped ScalarArrayOpExpr inside HashedScalarArra

Re: Reference Leak with type

2021-04-10 Thread Tom Lane
Here's a proposed patch for this problem. The core problem in this test case is that the refcount is logged in the Portal resowner, which is a child of the initial transaction's resowner, so it goes away in the COMMIT (after warning of a resource leak); but the expression tree is still there and s

Re: pgsql: autovacuum: handle analyze for partitioned tables

2021-04-10 Thread Tomas Vondra
On 4/10/21 12:29 AM, Justin Pryzby wrote: > On Fri, Apr 09, 2021 at 06:16:59PM -0400, Alvaro Herrera wrote: >> On 2021-Apr-09, Justin Pryzby wrote: >> >>> One data point: we do DETACH/ATTACH tables during normal operation, before >>> type-promoting ALTERs, to avoid worst-case disk use, and to avoid

Re: Reference Leak with type

2021-04-10 Thread Zhihong Yu
On Fri, Apr 9, 2021 at 10:31 AM Tom Lane wrote: > Michael Paquier writes: > > On Tue, Apr 06, 2021 at 11:09:13AM +0530, Rohit Bhogate wrote: > >> I found the below reference leak on master. > > > Thanks for the report. This is indeed a new problem as of HEAD, > > Just for the record, it's not n

Re: SQL-standard function body

2021-04-10 Thread Noah Misch
On Sat, Apr 10, 2021 at 10:52:15AM -0400, Tom Lane wrote: > Noah Misch writes: > > On Fri, Apr 09, 2021 at 12:09:43PM -0400, Tom Lane wrote: > >> The real value of 0003 of course would be to get an error cursor at > >> runtime > > > A key benefit of $SUBJECT is the function body following DDL ren

Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY

2021-04-10 Thread Justin Pryzby
On Sun, Mar 21, 2021 at 03:01:15PM -0300, Alvaro Herrera wrote: > > But note that it doesn't check if an existing constraint "implies" the new > > constraint - maybe it should. > > Hm, I'm not sure I want to do that, because that means that if I later > have to attach the partition again with the

Re: truncating timestamps on arbitrary intervals

2021-04-10 Thread Peter Eisentraut
On 10.04.21 14:53, John Naylor wrote: On Sat, Apr 10, 2021 at 7:43 AM Peter Eisentraut > wrote: > > On 30.03.21 18:06, John Naylor wrote: > > Currently, when the origin is after the input, the result is the > > timestamp at the end of the bin, rath

Re: check_function_bodies: At least the description seems wrong, since we have prodedures

2021-04-10 Thread Tom Lane
"Daniel Westermann (DWE)" writes: >> +1 for updating the description though.  We could s/function/routine/ >> where space is tight. > Thanks for your inputs. Attached a proposal which updates the description. I changed config.sgml's description similarly, and pushed this.

Re: Truncate in synchronous logical replication failed

2021-04-10 Thread Japin Li
On Thu, 08 Apr 2021 at 19:20, Japin Li wrote: > On Wed, 07 Apr 2021 at 16:34, tanghy.f...@fujitsu.com > wrote: >> On Wednesday, April 7, 2021 5:28 PM Amit Kapila >> wrote >> >>>Can you please check if the behavior is the same for PG-13? This is >>>just to ensure that we have not introduced a

Re: SQL-standard function body

2021-04-10 Thread Tom Lane
Noah Misch writes: > On Fri, Apr 09, 2021 at 12:09:43PM -0400, Tom Lane wrote: >> The real value of 0003 of course would be to get an error cursor at >> runtime > A key benefit of $SUBJECT is the function body following DDL renames: Agreed. But ... > After the rename, any stored prosrc is obso

Re: Is it worth to optimize VACUUM/ANALYZE by combining duplicate rel instances into single rel instance?

2021-04-10 Thread Tom Lane
Bharath Rupireddy writes: > I'm reading the code for vacuum/analyze and it looks like currently we > call vacuum_rel/analyze_rel for each relation specified. Which means > that if a relation is specified more than once, then we simply > vacuum/analyze it that many times. Do we gain any advantage b

Re: Replication slot stats misgivings

2021-04-10 Thread vignesh C
On Sat, Apr 10, 2021 at 6:24 PM Amit Kapila wrote: > > On Sat, Apr 10, 2021 at 1:06 PM vignesh C wrote: > > > > Thanks Amit for your Patch. I have merged your changes into my > > patchset. I did not find any issues in my testing. > > Thoughts? > > > > 0001 > -- > PgStat_Counter m_stream_byt

Re: Replication slot stats misgivings

2021-04-10 Thread Amit Kapila
On Sat, Apr 10, 2021 at 1:06 PM vignesh C wrote: > > Thanks Amit for your Patch. I have merged your changes into my > patchset. I did not find any issues in my testing. > Thoughts? > 0001 -- PgStat_Counter m_stream_bytes; + PgStat_Counter m_total_txns; + PgStat_Counter m_total_bytes; } PgS

Re: truncating timestamps on arbitrary intervals

2021-04-10 Thread John Naylor
On Sat, Apr 10, 2021 at 7:43 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > > On 30.03.21 18:06, John Naylor wrote: > > Currently, when the origin is after the input, the result is the > > timestamp at the end of the bin, rather than the beginning as expected. > > The attached pu

Re: Replication slot stats misgivings

2021-04-10 Thread Amit Kapila
On Sat, Apr 10, 2021 at 7:24 AM Masahiko Sawada wrote: > > IIUC there are two problems in the case where the drop message is lost: > > 1. Writing beyond the end of replSlotStats. > This can happen if after restarting the number of slots whose stats > are stored in the stats file exceeds max_replic

Re: truncating timestamps on arbitrary intervals

2021-04-10 Thread Peter Eisentraut
On 30.03.21 18:06, John Naylor wrote: Currently, when the origin is after the input, the result is the timestamp at the end of the bin, rather than the beginning as expected. The attached puts the result consistently at the beginning of the bin. In the patch + if (origin > timestamp && stri

Re: check_function_bodies: At least the description seems wrong, since we have prodedures

2021-04-10 Thread Daniel Westermann (DWE)
>> It's possible the parameter name also appears in documentation for >> out-of-tree PLs, as each PL's validator function determines what >> "check_function_bodies" really means in that setting. >That parameter is also set explicitly in pg_dump output, so we >can't rename it without breaking exist

Is it worth to optimize VACUUM/ANALYZE by combining duplicate rel instances into single rel instance?

2021-04-10 Thread Bharath Rupireddy
Hi, I'm reading the code for vacuum/analyze and it looks like currently we call vacuum_rel/analyze_rel for each relation specified. Which means that if a relation is specified more than once, then we simply vacuum/analyze it that many times. Do we gain any advantage by vacuuming/analyzing a relati

Re: Replication slot stats misgivings

2021-04-10 Thread vignesh C
On Sat, Apr 10, 2021 at 9:50 AM Amit Kapila wrote: > > On Fri, Apr 9, 2021 at 4:13 PM Amit Kapila wrote: > > > > 2. > > @@ -2051,6 +2054,17 @@ ReorderBufferProcessTXN(ReorderBuffer *rb, > > ReorderBufferTXN *txn, > > rb->begin(rb, txn); > > } > > > > + /* > > + * Update total transaction coun

Re: Lots of incorrect comments in nodeFuncs.c

2021-04-10 Thread David Rowley
On Fri, 9 Apr 2021 at 23:22, Tom Lane wrote: > LGTM. Thanks. Pushed. David