RE: Stronger safeguard for archive recovery not to miss data

2020-11-25 Thread osumi.takami...@fujitsu.com
Hello, Sergei > It is possible only with manually configured hot_standby = off, right? > We have ERROR in hot standby mode just below in > CheckRequiredParameterValues. Yes, you are right. I turned off the hot_standby in the test in the previous e-mail. I'm sorry that I missed writing this tip

Re: walsender bug: stuck during shutdown

2020-11-25 Thread Fujii Masao
On 2020/11/26 11:45, Alvaro Herrera wrote: On 2020-Nov-26, Fujii Masao wrote: On the second thought, walsender doesn't wait forever unless wal_sender_timeout is disabled, even in the case in discussion? Or if there is the case where wal_sender_timeout doesn't work expectedly, we might need

RE: Stronger safeguard for archive recovery not to miss data

2020-11-25 Thread osumi.takami...@fujitsu.com
Hello, Horiguchi-San On Thursday, Nov 26, 2020 4:29 PM Kyotaro Horiguchi > At Thu, 26 Nov 2020 07:18:39 +, "osumi.takami...@fujitsu.com" > wrote in > > In order to test this fix, what I did is > > 1 - get a base backup during wal_level is replica > > 2 - stop the server and change the

Re: [patch] [doc] Minor variable related cleanup and rewording of plpgsql docs

2020-11-25 Thread Pavel Stehule
čt 26. 11. 2020 v 6:41 odesílatel David G. Johnston < david.g.johns...@gmail.com> napsal: > Hackers, > > Bug # 16519 [1] is another report of confusion regarding trying to use > parameters in improper locations - specifically the SET ROLE command within > pl/pgsql. I'm re-attaching the doc patch

Re: Stronger safeguard for archive recovery not to miss data

2020-11-25 Thread Sergei Kornilov
Hello > First of all, I confirmed the server started up without this patch. It is possible only with manually configured hot_standby = off, right? We have ERROR in hot standby mode just below in CheckRequiredParameterValues. regards, Sergei

Re: Online verification of checksums

