Patch: to pass query string to pg_plan_query()

2020-03-09 Thread legrand legrand
Hello, This is a call for committers, reviewers and users, regarding "planning counters in pg_stat_statements" patch [1] but not only. Historically, this version of pg_stat_statements with planning counters was performing 3 calls to pgss_store() for non utility statements in: 1 -

Re: Proposal: PqSendBuffer removal

2020-03-09 Thread Tom Lane
Andres Freund writes: > On 2020-03-07 13:54:57 -0500, Tom Lane wrote: >> This seems way overcomplicated compared to what I suggested (ie, >> just let internal_putbytes bypass the buffer in cases where the >> data would get flushed next time through its loop anyway). > Well, we quite frequently

Re: Should we remove a fallback promotion? take 2

2020-03-09 Thread Andres Freund
Hi, On 2020-03-06 16:33:18 -0300, Alvaro Herrera wrote: > On 2020-Mar-06, Michael Paquier wrote: > > On Thu, Mar 05, 2020 at 09:40:54AM -0500, Robert Haas wrote: > > > Seems reasonable, but it would be better if people proposed these > > > kinds of changes closer to the beginning of the release

Re: Index Skip Scan

2020-03-09 Thread James Coleman
On Mon, Mar 9, 2020 at 3:56 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > Assuming we'll implement it in a way that we do not know about what kind > of path type is that in create_distinct_path, then it can also work for > ProjectionPath or anything else (if UniqueKeys are present). But then

time for catalog/pg_cast.c?

2020-03-09 Thread Alvaro Herrera
I extracted from the latest multirange patch a bit that creates a new routine CastCreate() in src/backend/catalog/pg_cast.c. It contains the catalog-accessing bits to create a new cast. It seems harmless, so I thought I'd apply it to get rid of a couple of hunks in the large patch. (I also

Re: Support external parameters in EXECUTE command

2020-03-09 Thread Tom Lane
Peter Eisentraut writes: > Continuing the discussion in [0], here is a patch that allows parameter > references in the arguments of the EXECUTE command. The main purpose is > submitting protocol-level parameters, but the added regression test case > shows another way to exercise it. I spent

Re: [PATCH] Erase the distinctClause if the result is unique by definition

2020-03-09 Thread David Rowley
On Sat, 7 Mar 2020 at 00:47, Andy Fan wrote: > Upload the newest patch so that the cfbot can pass. The last patch failed > because some explain without the (cost off). I've only really glanced at this patch, but I think we need to do this in a completely different way. I've been mentioning

Re: effective_io_concurrency's steampunk spindle maths

2020-03-09 Thread Thomas Munro
On Sat, Mar 7, 2020 at 9:07 AM Tom Lane wrote: > Tomas Vondra writes: > > So I think we should either rename e_i_c or keep it as is, and then also > > have a new GUC. And then translate the values between those (but that > > might be overkill). > > Please DON'T try to have two interrelated GUCs

Re: Reducing WaitEventSet syscall churn

2020-03-09 Thread Kyotaro Horiguchi
Hello. I looked this. At Thu, 27 Feb 2020 12:17:45 +1300, Thomas Munro wrote in > On Sat, Feb 8, 2020 at 10:15 AM Thomas Munro wrote: > > > > Here are some patches to get rid of frequent system calls. > > Here's a new version of this patch set. It gets rid of all temporary > WaitEventSets

Re: Nicer error when connecting to standby with hot_standby=off

2020-03-09 Thread Andres Freund
Hi, On 2020-03-09 18:40:32 -0400, James Coleman wrote: > On Mon, Mar 9, 2020 at 6:28 PM Andres Freund wrote: > > > I wanted to get some initial feedback on the idea before writing a patch: > > > does that seem like a reasonable change? Is it actually plausible to > > > distinguish between this

Re: Proposal: PqSendBuffer removal

