Re: Why are wait events not reported even though it reads/writes a timeline history file?

2020-04-27 Thread Fujii Masao
On 2020/04/28 11:10, Masahiro Ikeda wrote: On 2020-04-27 12:25, Fujii Masao wrote: On 2020/04/24 11:29, Masahiro Ikeda wrote: Hi, There are two unexpected codes for me about wait events for timeline history file. Please let me know your thoughts whether if we need to change. 1.

Re: Fix compilation failure against LLVM 11

2020-04-27 Thread Andres Freund
Hi, On 2020-04-28 13:56:23 +0900, Michael Paquier wrote: > On Mon, Apr 27, 2020 at 07:48:54AM -0700, Jesse Zhang wrote: > > Are you expressing a concern against "churning" this part of the code in > > reaction to upstream LLVM changes? I'd agree with you in general. But > > then the question we

Re: [HACKERS] Restricting maximum keep segments by repslots

2020-04-27 Thread Kyotaro Horiguchi
At Mon, 27 Apr 2020 18:33:42 -0400, Alvaro Herrera wrote in > On 2020-Apr-08, Kyotaro Horiguchi wrote: > > > At Wed, 08 Apr 2020 09:37:10 +0900 (JST), Kyotaro Horiguchi > > wrote in > > > > Just avoiding starting replication when restart_lsn is invalid is > > sufficient (the attached,

Re: Fix compilation failure against LLVM 11

2020-04-27 Thread Michael Paquier
On Mon, Apr 27, 2020 at 07:48:54AM -0700, Jesse Zhang wrote: > Are you expressing a concern against "churning" this part of the code in > reaction to upstream LLVM changes? I'd agree with you in general. But > then the question we need to ask is "will we need to revert this 3 weeks > from now if

Re: pg_rewind docs correction

2020-04-27 Thread Michael Paquier
On Mon, Mar 09, 2020 at 09:26:17AM -0400, James Coleman wrote: >> - pg_stat_tmp/, and >> - pg_subtrans/ are omitted from the data copied >> - from the source cluster. Any file or directory beginning with >> - pgsql_tmp is omitted, as well as are >> + pg_stat_tmp/, and >>

Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators

2020-04-27 Thread Fujii Masao
On 2020/04/28 1:24, Robert Haas wrote: On Sun, Apr 26, 2020 at 9:41 PM Kyotaro Horiguchi wrote: +1. I actually sometimes need it. y the way, -(pg_lsn, pg_lsn) yields a numeric. It might be a good idea to use numeric here, too. Because int8 is signed, it's not big enough to cover the

Re: Proposing WITH ITERATIVE

2020-04-27 Thread Jonah H. Harris
On Mon, Apr 27, 2020 at 11:33 PM David Fetter wrote: > > Have the authors agreed to make it available to the project under a > compatible license? If there’s interest, obviously. Otherwise I wouldn’t be asking. I said from the start why I wasn’t attaching a patch and that I was seeing

Re: Proposing WITH ITERATIVE

2020-04-27 Thread David Fetter
On Mon, Apr 27, 2020 at 10:44:04PM -0400, Jonah H. Harris wrote: > On Mon, Apr 27, 2020 at 10:32 PM David Fetter wrote: > > On Mon, Apr 27, 2020 at 12:52:48PM -0400, Jonah H. Harris wrote: > > > Hey, everyone. > > > > > If there's any interest, I'll clean-up their patch and submit. Thoughts? > >

Re: WIP/PoC for parallel backup

2020-04-27 Thread Amit Kapila
On Mon, Apr 27, 2020 at 10:23 PM David Zhang wrote: > > Hi, > > Here is the parallel backup performance test results with and without > the patch "parallel_backup_v15" on AWS cloud environment. Two > "t2.xlarge" machines were used: one for Postgres server and the other > one for pg_basebackup

Re: Proposing WITH ITERATIVE

2020-04-27 Thread Jonah H. Harris
On Mon, Apr 27, 2020 at 10:32 PM David Fetter wrote: > On Mon, Apr 27, 2020 at 12:52:48PM -0400, Jonah H. Harris wrote: > > Hey, everyone. > > > If there's any interest, I'll clean-up their patch and submit. Thoughts? > > Where's the current patch? It’s private. Hence, why I’m inquiring as to

Re: Fixes for two separate bugs in nbtree VACUUM's page deletion

2020-04-27 Thread Peter Geoghegan
On Mon, Apr 27, 2020 at 11:02 AM Peter Geoghegan wrote: > I would like to backpatch both patches to all branches that have > commit 857f9c36cda -- v11, v12, and master. The second issue isn't > serious, but it seems worth keeping v11+ in sync in this area. Note > that any backpatch theoretically

Re: Proposing WITH ITERATIVE

2020-04-27 Thread David Fetter
On Mon, Apr 27, 2020 at 12:52:48PM -0400, Jonah H. Harris wrote: > Hey, everyone. > If there's any interest, I'll clean-up their patch and submit. Thoughts? Where's the current patch? Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating

Re: Why are wait events not reported even though it reads/writes a timeline history file?

2020-04-27 Thread Masahiro Ikeda
On 2020-04-27 12:25, Fujii Masao wrote: On 2020/04/24 11:29, Masahiro Ikeda wrote: Hi, There are two unexpected codes for me about wait events for timeline history file. Please let me know your thoughts whether if we need to change. 1. readTimeLineHistory() function in timeline.c The

Re: WAL usage calculation patch

2020-04-27 Thread Amit Kapila
On Mon, Apr 27, 2020 at 1:22 PM Julien Rouhaud wrote: > > On Mon, Apr 27, 2020 at 8:12 AM Michael Paquier wrote: > > > > On Mon, Apr 27, 2020 at 08:35:51AM +0530, Amit Kapila wrote: > > > On Thu, Apr 23, 2020 at 2:35 PM Amit Kapila > > > wrote: > > >> On Thu, Apr 23, 2020 at 12:16 PM Peter

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

2020-04-27 Thread James Coleman
On Sun, Apr 26, 2020 at 7:41 PM James Coleman wrote: > > On Sun, Apr 26, 2020 at 4:49 PM Tomas Vondra > wrote: > > > > On Sun, Apr 26, 2020 at 02:46:19PM -0400, James Coleman wrote: > > >On Sat, Apr 25, 2020 at 8:31 PM Tomas Vondra > > > wrote: > > >> > > >> On Sat, Apr 25, 2020 at 06:47:41PM

Re: Concurrency bug in amcheck

2020-04-27 Thread Peter Geoghegan
On Mon, Apr 27, 2020 at 4:17 AM Alexander Korotkov wrote: > > Assuming it doesn't seem we actually need any items on deleted pages, > > I can propose to delete them on primary as well. That would make > > contents of primary and standby more consistent. What do you think? > > So, my proposal is

Re: Proposing WITH ITERATIVE

2020-04-27 Thread Jeff Davis
Hi, You might get better feedback in a month or so; right now we just got into feature freeze. On Mon, 2020-04-27 at 12:52 -0400, Jonah H. Harris wrote: > In that it can reference a relation within its definition, this > iterative variant has similar capabilities as recursive CTEs. In > contrast

Re: [HACKERS] Restricting maximum keep segments by repslots

2020-04-27 Thread Alvaro Herrera
On 2020-Apr-08, Kyotaro Horiguchi wrote: > I understand how it happens. > > The latch triggered by checkpoint request by CHECKPOINT command has > been absorbed by ConditionVariableSleep() in > InvalidateObsoleteReplicationSlots. The attached allows checkpointer > use MyLatch for other than

Re: [HACKERS] Restricting maximum keep segments by repslots

2020-04-27 Thread Alvaro Herrera
On 2020-Apr-08, Kyotaro Horiguchi wrote: > At Wed, 08 Apr 2020 09:37:10 +0900 (JST), Kyotaro Horiguchi > wrote in > > Just avoiding starting replication when restart_lsn is invalid is > sufficient (the attached, which is equivalent to a part of what the > invalidated flag did). I thing that

Re: Parallel GiST build on Cube

2020-04-27 Thread Komяpa
Hello, These things for GIST I know that can help: - Fast sorting GIST build commitfest entry by Andrey Borodin, not parallel but faster - https://www.postgresql.org/message-id/flat/1A36620E-CAD8-4267-9067-FB31385E7C0D%40yandex-team.ru - Fast sorting GIST build by Nikita Glukhov, reuses btree

Re: tar-related code in PostgreSQL

2020-04-27 Thread Robert Haas
On Fri, Apr 24, 2020 at 12:27 PM Tom Lane wrote: > Bleah. Whether or not the nearest copy of tar happens to spit up on > that, it's a clear violation of the POSIX standard for tar files. > I'd vote for back-patching your 0001. Done. > I'd lean mildly to holding 0002 until after we branch. It

Fixes for two separate bugs in nbtree VACUUM's page deletion

2020-04-27 Thread Peter Geoghegan
Attached are two patches, both of which are fixes for bugs in nbtree VACUUM page deletion. The first fix for a bug in commit 857f9c36cda. The immediate issue is that the code that maintains the oldest btpo.xact in the index accesses the special area of pages without holding a buffer pin. More

Parallel GiST build on Cube

2020-04-27 Thread Shyam Saladi
Hello -- I regularly build GiST indexes on large databases. In recent times, as the size of the database has ballooned (30 million rows) along with the build time on a column of points in 3- and 8-dimensional space (0-volume cube). Is anyone working on (or already implemented) a parallel GiST

Re: proposal - plpgsql - all plpgsql auto variables should be constant

2020-04-27 Thread Pavel Stehule
po 27. 4. 2020 v 16:26 odesílatel Greg Stark napsal: > On Fri, 24 Apr 2020 at 10:08, Tom Lane wrote: > > > > I'm skeptical. If we'd marked them that way from day one, it would have > > been fine, but to change it now is a whole different discussion. I think > > the odds that anybody will

Re: WIP/PoC for parallel backup

2020-04-27 Thread David Zhang
Hi, Here is the parallel backup performance test results with and without the patch "parallel_backup_v15" on AWS cloud environment. Two "t2.xlarge" machines were used: one for Postgres server and the other one for pg_basebackup with the same machine configuration showing below. Machine

Proposing WITH ITERATIVE

2020-04-27 Thread Jonah H. Harris
Hey, everyone. It's been quite a while since I last contributed a patch but, as this is a new feature, I wanted to gather feedback before doing so. I've found this functionality, already in use at Universität Tübingen, to be both highly beneficial in many of my queries as well as a small change

improving basebackup.c's file-reading code

2020-04-27 Thread Robert Haas
Hi, basebackup.c's code to read from files uses fread() and friends. This is not great, because it's not documented to set errno. See commit 286af0ce12117bc673b97df6228d1a666594d247 and related discussion. It seems like a better idea would be to use pg_pgread(), which not only does set errno, but

Re: weird hash plan cost, starting with pg10

2020-04-27 Thread Justin Pryzby
On Mon, Apr 27, 2020 at 12:26:03PM -0400, Tom Lane wrote: > Justin Pryzby writes: > > Checking if you're planning to backpatch this ? > > Are you speaking of 5c27bce7f et al? Oops, yes, thanks. I updated wiki/PostgreSQL_13_Open_Items just now. -- Justin

Re: weird hash plan cost, starting with pg10

2020-04-27 Thread Tom Lane
Justin Pryzby writes: > Checking if you're planning to backpatch this ? Are you speaking of 5c27bce7f et al? regards, tom lane

Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators

2020-04-27 Thread Robert Haas
On Sun, Apr 26, 2020 at 9:41 PM Kyotaro Horiguchi wrote: > +1. I actually sometimes need it. > > y the way, -(pg_lsn, pg_lsn) yields a numeric. It might be a good idea to use numeric here, too. Because int8 is signed, it's not big enough to cover the whole range of LSNs. -- Robert Haas

Re: weird hash plan cost, starting with pg10

2020-04-27 Thread Justin Pryzby
On Fri, Apr 10, 2020 at 04:11:27PM -0400, Tom Lane wrote: > I'm not sure it's worth any risk though. A much simpler > fix is to make sure we clear the dangling hashtable pointer, as in > 0002 below (a simplified form of Konstantin's patch). The net > effect of that is that in the case where a

Re: doc review for v13

2020-04-27 Thread Justin Pryzby
On Mon, Apr 27, 2020 at 03:03:05PM +0900, Michael Paquier wrote: > Hm, okay. There are still pieces in those patches about which I am > not sure, so I have let that aside for the time being. > > Anyway, I have applied patch 12, and reported the typos from imath.c Thank you. I will leave this

Re: Fix compilation failure against LLVM 11

2020-04-27 Thread Jesse Zhang
Hi Michael, On Sun, Apr 26, 2020 at 11:21 PM Michael Paquier wrote: > > On Sat, Apr 25, 2020 at 09:41:20PM -0700, Jesse Zhang wrote: > > I searched my inbox and the archive, strange that nobody else is seeing > > this. > > > > Turns out that LLVM has recently removed "llvm/IR/CallSite.h" in > >

Re: [Proposal] Global temporary tables

2020-04-27 Thread Prabhat Sahu
Thanks Wenjing, for the fix patch for previous issues. I have verified the issues, now those fix look good to me. But the below error message is confusing(for gtt2). postgres=# drop table gtt1; ERROR: cannot drop global temp table gtt1 when other backend attached it. postgres=# drop table gtt2;

Re: Poll: are people okay with function/operator table redesign?

2020-04-27 Thread Jonathan S. Katz
On 4/27/20 8:49 AM, Tom Lane wrote: > "Jonathan S. Katz" writes: >> Great. I do want to do a bit more desultory testing in the older >> versions of the docs, but it can be committed whenever the -docs side is >> ready. > > Other than that point, the main.css patch as I presented it just adds >

Re: Poll: are people okay with function/operator table redesign?

2020-04-27 Thread Tom Lane
"Jonathan S. Katz" writes: > Great. I do want to do a bit more desultory testing in the older > versions of the docs, but it can be committed whenever the -docs side is > ready. Other than that point, the main.css patch as I presented it just adds some rules that aren't used yet, so it could be

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

2020-04-27 Thread James Coleman
On Sun, Apr 26, 2020 at 11:44 PM David Rowley wrote: > > On Mon, 27 Apr 2020 at 15:12, James Coleman wrote: > > While working on this I noticed that dynahash.c line 499 has this assertion: > > > > Assert(info->entrysize >= info->keysize); > > > > Do you by any chance know why the entry would

Re: Poll: are people okay with function/operator table redesign?

2020-04-27 Thread Jonathan S. Katz
On 4/26/20 9:44 PM, Tom Lane wrote: > "Jonathan S. Katz" writes: >> Can you try > >> #docContent p { >> - margin-bottom: 1rem !important; >> + margin-bottom: 1rem; >> } > >> and see how it looks? > > In some desultory looking around, I couldn't find anyplace in the > existing text that

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-04-27 Thread Dilip Kumar
On Mon, Apr 27, 2020 at 4:13 PM Amit Kapila wrote: > > On Mon, Apr 27, 2020 at 4:05 PM Dilip Kumar wrote: > > > > I have also fixed a couple of bugs internally reported by my colleague > > Neha Sharma. > > > > I think it would be good if you can briefly explain what were the bugs > and how you

Re: PG compilation error with Visual Studio 2015/2017/2019

2020-04-27 Thread Amit Kapila
On Thu, Apr 23, 2020 at 6:30 PM Amit Kapila wrote: > > On Thu, Apr 23, 2020 at 5:37 PM Juan José Santamaría Flecha > wrote: > > > > I have composed a small set of queries to test the output with different > > lc_message settings (lc_messages_test.sql). Please find attached the output > > from

Re: Concurrency bug in amcheck

2020-04-27 Thread Alexander Korotkov
On Mon, Apr 27, 2020 at 11:51 AM Alexander Korotkov wrote: > On Wed, Apr 22, 2020 at 7:47 PM Peter Geoghegan wrote: > > On Tue, Apr 21, 2020 at 2:54 AM Alexander Korotkov > > wrote: > > > Proposed fix is attached. Spotted by Konstantin Knizhnik, > > > reproduction case and fix from me. > > > >

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-04-27 Thread Amit Kapila
On Mon, Apr 27, 2020 at 4:05 PM Dilip Kumar wrote: > > I have also fixed a couple of bugs internally reported by my colleague > Neha Sharma. > I think it would be good if you can briefly explain what were the bugs and how you fixed those? -- With Regards, Amit Kapila. EnterpriseDB:

Re: [Proposal] Global temporary tables

2020-04-27 Thread 曾文旌
> 2020年4月24日 下午9:03,tushar 写道: > > On 4/22/20 2:49 PM, 曾文旌 wrote: >> >> I provide the TRUNCATE tablename DROP to clear the data in the GTT and >> delete the storage files. >> This feature requires the current transaction to commit immediately after it >> finishes truncate. >> > Thanks

Re: [Proposal] Global temporary tables

2020-04-27 Thread Prabhat Sahu
Hi Wenjing, Please check the below scenario shows different error message with "DROP TABLE gtt;" for gtt with and without index. *-- Session1:*postgres=# create global temporary table gtt1 (c1 int); CREATE TABLE postgres=# create global temporary table gtt2 (c1 int); CREATE TABLE postgres=#

Re: Concurrency bug in amcheck

2020-04-27 Thread Alexander Korotkov
On Wed, Apr 22, 2020 at 7:47 PM Peter Geoghegan wrote: > On Tue, Apr 21, 2020 at 2:54 AM Alexander Korotkov > wrote: > > Proposed fix is attached. Spotted by Konstantin Knizhnik, > > reproduction case and fix from me. > > I wonder if we should fix btree_xlog_unlink_page() instead of amcheck. >

Re: WAL usage calculation patch

2020-04-27 Thread Julien Rouhaud
On Mon, Apr 27, 2020 at 8:12 AM Michael Paquier wrote: > > On Mon, Apr 27, 2020 at 08:35:51AM +0530, Amit Kapila wrote: > > On Thu, Apr 23, 2020 at 2:35 PM Amit Kapila wrote: > >> On Thu, Apr 23, 2020 at 12:16 PM Peter Eisentraut > >> wrote: > >>> The internal symbol for the WAL record is >

Re: Improving psql slash usage help message

2020-04-27 Thread Hamid Akhtar
On Sun, Apr 26, 2020 at 1:03 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Sat, Apr 25, 2020 at 12:29 PM Hamid Akhtar > wrote: > >> >> "\dE" displays the list with a "List of relations" heading whereas "\det" >> displays "List of foreign tables". So, to differentiate the two, I

Re: Fix compilation failure against LLVM 11

2020-04-27 Thread Michael Paquier
On Sat, Apr 25, 2020 at 09:41:20PM -0700, Jesse Zhang wrote: > I searched my inbox and the archive, strange that nobody else is seeing > this. > > Turns out that LLVM has recently removed "llvm/IR/CallSite.h" in > (unreleased) version 11 [1][2]. To fix the build I tried conditionally > (on

Re: WAL usage calculation patch

2020-04-27 Thread Michael Paquier
On Mon, Apr 27, 2020 at 08:35:51AM +0530, Amit Kapila wrote: > On Thu, Apr 23, 2020 at 2:35 PM Amit Kapila wrote: >> On Thu, Apr 23, 2020 at 12:16 PM Peter Eisentraut >> wrote: >>> The internal symbol for the WAL record is >>> XLOG_FPI and xlogdesc.c prints it as "FPI". > > Julien, Peter,

Re: doc review for v13

2020-04-27 Thread Michael Paquier
On Sun, Apr 26, 2020 at 08:59:05PM -0400, Tom Lane wrote: > James Coleman writes: >> On Sun, Apr 26, 2020 at 12:13 PM Justin Pryzby wrote: >>> I think my text is correct. This would *also* be correct: >>> | If any CHECK constraint on the table being >>> | attached is marked NO