2020-11-25 Thread Michael Paquier
On Tue, Nov 24, 2020 at 12:38:30PM -0500, David Steele wrote: > We are not just looking at one LSN value. Here are the steps we are > proposing (I'll skip checks for zero pages here): > > 1) Test the page checksum. If it passes the page is OK. > 2) If the checksum does not pass then record the

Re: [Patch] Optimize dropping of relation buffers using dlist

2020-11-25 Thread Kyotaro Horiguchi
At Thu, 26 Nov 2020 16:18:55 +0900 (JST), Kyotaro Horiguchi wrote in > + /* Zero the array of blocks because these will all be dropped anyway */ > + MemSet(firstDelBlocks, 0, sizeof(BlockNumber) * n * (MAX_FORKNUM + 1)); > > We don't need to prepare nforks, forks and firstDelBlocks for

Re: ResourceOwner refactoring

2020-11-25 Thread Michael Paquier
On Thu, Nov 19, 2020 at 06:40:19PM +0800, Craig Ringer wrote: > [off-list for now] Looks like you have missed something here. -- Michael signature.asc Description: PGP signature

Re: Add table access method as an option to pgbench

2020-11-25 Thread Fabien COELHO
Hello David, The previous patch was based on branch "REL_13_STABLE". Now, the attached new patch v2 is based on master branch. I followed the new code structure using appendPQExpBuffer to append the new clause "using TABLEAM" in a proper position and tested. In the meantime, I also updated

Re: Stronger safeguard for archive recovery not to miss data

2020-11-25 Thread Kyotaro Horiguchi
At Thu, 26 Nov 2020 07:18:39 +, "osumi.takami...@fujitsu.com" wrote in > Hello > > > The attached patch is intended to prevent a scenario that > archive recovery hits WALs which come from wal_level=minimal > and the server continues to work, which was discussed in the thread of [1]. > The

Re: [doc] plan invalidation when statistics are update

2020-11-25 Thread Fujii Masao
On 2020/11/26 14:30, torikoshia wrote: On 2020-11-25 14:13, Fujii Masao wrote: On 2020/11/24 23:14, Fujii Masao wrote: On 2020/11/19 14:33, torikoshia wrote: On 2020-11-18 11:35, Fujii Masao wrote: Thanks for your comment! On 2020/11/18 11:04, torikoshia wrote: Hi, AFAIU, when the

Re: [Patch] Optimize dropping of relation buffers using dlist

2020-11-25 Thread Kyotaro Horiguchi
Hello, Kirk. Thank you for the new version. At Thu, 26 Nov 2020 03:04:10 +, "k.jami...@fujitsu.com" wrote in > On Thursday, November 19, 2020 4:08 PM, Tsunakawa, Takayuki wrote: > > From: Andres Freund > > > DropRelFileNodeBuffers() in recovery? The most common path is > > >

Stronger safeguard for archive recovery not to miss data

2020-11-25 Thread osumi.takami...@fujitsu.com
Hello The attached patch is intended to prevent a scenario that archive recovery hits WALs which come from wal_level=minimal and the server continues to work, which was discussed in the thread of [1]. The motivation is to protect that user ends up with both getting replica that could miss data

Re: Parallel plans and "union all" subquery

2020-11-25 Thread Luc Vlaming
On 25-11-2020 14:54, Greg Nancarrow wrote: On Wed, Nov 25, 2020 at 6:43 PM Luc Vlaming > wrote: > > > You're completely right, sorry for my error. I was too quick on assuming > my patch would work for this specific case too; I should have tested > that before

Have collation versioning to ignore hash and similar AM

2020-11-25 Thread Julien Rouhaud
Hello, Collation versioning has been committed, but there are still at least 2 cases that aren't perfectly handled: - AMs which don't rely on stable collation ordering (hash, bloom...) - expressions which don't rely on a stable collation ordering (e.g. md5()) Handling expressions will probably

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-11-25 Thread Masahiro Ikeda
On 2020-11-25 20:19, Fujii Masao wrote: On 2020/11/19 16:31, Masahiro Ikeda wrote: On 2020-11-17 11:46, Fujii Masao wrote: On 2020/11/16 16:35, Masahiro Ikeda wrote: On 2020-11-12 14:58, Fujii Masao wrote: On 2020/11/06 10:25, Masahiro Ikeda wrote: On 2020-10-30 11:50, Fujii Masao wrote:

Re: Multi Inserts in CREATE TABLE AS - revived patch

2020-11-25 Thread Luc Vlaming
On 26-11-2020 07:31, Bharath Rupireddy wrote: On Thu, Nov 26, 2020 at 9:55 AM Michael Paquier wrote: +inline Size +GetTupleSize(TupleTableSlot *slot, Size maxsize) +{ + Size sz = 0; + HeapTuple tuple = NULL; + + if (TTS_IS_HEAPTUPLE(slot)) + tuple = ((HeapTupleTableSlot *)

Re: Improving spin-lock implementation on ARM.

2020-11-25 Thread Amit Khandekar
On Thu, 26 Nov 2020 at 10:55, Krunal Bauskar wrote: > Hardware: ARM Kunpeng 920 BareMetal Server 2.6 GHz. 64 cores (56 cores for > server and 8 for client) [2 numa nodes] > Storage: 3.2 TB NVMe SSD > OS: CentOS Linux release 7.6 > PGSQL: baseline = Release Tag 13.1 > Invocation suite: >

RE: Parallel Inserts in CREATE TABLE AS

2020-11-25 Thread Hou, Zhijie
Hi , > On Thu, Nov 26, 2020 at 7:47 AM Hou, Zhijie > wrote: > > > > Hi, > > > > I have an issue about the following code: > > > > econtext = node->ps.ps_ExprContext; > > ResetExprContext(econtext); > > > > + if (ISCTAS(node->ps.intoclause)) > > + { > > +

Re: proposal: possibility to read dumped table's name from file

2020-11-25 Thread Pavel Stehule
st 25. 11. 2020 v 21:00 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > st 25. 11. 2020 v 19:25 odesílatel Dean Rasheed < > dean.a.rash...@gmail.com> > > napsal: > >> I agree that being able to configure pg_dump via a config file would > >> be very useful, but the syntax proposed here

Re: Multi Inserts in CREATE TABLE AS - revived patch

2020-11-25 Thread Bharath Rupireddy
On Thu, Nov 26, 2020 at 9:55 AM Michael Paquier wrote: > > +inline Size > +GetTupleSize(TupleTableSlot *slot, Size maxsize) > +{ > + Size sz = 0; > + HeapTuple tuple = NULL; > + > + if (TTS_IS_HEAPTUPLE(slot)) > + tuple = ((HeapTupleTableSlot *) slot)->tuple; > + else

Re: Add table access method as an option to pgbench

2020-11-25 Thread Michael Paquier
On Wed, Nov 25, 2020 at 12:13:55PM -0800, David Zhang wrote: > The previous patch was based on branch "REL_13_STABLE". Now, the attached > new patch v2 is based on master branch. I followed the new code structure > using appendPQExpBuffer to append the new clause "using TABLEAM" in a proper >

Re: [doc] plan invalidation when statistics are update

2020-11-25 Thread torikoshia
On 2020-11-25 14:13, Fujii Masao wrote: On 2020/11/24 23:14, Fujii Masao wrote: On 2020/11/19 14:33, torikoshia wrote: On 2020-11-18 11:35, Fujii Masao wrote: Thanks for your comment! On 2020/11/18 11:04, torikoshia wrote: Hi, AFAIU, when the planner statistics are updated, generic

Re: Improving spin-lock implementation on ARM.

2020-11-25 Thread Krunal Bauskar
On Thu, 26 Nov 2020 at 10:50, Tom Lane wrote: > Michael Paquier writes: > > On Thu, Nov 26, 2020 at 10:00:50AM +0530, Krunal Bauskar wrote: > >> (Thanks to Amit Khandekar for rigorously performance testing this patch > >> with different combinations). > > > For the simple-update and tpcb-like

RE: [Patch] Optimize dropping of relation buffers using dlist

2020-11-25 Thread k.jami...@fujitsu.com
> From: k.jami...@fujitsu.com > On Thursday, November 19, 2020 4:08 PM, Tsunakawa, Takayuki wrote: > > From: Andres Freund > > > DropRelFileNodeBuffers() in recovery? The most common path is > > > DropRelationFiles()->smgrdounlinkall()->DropRelFileNodesAllBuffers() > > > , which 3/4 doesn't

Re: Improving spin-lock implementation on ARM.

2020-11-25 Thread Tom Lane
Michael Paquier writes: > On Thu, Nov 26, 2020 at 10:00:50AM +0530, Krunal Bauskar wrote: >> (Thanks to Amit Khandekar for rigorously performance testing this patch >> with different combinations). > For the simple-update and tpcb-like graphs, do you have any actual > numbers to share between

Re: Improving spin-lock implementation on ARM.

2020-11-25 Thread Krunal Bauskar
scalability baseline patched ---- -- updatetpcb update tpcb -- 128 107932 78554 108081 78569 256

Re: Improving spin-lock implementation on ARM.

2020-11-25 Thread Michael Paquier
On Thu, Nov 26, 2020 at 10:00:50AM +0530, Krunal Bauskar wrote: > (Thanks to Amit Khandekar for rigorously performance testing this patch > with different combinations). For the simple-update and tpcb-like graphs, do you have any actual numbers to share between 128 and 1024 connections? The

Re: PoC: custom signal handler for extensions

2020-11-25 Thread Michael Paquier
On Wed, Nov 25, 2020 at 06:34:48PM +0300, Anastasia Lubennikova wrote: > I took a look at the patch. It looks fine and I see, that it contains fixes > for the latest questions in the thread. > > I think we should provide a test module for this feature, that will serve as > both test and example

Re: Enumize logical replication message actions

2020-11-25 Thread Amit Kapila
On Wed, Nov 25, 2020 at 2:52 PM Amit Kapila wrote: > > On Wed, Nov 25, 2020 at 2:26 PM Peter Smith wrote: > > > > Hi Hackers. > > > > Last month there was a commit [1] for replacing logical replication > > message type characters with enums of equivalent values. > > > > I was revisiting this

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-25 Thread Michael Paquier
On Wed, Nov 25, 2020 at 04:25:56PM +0100, Magnus Hagander wrote: > On Wed, Nov 25, 2020 at 9:29 AM Peter Eisentraut > wrote: >> Perhaps it's worth asking whom the advice applies to then. You suggest >> it's mostly developers. I for one am still grumpy that in 9.5 we >> removed the variant of

Improving spin-lock implementation on ARM.

2020-11-25 Thread Krunal Bauskar
Improving spin-lock implementation on ARM. * Spin-Lock is known to have a significant effect on performance with increasing scalability. * Existing Spin-Lock implementation for ARM is sub-optimal due to use of TAS (test and swap)

Re: Multi Inserts in CREATE TABLE AS - revived patch

2020-11-25 Thread Michael Paquier
On Thu, Nov 26, 2020 at 07:24:01AM +0530, Bharath Rupireddy wrote: > Yeah. The tuple size may change after ExecCopySlot(). For instance, create > table t2 as select a1 from t1; where t1 has two integer columns a1, b1. I'm > creating t2 with single column a1 from t1 which makes the source slot >

Re: Parallel Inserts in CREATE TABLE AS

2020-11-25 Thread Bharath Rupireddy
On Thu, Nov 26, 2020 at 7:47 AM Hou, Zhijie wrote: > > Hi, > > I have an issue about the following code: > > econtext = node->ps.ps_ExprContext; > ResetExprContext(econtext); > > + if (ISCTAS(node->ps.intoclause)) > + { > + ExecParallelInsertInCTAS(node);

Re: POC: Cleaning up orphaned files using undo logs

2020-11-25 Thread Amit Kapila
On Wed, Nov 25, 2020 at 7:47 PM Antonin Houska wrote: > > Antonin Houska wrote: > > > Amit Kapila wrote: > > > > I think we also need to maintain oldestXidHavingUndo for CLOG truncation > > > and > > > transaction-wraparound. We can't allow CLOG truncation for the transaction > > > whose undo

Re: Huge memory consumption on partitioned table with FKs

2020-11-25 Thread Kyotaro Horiguchi
At Thu, 26 Nov 2020 09:59:28 +0900, Keisuke Kuroda wrote in > Hi Hackers, > > Analyzed the problem and created a patch to resolve it. > > # Problem 1 > > When you create a foreign key to a partitioned table, referential > integrity function is created for the number of partitions. >

RE: [Patch] Optimize dropping of relation buffers using dlist

2020-11-25 Thread k.jami...@fujitsu.com
On Thursday, November 19, 2020 4:08 PM, Tsunakawa, Takayuki wrote: > From: Andres Freund > > DropRelFileNodeBuffers() in recovery? The most common path is > > DropRelationFiles()->smgrdounlinkall()->DropRelFileNodesAllBuffers(), > > which 3/4 doesn't address and 4/4 doesn't mention. > > > > 4/4

Re: POC: Cleaning up orphaned files using undo logs

2020-11-25 Thread Amit Kapila
On Wed, Nov 25, 2020 at 8:00 PM Antonin Houska wrote: > > Amit Kapila wrote: > > > On Wed, Nov 18, 2020 at 4:03 PM Antonin Houska wrote: > > > > > > Amit Kapila wrote: > > > > > > > On Fri, Nov 13, 2020 at 6:02 PM Antonin Houska wrote: > > > > > > > > > > Amit Kapila wrote: > > > > > > > > >

Re: [PATCH] LWLock self-deadlock detection

2020-11-25 Thread Tom Lane
Craig Ringer writes: > On Wed, Nov 25, 2020 at 9:23 PM Ashutosh Bapat > wrote: >> I'd prefer to make the lock self deadlock check run for production >> builds, not just cassert builds. I'd like to register a strong objection to spending any cycles whatsoever on this. If you're using LWLocks in

Re: walsender bug: stuck during shutdown

2020-11-25 Thread Alvaro Herrera
On 2020-Nov-26, Fujii Masao wrote: > On the second thought, walsender doesn't wait forever unless > wal_sender_timeout is disabled, even in the case in discussion? > Or if there is the case where wal_sender_timeout doesn't work expectedly, > we might need to fix that at first. Hmm, no, it

RE: [POC] Fast COPY FROM command for the table with foreign partitions

2020-11-25 Thread tsunakawa.ta...@fujitsu.com
From: Amit Langote > Second is whether the interface for setting ri_usesMultiInsert > encourages situations where different modules could possibly engage in > conflicting behaviors. I can't think of a real-life example of that > with the current implementation, but maybe the interface provided

Re: [PATCH] LWLock self-deadlock detection

2020-11-25 Thread Craig Ringer
On Wed, Nov 25, 2020 at 9:23 PM Ashutosh Bapat wrote: > On Wed, Nov 25, 2020 at 11:47 AM Craig Ringer > wrote: > >> I am also seeing a pattern > >> Assert(!LWLockHeldByMe()); > >> LWLockAcquire() > >> > >> at some places. Should we change LWLockAcquire to do > >> Assert(!LWLockHeldByMe())

RE: Parallel Inserts in CREATE TABLE AS

2020-11-25 Thread Hou, Zhijie
Hi, I have an issue about the following code: econtext = node->ps.ps_ExprContext; ResetExprContext(econtext); + if (ISCTAS(node->ps.intoclause)) + { + ExecParallelInsertInCTAS(node); + return NULL; + } /* If no projection

Re: Multi Inserts in CREATE TABLE AS - revived patch

2020-11-25 Thread Bharath Rupireddy
On Wed, Nov 25, 2020 at 2:11 PM Luc Vlaming wrote: > > Thanks for reviving the patch! I did unfortunately have to shift my > priorities somewhat and did not find much time to work on open source > things the last week(s). > Thanks for the comments. > > I'm wondering about the use of the

RE: POC: postgres_fdw insert batching

2020-11-25 Thread tsunakawa.ta...@fujitsu.com
From: Tomas Vondra > Well, good that we all agree this is a useful feature to have (in > general). The question is whether postgres_fdw should be doing batching > on it's onw (per this thread) or rely on some other feature (libpq > pipelining). I haven't followed the other thread, so I don't have

Re: walsender bug: stuck during shutdown

2020-11-25 Thread Fujii Masao
On 2020/11/26 3:45, Alvaro Herrera wrote: On 2020-Nov-25, Fujii Masao wrote: But whether MyWalSnd->write is InvalidRecPtr or not, if it's behind sentPtr, walsender should keep waiting for the ack to all the sent message to be replied, i.e., isn't this expected behavior of normal shutdown?

Re: autovac issue with large number of tables

2020-11-25 Thread Kasahara Tatsuhito
On Wed, Nov 25, 2020 at 8:46 PM Masahiko Sawada wrote: > > On Wed, Nov 25, 2020 at 4:18 PM Kasahara Tatsuhito > wrote: > > > > Hi, > > > > On Wed, Nov 25, 2020 at 2:17 PM Masahiko Sawada > > wrote: > > > > > > On Fri, Sep 4, 2020 at 7:50 PM Kasahara Tatsuhito > > > wrote: > > > > > > > > Hi,

Re: Asynchronous Append on postgres_fdw nodes.

2020-11-25 Thread movead...@highgo.ca
I test the patch and occur several issues as blow: Issue one: Get a Assert error at 'Assert(bms_is_member(i, node->as_needrequest));' in ExecAppendAsyncRequest() function when I use more than two foreign table on different foreign server. I research the code and do such change then the Assert

Re: Deleting older versions in unique indexes to avoid page splits

2020-11-25 Thread Peter Geoghegan
On Wed, Nov 25, 2020 at 1:20 PM Victor Yegorov wrote: > In the _bt_delete_or_dedup_one_page() we start with the simple loop over > items on the page and > if there're any LP_DEAD tuples, we're kicking off _bt_delitems_delete(). Right. > So if I understood you right, you plan to make this loop

Re: Huge memory consumption on partitioned table with FKs

2020-11-25 Thread Keisuke Kuroda
Hi Hackers, Analyzed the problem and created a patch to resolve it. # Problem 1 When you create a foreign key to a partitioned table, referential integrity function is created for the number of partitions. Internally, SPI_prepare() creates a plan and SPI_keepplan() caches the plan. The more

Re: Libpq support to connect to standby server as priority

2020-11-25 Thread Greg Nancarrow
On Thu, Nov 26, 2020 at 3:43 AM Tom Lane wrote: > > Thanks for looking! Pushed. > > At this point the cfbot is going to start complaining that the last-posted > patch in this thread no longer applies. Unless you have a new patch set > nearly ready to post, I think we should close the CF entry

Re: [patch] CLUSTER blocks scanned progress reporting

2020-11-25 Thread Fujii Masao
On 2020/11/25 20:52, Matthias van de Meent wrote: On Wed, 25 Nov 2020 at 10:35, Fujii Masao wrote: On 2020/11/25 0:25, Matthias van de Meent wrote: I noticed that with my proposed patch it is still possible to go to the next phase while heap_blks_scanned != heap_blks_total. This can

Re: pg_dump, ATTACH, and independently restorable child partitions

2020-11-25 Thread Tom Lane
Justin Pryzby writes: > 1. Maybe pg_restore ExecuteSqlCommandBuf() should (always?) call > ExecuteSimpleCommands() instead of ExecuteSqlCommand(). It doesn't seem to > break anything (although that surprised me). That certainly does break everything, which I imagine is the reason why the cfbot

Re: Optimising latch signals

2020-11-25 Thread Thomas Munro
On Thu, Nov 19, 2020 at 4:49 PM Thomas Munro wrote: > I'll add this to the next commitfest. Let's see if this version fixes the Windows compile error and warning reported by cfbot. From 3eb542891a11d39047b28f6f33ae4e3d25bdd510 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Sat, 8 Aug 2020

Re: Deleting older versions in unique indexes to avoid page splits

2020-11-25 Thread Victor Yegorov
ср, 25 нояб. 2020 г. в 19:41, Peter Geoghegan : > We have promising tuples for bottom-up deletion. Why not have > "promising heap blocks" for traditional LP_DEAD index tuple deletion? > Or if you prefer, we can consider index tuples that *don't* have their > LP_DEAD bits set already but happen to

Re: enable_incremental_sort changes query behavior

2020-11-25 Thread James Coleman
On Wed, Nov 25, 2020 at 2:53 PM James Coleman wrote: > > On Tue, Nov 24, 2020 at 2:31 PM Tom Lane wrote: > > > > James Coleman writes: > > > On Mon, Nov 23, 2020 at 2:24 PM Tom Lane wrote: > > >> 1. James was wondering, far upthread, why we would do projections > > >> pre-sort or post-sort. I

Re: Add table access method as an option to pgbench

2020-11-25 Thread David Zhang
Thank a lot for your comments, Michael. On 2020-11-24 7:41 p.m., Michael Paquier wrote: On Tue, Nov 24, 2020 at 03:32:38PM -0800, David Zhang wrote: But, providing another option for the end user may not be a bad idea, and it might make the tests easier at some points. My first thought is

Re: POC: postgres_fdw insert batching

2020-11-25 Thread Tomas Vondra
On 11/25/20 7:31 AM, tsunakawa.ta...@fujitsu.com wrote: > From: Craig Ringer >> I suggest that when developing this, you keep in mind the ongoing >> work on the libpq pipelining/batching enhancements, and also the >> way many interfaces to foreign data sources support asynchronous, >> concurrent

Re: remove spurious CREATE INDEX CONCURRENTLY wait

2020-11-25 Thread Alvaro Herrera
On 2020-Nov-23, Andres Freund wrote: > On 2020-11-23 12:30:05 -0300, Alvaro Herrera wrote: > > In other words, my conclusion is that there definitely is a bug here and > > I am going to restore the use of exclusive lock for setting the > > statusFlags. > > Cool. Here's a patch. Note it also

Re: proposal: possibility to read dumped table's name from file

2020-11-25 Thread Tom Lane
Pavel Stehule writes: > st 25. 11. 2020 v 19:25 odesílatel Dean Rasheed > napsal: >> I agree that being able to configure pg_dump via a config file would >> be very useful, but the syntax proposed here feels much more like a >> hacked-up syntax designed to meet this one use case, rather than a

Re: enable_incremental_sort changes query behavior

2020-11-25 Thread James Coleman
On Tue, Nov 24, 2020 at 2:31 PM Tom Lane wrote: > > James Coleman writes: > > On Mon, Nov 23, 2020 at 2:24 PM Tom Lane wrote: > >> 1. James was wondering, far upthread, why we would do projections > >> pre-sort or post-sort. I think the answers can be found by studying > >> planner.c's

Re: SEARCH and CYCLE clauses

2020-11-25 Thread Pavel Stehule
st 25. 11. 2020 v 14:06 odesílatel Peter Eisentraut < peter.eisentr...@2ndquadrant.com> napsal: > On 2020-10-10 07:25, Pavel Stehule wrote: > > This patch is based on transformation CYCLE and SEARCH clauses to > > specific expressions - it is in agreement with ANSI SQL > > > > There is not a

Re: proposal: possibility to read dumped table's name from file

2020-11-25 Thread Pavel Stehule
Hi st 25. 11. 2020 v 19:25 odesílatel Dean Rasheed napsal: > On Thu, 19 Nov 2020 at 19:57, Pavel Stehule > wrote: > > > > minor update - fixed handling of processing names with double quotes > inside > > > > I see this is marked RFC, but reading the thread it doesn't feel like > we have

Re: [PATCH] Add section headings to index types doc

2020-11-25 Thread Tom Lane
=?UTF-8?Q?J=c3=bcrgen_Purtz?= writes: > Attached are two patches: a) summary against master and b) standalone of > my current changes. This was a bit confused ... as submitted, the patch wanted to commit a couple of patchfiles. I sorted it out I believe, and pushed with a little additional

Re: Improper use about DatumGetInt32

2020-11-25 Thread Alvaro Herrera
On 2020-Nov-25, Peter Eisentraut wrote: > bt_page_stats(PG_FUNCTION_ARGS) > { > text *relname = PG_GETARG_TEXT_PP(0); > - uint32 blkno = PG_GETARG_UINT32(1); > + int64 blkno = PG_GETARG_INT64(1); As a matter of style, I think it'd be better to have an

Re: [PATCH] Add `truncate` option to subscription commands

2020-11-25 Thread David Christensen
Hi, At this time I do not have time to make the necessary changes for this commitfest so I am voluntarily withdrawing this patch, but will revisit at a future time. Best, David On Wed, Oct 28, 2020 at 1:06 PM Rahila Syed wrote: > > Hi David, > > The feature seems useful to me. The code will

Re: walsender bug: stuck during shutdown

2020-11-25 Thread Alvaro Herrera
On 2020-Nov-25, Fujii Masao wrote: > But whether MyWalSnd->write is InvalidRecPtr or not, if it's behind sentPtr, > walsender should keep waiting for the ack to all the sent message to be > replied, i.e., isn't this expected behavior of normal shutdown? That is, > if we want to shutdown

Re: Deleting older versions in unique indexes to avoid page splits

2020-11-25 Thread Peter Geoghegan
On Wed, Nov 25, 2020 at 4:43 AM Victor Yegorov wrote: >> Then I had a much better idea: Make the existing LP_DEAD stuff a >> little more like bottom-up index deletion. We usually have to access >> heap blocks that the index tuples point to today, in order to have a >> latestRemovedXid cutoff (to

Re: proposal: possibility to read dumped table's name from file

2020-11-25 Thread Dean Rasheed
On Thu, 19 Nov 2020 at 19:57, Pavel Stehule wrote: > > minor update - fixed handling of processing names with double quotes inside > I see this is marked RFC, but reading the thread it doesn't feel like we have reached consensus on the design for this feature. I agree that being able to

Re: error_severity of brin work item

2020-11-25 Thread Justin Pryzby
On Mon, Nov 23, 2020 at 04:39:57PM -0300, Alvaro Herrera wrote: > I think this formulation (attached v3) has fewer moving parts. > > However, now that I did that, I wonder if this is really the best > approach to solve this problem. Maybe instead of doing this at the BRIN > level, it should be

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-25 Thread Bruce Momjian
On Wed, Nov 25, 2020 at 10:33:09AM -0500, Tom Lane wrote: > Magnus Hagander writes: > > I guess one option could be to just remove it, unconditionally. And > > assume that any users who is running it manually read that in docs > > somewhere that tells them what to do next, and that any user who's

Re: Libpq support to connect to standby server as priority

2020-11-25 Thread Tom Lane
Greg Nancarrow writes: > On Wed, Nov 25, 2020 at 12:07 PM Tom Lane wrote: >> Here's a v2 that does it like that. > Looks OK to me. Thanks for looking! Pushed. At this point the cfbot is going to start complaining that the last-posted patch in this thread no longer applies. Unless you have a

Re: Improper use about DatumGetInt32

2020-11-25 Thread Peter Eisentraut
On 2020-11-02 16:59, Peter Eisentraut wrote: I have committed 0003. For 0001, normal_rand(), I think you should reject negative arguments with an error. I have committed a fix for that. For 0002, I think you should change the block number arguments to int8, same as other contrib modules do.

Re: Transaction isolation and table contraints

2020-11-25 Thread David G. Johnston
On Wed, Nov 25, 2020 at 8:14 AM Konstantin Knizhnik < k.knizh...@postgrespro.ru> wrote: > Hi hackers, > > I wonder if it is considered as correct behavior that transaction > conflict detection depends on presence of primary key: > > create table t(pk integer, val integer); > insert into t values

Re: A few new options for CHECKPOINT

2020-11-25 Thread Stephen Frost
Greetings, * Bossart, Nathan (bossa...@amazon.com) wrote: > On 11/24/20, 4:03 PM, "tsunakawa.ta...@fujitsu.com" > wrote: > > From: Bossart, Nathan > >> The main purpose of this patch is to give users more control over their > >> manually > >> requested checkpoints or restartpoints. I suspect

Re: PoC: custom signal handler for extensions

2020-11-25 Thread Anastasia Lubennikova
On 03.09.2020 14:25, Pavel Borisov wrote: Is there a chance to see you restarting working on this patch ? I noticed that despite interest to the matter, the discussion in this CF thread stopped quite a while ago. So I'd like to push here a patch revised according to the previous

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-25 Thread Tom Lane
Magnus Hagander writes: > I guess one option could be to just remove it, unconditionally. And > assume that any users who is running it manually read that in docs > somewhere that tells them what to do next, and that any user who's > running it under a wrapper will have the wrapper set it up? I

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-25 Thread Magnus Hagander
On Wed, Nov 25, 2020 at 9:29 AM Peter Eisentraut wrote: > > On 2020-11-24 13:32, Magnus Hagander wrote: > > I think it boils down to that today the output from initdb is entirely > > geared towards people running initdb directly and starting their > > server manually, and very few people outside

Transaction isolation and table contraints

2020-11-25 Thread Konstantin Knizhnik
Hi hackers, I wonder if it is considered as correct behavior that transaction conflict detection depends on presence of primary key: create table t(pk integer, val integer); insert into t values (1,0),(2,0); Session1: begin isolation level serializable; Session2: begin isolation level

Re: A few new options for CHECKPOINT

2020-11-25 Thread Laurenz Albe
On Wed, 2020-11-25 at 11:41 +0100, Bernd Helmle wrote: > Am Mittwoch, den 25.11.2020, 13:47 +0900 schrieb Michael Paquier: > > > I can see the use case for IMMEDIATE, but I fail to see the use cases > > for WAIT and FORCE. CHECKPOINT_FORCE is internally implied for the > > end-of-recovery and

Re: Implementing Incremental View Maintenance

2020-11-25 Thread Konstantin Knizhnik
On 25.11.2020 16:06, Yugo NAGATA wrote: On Wed, 25 Nov 2020 15:16:05 +0300 Konstantin Knizhnik wrote: On 24.11.2020 13:11, Yugo NAGATA wrote: I wonder if it is possible to somehow use predicate locking mechanism of Postgres to avoid this anomalies without global lock? You mean that,

Re: Improper use about DatumGetInt32

2020-11-25 Thread Anastasia Lubennikova
On 02.11.2020 18:59, Peter Eisentraut wrote: I have committed 0003. For 0001, normal_rand(), I think you should reject negative arguments with an error. I've updated 0001. The change is trivial, see attached. For 0002, I think you should change the block number arguments to int8, same as

Re: Use standard SIGHUP and SIGTERM handlers in autoprewarm module

2020-11-25 Thread Bharath Rupireddy
On Wed, Nov 25, 2020 at 3:29 PM Fujii Masao wrote: > > On 2020/11/20 19:33, Bharath Rupireddy wrote: > > On Wed, Nov 18, 2020 at 5:52 PM Fujii Masao mailto:masao.fu...@oss.nttdata.com>> wrote: > > > > > > > handle_sigterm() and die() are similar except that die() has extra > > > >

Re: POC: Cleaning up orphaned files using undo logs

2020-11-25 Thread Antonin Houska
Amit Kapila wrote: > On Wed, Nov 18, 2020 at 4:03 PM Antonin Houska wrote: > > > > Amit Kapila wrote: > > > > > On Fri, Nov 13, 2020 at 6:02 PM Antonin Houska wrote: > > > > > > > > Amit Kapila wrote: > > > > > > > > > On Thu, Nov 12, 2020 at 2:45 PM Antonin Houska > > > > > wrote: > > > >

Re: Is postgres ready for 2038?

2020-11-25 Thread Pavel Borisov
> There are no 32bit Windows version builds since Postgres 11, see: > > https://www.postgresql.org/download/windows/ > > but Postgres 13 still has the same 2038 problems. > > > > As @Pavel Borisov hints , I can find `_USE_32BIT_TIME_T` code here: > >

Re: POC: Cleaning up orphaned files using undo logs

2020-11-25 Thread Antonin Houska
Antonin Houska wrote: > Amit Kapila wrote: > > I think we also need to maintain oldestXidHavingUndo for CLOG truncation and > > transaction-wraparound. We can't allow CLOG truncation for the transaction > > whose undo is not discarded as that could be required by some other > > transaction. >

POC: Better infrastructure for automated testing of concurrency issues

2020-11-25 Thread Alexander Korotkov
Hackers, PostgreSQL is a complex multi-process system, and we are periodically faced with complicated concurrency issues. While the postgres community does a great job on investigating and fixing the problems, our ability to reproduce concurrency issues in the source code test suites is limited.

Re: Parallel plans and "union all" subquery

2020-11-25 Thread Greg Nancarrow
On Wed, Nov 25, 2020 at 6:43 PM Luc Vlaming wrote: > > > You're completely right, sorry for my error. I was too quick on assuming > my patch would work for this specific case too; I should have tested > that before replying. It looked very similar but turns out to not work > because of the upper

Re: Online checksums patch - once again

2020-11-25 Thread Heikki Linnakangas
On 25/11/2020 15:20, Daniel Gustafsson wrote: On 23 Nov 2020, at 18:36, Heikki Linnakangas wrote: What happens is if you crash between UpdateControlFile() and XlogChecksum()? Good point, that would not get the cluster to a consistent state. The XlogChecksum should be performed before

Re: [PATCH] LWLock self-deadlock detection

2020-11-25 Thread Ashutosh Bapat
On Wed, Nov 25, 2020 at 11:47 AM Craig Ringer wrote: >> I am also seeing a pattern >> Assert(!LWLockHeldByMe()); >> LWLockAcquire() >> >> at some places. Should we change LWLockAcquire to do >> Assert(!LWLockHeldByMe()) always to detect such occurrences? > > > I'm inclined not to, at least not

Re: Add Information during standby recovery conflicts

2020-11-25 Thread Masahiko Sawada
On Fri, Nov 20, 2020 at 6:18 PM Drouvot, Bertrand wrote: > > Hi, > > On 11/17/20 4:44 PM, Fujii Masao wrote: > > > > Thanks for updating the patch! Here are review comments. > > > > +Controls whether a log message is produced when the startup > > process > > +is waiting longer

Re: Implementing Incremental View Maintenance

2020-11-25 Thread Yugo NAGATA
On Wed, 25 Nov 2020 15:16:05 +0300 Konstantin Knizhnik wrote: > > > On 24.11.2020 13:11, Yugo NAGATA wrote: > > > >> I wonder if it is possible to somehow use predicate locking mechanism of > >> Postgres to avoid this anomalies without global lock? > > You mean that, ,instead of using any

Re: SEARCH and CYCLE clauses

2020-11-25 Thread Peter Eisentraut
On 2020-10-10 07:25, Pavel Stehule wrote: This patch is based on transformation CYCLE and SEARCH clauses to specific expressions - it is in agreement with ANSI SQL There is not a problem with compilation Nobody had objections in discussion There are enough regress tests and documentation

Re: Deleting older versions in unique indexes to avoid page splits

2020-11-25 Thread Victor Yegorov
ср, 25 нояб. 2020 г. в 05:35, Peter Geoghegan : > Then I had a much better idea: Make the existing LP_DEAD stuff a > little more like bottom-up index deletion. We usually have to access > heap blocks that the index tuples point to today, in order to have a > latestRemovedXid cutoff (to generate

Re: Implementing Incremental View Maintenance

2020-11-25 Thread Konstantin Knizhnik
On 24.11.2020 13:11, Yugo NAGATA wrote: I wonder if it is possible to somehow use predicate locking mechanism of Postgres to avoid this anomalies without global lock? You mean that, ,instead of using any table lock, if any possibility of the anomaly is detected using predlock mechanism

Re: [patch] CLUSTER blocks scanned progress reporting

2020-11-25 Thread Matthias van de Meent
On Wed, 25 Nov 2020 at 10:35, Fujii Masao wrote: > > On 2020/11/25 0:25, Matthias van de Meent wrote: > > > > I noticed that with my proposed patch it is still possible to go to > > the next phase while heap_blks_scanned != heap_blks_total. This can > > happen when the final heap pages contain

Re: autovac issue with large number of tables

2020-11-25 Thread Masahiko Sawada
On Wed, Nov 25, 2020 at 4:18 PM Kasahara Tatsuhito wrote: > > Hi, > > On Wed, Nov 25, 2020 at 2:17 PM Masahiko Sawada wrote: > > > > On Fri, Sep 4, 2020 at 7:50 PM Kasahara Tatsuhito > > wrote: > > > > > > Hi, > > > > > > On Wed, Sep 2, 2020 at 2:10 AM Kasahara Tatsuhito > > > wrote: > > > > >

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-11-25 Thread Fujii Masao
On 2020/11/19 16:31, Masahiro Ikeda wrote: On 2020-11-17 11:46, Fujii Masao wrote: On 2020/11/16 16:35, Masahiro Ikeda wrote: On 2020-11-12 14:58, Fujii Masao wrote: On 2020/11/06 10:25, Masahiro Ikeda wrote: On 2020-10-30 11:50, Fujii Masao wrote: On 2020/10/29 17:03, Masahiro Ikeda

Re: A few new options for CHECKPOINT

2020-11-25 Thread Bernd Helmle
Am Mittwoch, den 25.11.2020, 13:47 +0900 schrieb Michael Paquier: > I can see the use case for IMMEDIATE, but I fail to see the use cases > for WAIT and FORCE.  CHECKPOINT_FORCE is internally implied for the > end-of-recovery and shutdown checkpoints.  WAIT could be a dangerous > thing if

Re: Is postgres ready for 2038?

2020-11-25 Thread 方徳輝
Hi dear pgsql hackers Thanks for replies. There are no 32bit Windows version builds since Postgres 11, see: https://www.postgresql.org/download/windows/ but Postgres 13 still has the same 2038 problems. As @Pavel Borisov hints , I can find `_USE_32BIT_TIME_T` code here:

  1   2   >