2020-03-09 Thread Andres Freund
Hi, On 2020-03-07 13:54:57 -0500, Tom Lane wrote: > Andres Freund writes: > > What I'm thinking is that we'd have pg_beginmessage() (potentially a > > different named version) initialize the relevant StringInfo basically as > > > (StringInfoData){ > > .data = PqSendPointer, > > .len =

Re: Nicer error when connecting to standby with hot_standby=off

2020-03-09 Thread James Coleman
On Mon, Mar 9, 2020 at 6:28 PM Andres Freund wrote: > > Hi, > > On 2020-03-08 20:12:21 -0400, James Coleman wrote: > > I recently noticed while setting up a test environment that attempting to > > connect to a standby running without hot_standby=on results in a fairly > > generic error (I believe

Re: Bug in pg_restore with EventTrigger in parallel mode

2020-03-09 Thread Fabrízio de Royes Mello
On Mon, Mar 9, 2020 at 3:59 PM Tom Lane wrote: > > =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= writes: > > On Mon, Mar 9, 2020 at 12:27 PM Tom Lane wrote: > >> Which, TBH, makes me wonder about the validity of the original complaint > >> in this thread. I don't mind delaying ET restore as long as

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-03-09 Thread Justin Pryzby
On Sat, Feb 29, 2020 at 08:53:04AM -0600, Justin Pryzby wrote: > On Sat, Feb 29, 2020 at 03:35:27PM +0300, Alexey Kondratov wrote: > > Anyway, new version is attached. It is rebased in order to resolve conflicts > > with a recent fix of REINDEX CONCURRENTLY + temp relations, and includes > > this

Re: time for catalog/pg_cast.c?

2020-03-09 Thread Alvaro Herrera
On 2020-Mar-09, Alvaro Herrera wrote: > I extracted from the latest multirange patch a bit that creates a new > routine CastCreate() in src/backend/catalog/pg_cast.c. It contains the > catalog-accessing bits to create a new cast. It seems harmless, so I > thought I'd apply it to get rid of a

Re: Nicer error when connecting to standby with hot_standby=off

2020-03-09 Thread Andres Freund
Hi, On 2020-03-08 20:12:21 -0400, James Coleman wrote: > I recently noticed while setting up a test environment that attempting to > connect to a standby running without hot_standby=on results in a fairly > generic error (I believe "the database system is starting up"). I don't > have my test

Re: effective_io_concurrency's steampunk spindle maths

2020-03-09 Thread Thomas Munro
On Sat, Mar 7, 2020 at 11:54 PM Evgeniy Shishkin wrote: > > On Mar 7, 2020, at 00:33, Thomas Munro wrote: > > That is indeed what led me to start thinking about what a good new > > name would be. > > MySQL has a term io_capacity. >

Re: range_agg

2020-03-09 Thread Jeff Davis
On Sat, 2020-03-07 at 16:06 -0500, Tom Lane wrote: > Actually ... have you given any thought to just deciding that ranges > and > multiranges are the same type? It has come up in a number of conversations, but I'm not sure if it was discussed on this list. > I think on the whole the advantages

Re: range_agg

2020-03-09 Thread Alvaro Herrera
I wonder what's the point of multirange arrays. Is there a reason we create those? -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: range_agg

2020-03-09 Thread Tom Lane
Alvaro Herrera writes: > I wonder what's the point of multirange arrays. Is there a reason we > create those? That's what we thought about arrays of composites to start with, too. regards, tom lane

Re: Improve search for missing parent downlinks in amcheck

2020-03-09 Thread Peter Geoghegan
On Sun, Mar 8, 2020 at 2:52 PM Alexander Korotkov wrote: > I've revised this comment. Hopefully it's better now. I think that the new comments about why we need a low key for the page are much better now. > I've updated this comment using terms "cousin page" and "subtree". I > didn't refer

RE: Proposal: Add more compile-time asserts to expose inconsistencies.

2020-03-09 Thread Smith, Peter
Hi Michael, Sorry I was AWOL for a couple of months. Thanks for taking the patch further, and committing it. Kind Regards --- Peter Smith Fujitsu Australia

Re: Index Skip Scan

2020-03-09 Thread David Rowley
On Tue, 10 Mar 2020 at 08:56, Dmitry Dolgov <9erthali...@gmail.com> wrote: > Assuming we'll implement it in a way that we do not know about what kind > of path type is that in create_distinct_path, then it can also work for > ProjectionPath or anything else (if UniqueKeys are present). But then >

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2020-03-09 Thread Thomas Munro
On Tue, Mar 10, 2020 at 8:43 AM Fabien COELHO wrote: > >> Thank you very much! I'm going to send a new patch set until the end of > >> this week (I'm sorry I was very busy in the release of Postgres Pro > >> 11...). > > > > Is anyone interested in rebasing this, and summarising what needs to > >

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2020-03-09 Thread Fabien COELHO
Hello Thomas, Thank you very much! I'm going to send a new patch set until the end of this week (I'm sorry I was very busy in the release of Postgres Pro 11...). Is anyone interested in rebasing this, and summarising what needs to be done to get it in? It's arguably a bug or at least quite

Re: Index Skip Scan

2020-03-09 Thread Dmitry Dolgov
> On Mon, Mar 09, 2020 at 10:27:26AM +1300, David Rowley wrote: > > > > I think the changes in create_distinct_paths() need more work. The > > > way I think this should work is that create_distinct_paths() gets to > > > know exactly nothing about what path types support the elimination of > > >

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-09 Thread David Rowley
On Sat, 7 Mar 2020 at 03:45, Laurenz Albe wrote: > > Thanks, Justin, for the review. > I have applied the changes where still applicable. > > On Fri, 2020-03-06 at 10:52 +1300, David Rowley wrote: > > Lack of a scale_factor does leave people who regularly truncate their > > "append-only" tables

Re: Add an optional timeout clause to isolationtester step.

2020-03-09 Thread Andres Freund
Hi, On 2020-03-07 22:17:09 +0100, Julien Rouhaud wrote: > For reindex concurrently, a SELECT FOR UPDATE on a different connection can > ensure that the reindex will be stuck at some point, so canceling the command > after a long enough timeout reproduces the original faulty behavior. That kind

Re: Add absolute value to dict_int

2020-03-09 Thread Tom Lane
I wrote: > There are at least three things we could do here: > 1. Insist that defGetBoolean and its siblings should accept the > string equivalent of any non-string value they accept. This > would change the behavior of a whole lot of utility commands, > not only the text search commands, and I'm

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-09 Thread David Rowley
On Tue, 10 Mar 2020 at 09:56, David Rowley wrote: > > On Sat, 7 Mar 2020 at 03:45, Laurenz Albe wrote: > > Updated patch attached. > > Great. I'll have a look. I don't really have many complaints about the v4 patch. However, during my pass of it, I did note down a few things that you might

Re: Nicer error when connecting to standby with hot_standby=off

2020-03-09 Thread James Coleman
On Mon, Mar 9, 2020 at 8:06 PM Andres Freund wrote: > > Hi, > > On 2020-03-09 18:40:32 -0400, James Coleman wrote: > > On Mon, Mar 9, 2020 at 6:28 PM Andres Freund wrote: > > > > I wanted to get some initial feedback on the idea before writing a > > > > patch: > > > > does that seem like a

Re: Asynchronous Append on postgres_fdw nodes.

2020-03-09 Thread movead li
The following review has been posted through the commitfest application: make installcheck-world: tested, failed Implements feature: tested, passed Spec compliant: tested, passed Documentation:not tested I occur a strange issue when a exec 'make installcheck-world',

Re: pg_stat_progress_basebackup - progress reporting for pg_basebackup, in the server side

2020-03-09 Thread Fujii Masao
On 2020/03/09 14:21, Magnus Hagander wrote: On Sun, Mar 8, 2020 at 10:13 PM Kyotaro Horiguchi wrote: At Fri, 6 Mar 2020 09:54:09 -0800, Magnus Hagander wrote in On Fri, Mar 6, 2020 at 1:51 AM Fujii Masao wrote: I believe that the time required to estimate the backup size is not so

Re: shared-memory based stats collector

2020-03-09 Thread Kyotaro Horiguchi
At Tue, 10 Mar 2020 12:27:25 +0900 (JST), Kyotaro Horiguchi wrote in > That's true, but I have the same concern with Tom. The archive bacame > too-tightly linked with other processes than actual relation. We may > need the second static shared memory segment apart from the current > one.

Re: DROP and ddl_command_end.

2020-03-09 Thread Kyotaro Horiguchi
Thanks. At Mon, 9 Mar 2020 13:29:47 -0400, Robert Haas wrote in > On Mon, Mar 9, 2020 at 3:54 AM Kyotaro Horiguchi > wrote: > > I may be missing something, andt any opinions, thoughts or suggestions > > are welcome. > > Since it's a set-returning function, I would have expected that > instead

Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line

2020-03-09 Thread Michael Paquier
On Mon, Mar 09, 2020 at 03:38:29PM +0530, Kuntal Ghosh wrote: > That's a good suggestion. But, it's unlikely that a caller would pass > something longer than MAXPGPATH and we indeed use that value a lot in > the code. IMHO, it looks okay to me to have that assumption here as > well. Well, a more

Re: logical copy_replication_slot issues

2020-03-09 Thread Masahiko Sawada
On Mon, 9 Mar 2020 at 21:46, Arseny Sher wrote: > > > Masahiko Sawada writes: > > > /* > > -* Create logical decoding context, to build the initial snapshot. > > +* Create logical decoding context to find start point or, if we don't > > +* need it, to 1) bump slot's restart_lsn

Re: Proposal: Add more compile-time asserts to expose inconsistencies.

2020-03-09 Thread Michael Paquier
On Tue, Mar 10, 2020 at 12:22:32AM +, Smith, Peter wrote: > Sorry I was AWOL for a couple of months. Thanks for taking the patch > further, and committing it. No problem, I am glad to see you around. -- Michael signature.asc Description: PGP signature

Re: Add an optional timeout clause to isolationtester step.

2020-03-09 Thread Michael Paquier
On Mon, Mar 09, 2020 at 10:32:27PM -0400, Tom Lane wrote: > It strikes me to wonder whether we could improve matters by teaching > isolationtester to watch for particular values in a connected backend's > pg_stat_activity.wait_event_type/wait_event columns. Those columns > didn't exist when

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-09 Thread Laurenz Albe
On Tue, 2020-03-10 at 09:56 +1300, David Rowley wrote: > > > Lack of a scale_factor does leave people who regularly truncate their > > > "append-only" tables out in the cold a bit. Perhaps they'd like > > > index-only scans to kick in soon after they truncate without having to > > > wait for 10

Re: reindex concurrently and two toast indexes

2020-03-09 Thread Michael Paquier
On Mon, Mar 09, 2020 at 08:04:27AM +0100, Julien Rouhaud wrote: > On Mon, Mar 09, 2020 at 02:52:31PM +0900, Michael Paquier wrote: >> For the index-level operation, issuing a WARNING is not consistent >> with the existing practice to use an ERROR, which is more adapted as >> the operation is done

Re: shared-memory based stats collector

2020-03-09 Thread Kyotaro Horiguchi
Thank you all for the suggestions. At Mon, 9 Mar 2020 12:25:39 -0700, Andres Freund wrote in > Hi, > > On 2020-03-09 15:04:23 -0400, Tom Lane wrote: > > Andres Freund writes: > > > On 2020-03-09 15:37:05 -0300, Alvaro Herrera wrote: > > >> I'm worried that we're causing all processes to

Re: bad logging around broken restore_command

2020-03-09 Thread Kyotaro Horiguchi
At Thu, 6 Feb 2020 23:23:42 +0900, Fujii Masao wrote in > On 2020/02/06 1:10, Jeff Janes wrote: > > If the restore command claims to have succeeded, but fails to have created > > a file with the right name (due to typos or escaping or quoting issues, for > > example), no complaint is issued at

Re: shared-memory based stats collector

2020-03-09 Thread Andres Freund
On 2020-03-10 12:27:25 +0900, Kyotaro Horiguchi wrote: > That's true, but I have the same concern with Tom. The archive bacame > too-tightly linked with other processes than actual relation. What's the problem here? We have a number of helper processes (checkpointer, bgwriter) that are attached

Re: Add an optional timeout clause to isolationtester step.

2020-03-09 Thread Tom Lane
Michael Paquier writes: > On Mon, Mar 09, 2020 at 10:32:27PM -0400, Tom Lane wrote: >> It strikes me to wonder whether we could improve matters by teaching >> isolationtester to watch for particular values in a connected backend's >> pg_stat_activity.wait_event_type/wait_event columns. Those

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-09 Thread Justin Pryzby
> +++ b/src/backend/utils/misc/postgresql.conf.sample > +#autovacuum_vacuum_insert_threshold = 1000 # min number of row > inserts > + # before vacuum Similar to a previous comment [0] about reloptions or GUC: Can we say "threshold number of

Re: Add an optional timeout clause to isolationtester step.

2020-03-09 Thread Tom Lane
Michael Paquier writes: > On Mon, Mar 09, 2020 at 03:15:58PM -0700, Andres Freund wrote: >> That kind of thing can already be done using statement_timeout or >> lock_timeout, no? > Yep, still that's not something I would recommend to commit in the > tree as that's a double-edged sword as you

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2020-03-09 Thread Dilip Kumar
On Mon, Mar 9, 2020 at 2:36 PM Amit Kapila wrote: > > On Mon, Mar 9, 2020 at 2:09 PM Masahiko Sawada > wrote: >> >> On Mon, 9 Mar 2020 at 15:50, Amit Kapila wrote: >> > >> > On Mon, Mar 9, 2020 at 11:38 AM Masahiko Sawada >> > wrote: >> >> >> >> On Mon, 9 Mar 2020 at 14:16, Amit Kapila

Re: Some problems of recovery conflict wait events

2020-03-09 Thread Masahiko Sawada
On Tue, 10 Mar 2020 at 00:57, Fujii Masao wrote: > > > > On 2020/03/09 14:10, Masahiko Sawada wrote: > > On Mon, 9 Mar 2020 at 13:24, Fujii Masao > > wrote: > >> > >> > >> > >> On 2020/03/08 13:52, Masahiko Sawada wrote: > >>> On Thu, 5 Mar 2020 at 20:16, Fujii Masao > >>> wrote: > >

Re: Crash by targetted recovery

2020-03-09 Thread Fujii Masao
On 2020/03/09 15:46, Fujii Masao wrote: On 2020/03/09 13:49, Kyotaro Horiguchi wrote: At Sat, 7 Mar 2020 01:46:16 +0900, Fujii Masao wrote in (It seems retroverting to the first patch when I started this...) The second place covers wider cases so I reverted the first place. Thanks for

Re: Add an optional timeout clause to isolationtester step.

2020-03-09 Thread Michael Paquier
On Mon, Mar 09, 2020 at 03:15:58PM -0700, Andres Freund wrote: > On 2020-03-07 22:17:09 +0100, Julien Rouhaud wrote: >> For reindex concurrently, a SELECT FOR UPDATE on a different connection can >> ensure that the reindex will be stuck at some point, so canceling the command >> after a long

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2020-03-09 Thread Masahiko Sawada
On Mon, 9 Mar 2020 at 14:16, Amit Kapila wrote: > > On Sun, Mar 8, 2020 at 7:58 AM Masahiko Sawada > wrote: >> >> On Mon, 24 Feb 2020 at 19:08, Amit Kapila wrote: >> > >> > On Thu, Feb 20, 2020 at 8:06 AM Andres Freund wrote: >> > > >> > > Hi, >> > > >> > > On 2020-02-19 11:12:18 +0530, Amit

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2020-03-09 Thread Amit Kapila
On Mon, Mar 9, 2020 at 11:38 AM Masahiko Sawada < masahiko.saw...@2ndquadrant.com> wrote: > On Mon, 9 Mar 2020 at 14:16, Amit Kapila wrote: > > > > On Sun, Mar 8, 2020 at 7:58 AM Masahiko Sawada < > masahiko.saw...@2ndquadrant.com> wrote: > >> > > >> > Fair position, as per initial analysis, I

Re: reindex concurrently and two toast indexes

2020-03-09 Thread Julien Rouhaud
On Mon, Mar 09, 2020 at 02:52:31PM +0900, Michael Paquier wrote: > On Fri, Mar 06, 2020 at 01:36:48PM +0100, Julien Rouhaud wrote: > > > > v4 attached, which doesn't prevent a REINDEX INDEX CONCURRENTLY on any > > invalid > > non-TOAST index anymore. > > Thanks. The position of the error check

Re: Additional improvements to extended statistics

2020-03-09 Thread Dean Rasheed
On Mon, 9 Mar 2020 at 00:02, Tomas Vondra wrote: > > Speaking of which, would you take a look at [1]? I think supporting SAOP > is fine, but I wonder if you agree with my conclusion we can't really > support inclusion @> as explained in [2]. > Hmm, I'm not sure. However, thinking about your

Re: [PATCH] Support built control file in PGXS VPATH builds

2020-03-09 Thread Peter Eisentraut
On 2020-02-07 04:14, Craig Ringer wrote: > The attached patch fixes this by having PGXS resolve > $(EXTENSION).control along the VPATH. Simpler patch: diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk index 271e7eaba8..1cd750eecd 100644 --- a/src/makefiles/pgxs.mk +++

Re: Improve handling of parameter differences in physical replication

2020-03-09 Thread Peter Eisentraut
On 2020-02-28 16:33, Alvaro Herrera wrote: Hmm, so what is the actual end-user behavior? As I read the code, we first send the WARNING, then pause recovery until the user resumes replication; at that point we raise the original error. Presumably, at that point the startup process terminates

Re: allow trigger to get updated columns

2020-03-09 Thread Peter Eisentraut
On 2020-03-05 13:53, Daniel Gustafsson wrote: The 0001 refactoring patch seems a clear win to me. In the 0002 patch: +For UPDATE triggers, a bitmap set indicating the +columns that were updated by the triggering command. Generic trigger Is it worth pointing out that

Re: Add an optional timeout clause to isolationtester step.

2020-03-09 Thread Julien Rouhaud
On Mon, Mar 09, 2020 at 04:47:27PM +0900, Michael Paquier wrote: > On Sat, Mar 07, 2020 at 10:46:34AM -0500, Tom Lane wrote: > > The arbitrarily-set timeouts that exist in some of the isolation tests > > are horrid kluges that have caused us lots of headaches in the past > > and no doubt will

Re: Add an optional timeout clause to isolationtester step.

2020-03-09 Thread Michael Paquier
On Sat, Mar 07, 2020 at 10:46:34AM -0500, Tom Lane wrote: > The arbitrarily-set timeouts that exist in some of the isolation tests > are horrid kluges that have caused us lots of headaches in the past > and no doubt will again in the future. Aside from occasionally failing > when a machine is

Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line

2020-03-09 Thread Michael Paquier
On Fri, Mar 06, 2020 at 05:22:16PM +0900, Michael Paquier wrote: > Thanks for the suggestion. Avoiding dead code makes sense as well > here. I'll think about this stuff a bit more first. Okay, after pondering more on that, here is a first cut with a patch refactoring restore_command build to

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2020-03-09 Thread Masahiko Sawada
On Mon, 9 Mar 2020 at 15:50, Amit Kapila wrote: > > On Mon, Mar 9, 2020 at 11:38 AM Masahiko Sawada > wrote: >> >> On Mon, 9 Mar 2020 at 14:16, Amit Kapila wrote: >> > >> > On Sun, Mar 8, 2020 at 7:58 AM Masahiko Sawada >> > wrote: >> >> > >> >> > Fair position, as per initial analysis, I

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2020-03-09 Thread Amit Kapila
On Mon, Mar 9, 2020 at 2:09 PM Masahiko Sawada < masahiko.saw...@2ndquadrant.com> wrote: > On Mon, 9 Mar 2020 at 15:50, Amit Kapila wrote: > > > > On Mon, Mar 9, 2020 at 11:38 AM Masahiko Sawada < > masahiko.saw...@2ndquadrant.com> wrote: > >> > >> On Mon, 9 Mar 2020 at 14:16, Amit Kapila >

Re: Identifying user-created objects

2020-03-09 Thread Kyotaro Horiguchi
At Sun, 8 Mar 2020 11:55:06 +0900, Masahiko Sawada wrote in > On Thu, 5 Mar 2020 at 18:39, Kyotaro Horiguchi > wrote: > > > > At Thu, 5 Mar 2020 18:06:26 +0900, Masahiko Sawada > > wrote in > > > On Thu, 5 Mar 2020 at 16:36, Kyotaro Horiguchi > > > wrote: > > > I think normally users

Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line

2020-03-09 Thread Kuntal Ghosh
On Mon, Mar 9, 2020 at 1:46 PM Michael Paquier wrote: > > On Fri, Mar 06, 2020 at 05:22:16PM +0900, Michael Paquier wrote: > > Thanks for the suggestion. Avoiding dead code makes sense as well > > here. I'll think about this stuff a bit more first. > > Okay, after pondering more on that, here

Re: Crash by targetted recovery

2020-03-09 Thread Fujii Masao
On 2020/03/09 13:49, Kyotaro Horiguchi wrote: At Sat, 7 Mar 2020 01:46:16 +0900, Fujii Masao wrote in (It seems retroverting to the first patch when I started this...) The second place covers wider cases so I reverted the first place. Thanks for updating the patch that way. Not sure

DROP and ddl_command_end.

2020-03-09 Thread Kyotaro Horiguchi
Hello. When I created an event trigger for ddl_command_end, I think the only means to identify for what the trigger function is called is pg_event_trigger_ddl_commands() so I wrote as the following function and defined an event trigger for ddl_command_end. CREATE OR REPLACE FUNCTION hoge()

Re: pg_rewind docs correction

2020-03-09 Thread Michael Paquier
On Sun, Mar 08, 2020 at 05:13:21PM -0400, James Coleman wrote: > I've added the information about how the backup label control file is > written, and updated the How It Works steps to refer to that separately > from restart. > > Additionally the How It Works is updated to include WAL segments and

Re: Improve handling of parameter differences in physical replication

2020-03-09 Thread Masahiko Sawada
On Sat, 29 Feb 2020 at 06:39, Alvaro Herrera wrote: > > On 2020-Feb-27, Peter Eisentraut wrote: > > > So this patch relaxes this a bit. Upon receipt of > > XLOG_PARAMETER_CHANGE, we still check the settings but only issue a > > warning and set a global flag if there is a problem. Then when we >

Re: Improve handling of parameter differences in physical replication

2020-03-09 Thread Peter Eisentraut
On 2020-03-09 09:11, Masahiko Sawada wrote: I think after recovery is paused users will be better to restart the server rather than resume the recovery. I agree with this idea but I'm slightly concerned that users might not realize that recovery is paused until they look at that line in server

Re: Crash by targetted recovery

2020-03-09 Thread Kyotaro Horiguchi
At Mon, 9 Mar 2020 15:46:49 +0900, Fujii Masao wrote in > On 2020/03/09 13:49, Kyotaro Horiguchi wrote: > > At Sat, 7 Mar 2020 01:46:16 +0900, Fujii Masao > >> Regarding 0003 patch, I added a bit more detail comments into > >> the patch so that we can understand the code more easily. > >>

Re: Planning counters in pg_stat_statements (using pgss_store)

2020-03-09 Thread Julien Rouhaud
On Thu, Mar 05, 2020 at 01:26:19PM -0700, legrand legrand wrote: > Please consider PG13 shortest path ;o) > > My one is parse->queryId != UINT64CONST(0) in pgss_planner_hook(). > It fixes IVM problem (verified), > and keep CTAS equal to pgss without planning counters (verified too). I still

Re: Remove win32ver.rc from version_stamp.pl

2020-03-09 Thread Peter Eisentraut
On 2020-03-01 23:51, Tom Lane wrote: In general, while I'm on board with the idea, I wonder whether it wouldn't be smarter to keep on defining PG_MAJORVERSION as a string, and just add PG_MAJORVERSION_NUM alongside of it. This would eliminate some hunks from the patch in places where it's more

Re: ccache is required by postgresql12-devel RPM

2020-03-09 Thread Kyotaro Horiguchi
At Sat, 07 Mar 2020 13:41:58 -0500, Tom Lane wrote in > Bruce Momjian writes: > > On Thu, Jan 30, 2020 at 08:36:17PM +0900, Kyotaro Horiguchi wrote: > >> I notieced that the official PG12-devel RPM pacakge for RHEL8 mandates > >> ccache being installed on building of an extension. > >> > >> $

Re: Remove win32ver.rc from version_stamp.pl

2020-03-09 Thread Tom Lane
Peter Eisentraut writes: > On 2020-03-01 23:51, Tom Lane wrote: >> In general, while I'm on board with the idea, I wonder whether it >> wouldn't be smarter to keep on defining PG_MAJORVERSION as a string, >> and just add PG_MAJORVERSION_NUM alongside of it. > Agreed. Here is another patch.

Re: backend type in log_line_prefix?

2020-03-09 Thread Kuntal Ghosh
Hello, On Sat, Mar 7, 2020 at 8:38 PM Peter Eisentraut wrote: > > Updated patch set because of conflicts. > Thank you for the patch. This feature is really helpful. Here are some minor comments: In v3-0001-Refactor-ps_status.c-API.patch, - * - * For a walsender, the ps display is set in the

Re: Bug in pg_restore with EventTrigger in parallel mode

2020-03-09 Thread Tom Lane
=?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= writes: > On Sat, Mar 7, 2020 at 8:42 PM Tom Lane wrote: >> However, I think that the existing code is correct to restore event >> triggers before matview refreshes, not after as this patch would have us >> do. The basic idea for matview refresh is that

Re: [Proposal] Global temporary tables

2020-03-09 Thread tushar
On 3/6/20 12:35 PM, 曾文旌(义从) wrote: Fixed in global_temporary_table_v17-pg13.patch I observed that , we do support 'global temp' keyword with views postgres=# create or replace  global temp view v1 as select 5; CREATE VIEW but if we take the dump( using pg_dumpall) then it only display

Re: [Proposal] Global temporary tables

2020-03-09 Thread tushar
On 3/6/20 12:35 PM, 曾文旌(义从) wrote: Fixed in global_temporary_table_v17-pg13.patch Thanks Wenjing. Please refer this scenario , where i am able to set 'on_commit_delete_rows=true'  on regular table using 'alter' Syntax  which is not allowed using 'Create' Syntax --Expected - postgres=#

Re: Improve handling of parameter differences in physical replication

2020-03-09 Thread Masahiko Sawada
On Mon, 9 Mar 2020 at 18:45, Peter Eisentraut wrote: > > On 2020-03-09 09:11, Masahiko Sawada wrote: > > I think after recovery is paused users will be better to restart the > > server rather than resume the recovery. I agree with this idea but I'm > > slightly concerned that users might not

Re: Bug in pg_restore with EventTrigger in parallel mode

2020-03-09 Thread Fabrízio de Royes Mello
On Sat, Mar 7, 2020 at 8:42 PM Tom Lane wrote: > > vignesh C writes: > > I'm not sure if we can add a test for this, can you have a thought > > about this to check if we can add a test. > > Yeah, I'm not quite sure if a test is worth the trouble or not. > > We clearly do need to restore event

Re: pg_rewind docs correction

2020-03-09 Thread James Coleman
On Mon, Mar 9, 2020 at 2:59 AM Michael Paquier wrote: > On Sun, Mar 08, 2020 at 05:13:21PM -0400, James Coleman wrote: > > I've added the information about how the backup label control file is > > written, and updated the How It Works steps to refer to that separately > > from restart. > > > >

Re: [Proposal] Global temporary tables

2020-03-09 Thread Prabhat Sahu
Hi All, Kindly check the below scenario. *Case 1: * postgres=# CREATE GLOBAL TEMPORARY TABLE gtt1(c1 int) on commit delete rows; CREATE TABLE postgres=# CREATE GLOBAL TEMPORARY TABLE gtt2(c1 int) on commit preserve rows; CREATE TABLE postgres=# vacuum gtt1; VACUUM postgres=# vacuum gtt2; VACUUM

Re: Conflict handling for COPY FROM

2020-03-09 Thread Surafel Temesgen
On Fri, Mar 6, 2020 at 11:30 AM asaba.takan...@fujitsu.com < asaba.takan...@fujitsu.com> wrote: > Hello Surafel, > > Sorry for my late reply. > > From: Surafel Temesgen > >On Thu, Dec 12, 2019 at 7:51 AM mailto:asaba.takan...@fujitsu.com > wrote: > >>2. I have

Re: Run-time pruning for ModifyTable

2020-03-09 Thread David Rowley
Thanks for having a look at this, Amit. On Fri, 24 Jan 2020 at 21:57, Amit Langote wrote: > > On Thu, Jan 23, 2020 at 4:31 PM Amit Langote wrote: > Part of the optimizer patch that looks a bit complex is the changes to > inheritance_planner() which is to be expected, because that function > is

Re: recovery_target_action=pause with confusing hint

2020-03-09 Thread David Steele
Hi Sergei, On 1/30/20 12:00 PM, Fujii Masao wrote: - check for standby triggers only for recovery_target_action - I am not sure this would be safe for pg_wal_replay_pause() call case Agreed. Basically I think that recoveryPausesHere() should the promotion trigger whether recovery target is

Re: POC: rational number type (fractions)

2020-03-09 Thread David Steele
Hi Joe, On 2/7/20 11:25 PM, Joe Nelson wrote: Hi hackers, attached is a proof of concept patch adding a new base type called "rational" to represent fractions. I have set the target version for this patch to PG14 because it is POC and this is the first CF it has appeared in. Regards, --

Re: logical copy_replication_slot issues

2020-03-09 Thread Arseny Sher
Masahiko Sawada writes: > /* > -* Create logical decoding context, to build the initial snapshot. > +* Create logical decoding context to find start point or, if we don't > +* need it, to 1) bump slot's restart_lsn and xmin 2) check plugin sanity. > */ > > Do we need to

Re: bad logging around broken restore_command

2020-03-09 Thread David Steele
Hi Jeff, On 2/6/20 9:23 AM, Fujii Masao wrote: I've attached a patch which emits a LOG message for ENOENT. Isn't it better to use "could not stat file" message even in ENOENT case? If yes, something like message that you used in the patch should be logged as DETAIL or HINT message. So, what

New feature request: Query Rewrite Cache

2020-03-09 Thread Bert Scalzo
MySQL has a really useful feature they call the query rewrite cache. The optimizer checks incoming queries to see if a known better rewrite has been placed within the query rewrite cache table. If one is found, the rewrite replaces the incoming query before sending it to the execution engine. This

Re: pgsql: pageinspect: Fix types used for bt_metap() columns.

2020-03-09 Thread Alvaro Herrera
On 2020-Mar-08, Peter Geoghegan wrote: > Fix these issues by changing the declaration of bt_metap() to > consistently use data types that can reliably represent all possible > values. This fixes things on HEAD only. No backpatch, since it doesn't > seem like there is a safe way to fix the issue

Re: recovery_target_action=pause with confusing hint

2020-03-09 Thread Fujii Masao
On 2020/03/09 21:30, David Steele wrote: Hi Sergei, On 1/30/20 12:00 PM, Fujii Masao wrote: - check for standby triggers only for recovery_target_action - I am not sure this would be safe for pg_wal_replay_pause() call case Agreed. Basically I think that recoveryPausesHere() should the

Re: [Proposal] Global temporary tables

2020-03-09 Thread 曾文旌(义从)
> 2020年3月9日 下午10:37,tushar 写道: > > On 3/6/20 12:35 PM, 曾文旌(义从) wrote: >> Fixed in global_temporary_table_v17-pg13.patch > > I observed that , we do support 'global temp' keyword with views > > postgres=# create or replace global temp view v1 as select 5; > CREATE VIEW I think we should not

Re: Some problems of recovery conflict wait events

2020-03-09 Thread Fujii Masao
On 2020/03/09 14:10, Masahiko Sawada wrote: On Mon, 9 Mar 2020 at 13:24, Fujii Masao wrote: On 2020/03/08 13:52, Masahiko Sawada wrote: On Thu, 5 Mar 2020 at 20:16, Fujii Masao wrote: On 2020/03/05 16:58, Masahiko Sawada wrote: On Wed, 4 Mar 2020 at 15:21, Fujii Masao wrote:

Re: Remove utils/acl.h from catalog/objectaddress.h

2020-03-09 Thread Alvaro Herrera
On 2020-Mar-07, Peter Eisentraut wrote: > I noticed that catalog/objectaddress.h includes utils/acl.h for no apparent > reason. It turns out this used to be needed but not anymore. So removed it > and cleaned up the fallout. Patch attached. parser/parse_nodes.h already includes

[PATCH v2] Allow COPY "text" to output a header and add header matching mode to COPY FROM

2020-03-09 Thread Rémi Lapeyre
Here's a rebased version that should apply cleanly on HEAD. --- contrib/file_fdw/input/file_fdw.source | 7 +- contrib/file_fdw/output/file_fdw.source | 13 ++-- doc/src/sgml/ref/copy.sgml | 9 ++- src/backend/commands/copy.c | 93 ++---

Re: backup manifests

2020-03-09 Thread Robert Haas
On Mon, Mar 9, 2020 at 12:22 PM tushar wrote: > On 3/5/20 10:25 PM, Robert Haas wrote: > > Here's an updated patch set responding to many of the comments > > received thus far. > Thanks Robert. There is a scenario - if user provide port of v11 server > at the time of creating 'base backup'

Re: recovery_target_action=pause with confusing hint

2020-03-09 Thread Robert Haas
On Mon, Mar 9, 2020 at 12:03 PM Fujii Masao wrote: > I started the discussion about the topic very related to this. > I'm thinking to apply the change that Sergei proposes after applying > the patch I attached in this thread. >

Re: Atomics in localbuf.c

2020-03-09 Thread Robert Haas
On Fri, Mar 6, 2020 at 2:06 PM Andres Freund wrote: > > Since local/shared buffers share the buffer header definition, we still > > have to use proper functions to access > > the atomic variables. > > There's only one struct BufferDesc. We could separate them out / > introduce a union or such.

Re: Bug in pg_restore with EventTrigger in parallel mode

2020-03-09 Thread Fabrízio de Royes Mello
On Mon, Mar 9, 2020 at 12:27 PM Tom Lane wrote: > > In the case of event triggers, the obvious counterexample is that if > you restore ET A and then ET B, ET A might interfere with the attempt > to restore ET B. (And we have no way to know whether restoring B > before A would be better or

  1   2   >