Re: logical replication restrictions

2022-11-08 Thread Kyotaro Horiguchi
At Wed, 10 Aug 2022 17:33:00 -0300, "Euler Taveira" wrote in > On Wed, Aug 10, 2022, at 9:39 AM, osumi.takami...@fujitsu.com wrote: > > Minor review comments for v6. > Thanks for your review. I'm attaching v7. Using interval is not standard as this kind of parameters but it seems convenient.

Re: User functions for building SCRAM secrets

2022-11-08 Thread Michael Paquier
On Tue, Nov 08, 2022 at 04:57:09PM -0800, Jacob Champion wrote: > But I guess that wouldn't really help with ALTER ROLE ... PASSWORD, > because you can't parameterize it. Hm... Yeah, and I'd like to think that this is never something we should allow, either, as that could be easily a footgun for

Re: Locks release order in LogStandbySnapshot

2022-11-08 Thread Japin Li
On Wed, 09 Nov 2022 at 11:21, Andres Freund wrote: > I think it does. If we allow xid assignment before LogCurrentRunningXacts() is > done, those new xids would not have been mentioned in the xl_running_xacts > record, despite already running. Which I think result in corrupted snapshots >

Re: An attempt to avoid locally-committed-but-not-replicated-to-standby-transactions in synchronous replication

2022-11-08 Thread Andrey Borodin
On Thu, Sep 29, 2022 at 3:53 PM Bruce Momjian wrote: > > So, what happens when an insufficient number of synchronous replicas > reply? It's a failover. > Sessions hang because the synchronous behavior cannot be > guaranteed. We then _allow_ query cancel so the user or administrator > can get

Re: [patch] Have psql's \d+ indicate foreign partitions

2022-11-08 Thread Michael Paquier
On Tue, Nov 08, 2022 at 03:38:22PM +0900, Ian Lawrence Barwick wrote: > CF entry updated accordingly. Missed this part, thanks.. -- Michael signature.asc Description: PGP signature

Re: Improve logging when using Huge Pages

2022-11-08 Thread Michael Paquier
On Wed, Nov 09, 2022 at 11:47:57AM +0900, Kyotaro Horiguchi wrote: > Honestly I don't come up with other users of the new > log-level. Another possible issue is it might be a bit hard for people > to connect that level to huge_pages=try, whereas I think we shouldn't > put a description about the

Re: Suppressing useless wakeups in walreceiver

2022-11-08 Thread Bharath Rupireddy
On Wed, Nov 9, 2022 at 2:38 AM Nathan Bossart wrote: > > On Tue, Nov 08, 2022 at 09:45:40PM +1300, Thomas Munro wrote: > > On Tue, Nov 8, 2022 at 9:20 PM Bharath Rupireddy > > wrote: > >> Thanks. Do we need a similar wakeup approach for logical replication > >> workers in worker.c? Or is it okay

Re: allow segment size to be set to < 1GiB

2022-11-08 Thread Michael Paquier
On Tue, Nov 08, 2022 at 06:28:08PM -0800, Andres Freund wrote: > FWIW, with HEAD, all tests pass with -Dsegsize_blocks=6 on HEAD. Wow. The relation page size influences some of the plans in the main regression test suite, but this is nice to hear. +1 from me for more flexibility with this

Re: Allow file inclusion in pg_hba and pg_ident files

2022-11-08 Thread Julien Rouhaud
Hi, On Wed, Nov 09, 2022 at 09:51:17AM +0900, Michael Paquier wrote: > On Tue, Nov 08, 2022 at 10:04:16AM +0900, Michael Paquier wrote: > > CF bot unhappy as I have messed up with rules.out. Rebased. I have > > removed the restriction on MAXPGPATH in AbsoluteConfigLocation() in > > 0001, while

Re: Reviving lost replication slots

2022-11-08 Thread sirisha chamarthi
On Mon, Nov 7, 2022 at 11:17 PM Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > On Tue, Nov 8, 2022 at 12:08 PM sirisha chamarthi > wrote: > > > > On Fri, Nov 4, 2022 at 11:02 PM Amit Kapila > wrote: > >> > >> On Fri, Nov 4, 2022 at 1:40 PM sirisha chamarthi > >> wrote: >

Re: Reviving lost replication slots

2022-11-08 Thread sirisha chamarthi
On Tue, Nov 8, 2022 at 1:36 AM Amit Kapila wrote: > On Tue, Nov 8, 2022 at 12:08 PM sirisha chamarthi > wrote: > > > > On Fri, Nov 4, 2022 at 11:02 PM Amit Kapila > wrote: > >> > >> On Fri, Nov 4, 2022 at 1:40 PM sirisha chamarthi > >> wrote: > >> > > >> > A replication slot can be lost when

Re: Locks release order in LogStandbySnapshot

2022-11-08 Thread Andres Freund
Hi, On 2022-11-09 11:03:04 +0800, Japin Li wrote: > GetRunningTransactionData requires holding both ProcArrayLock and > XidGenLock (in that order). Then LogStandbySnapshot releases those > locks in that order. However, to reduce the frequency of having to > wait for XidGenLock while holding

Locks release order in LogStandbySnapshot

2022-11-08 Thread Japin Li
Hi, hackers GetRunningTransactionData requires holding both ProcArrayLock and XidGenLock (in that order). Then LogStandbySnapshot releases those locks in that order. However, to reduce the frequency of having to wait for XidGenLock while holding ProcArrayLock, ProcArrayAdd releases them in

Re: Asynchronous and "direct" IO support for PostgreSQL.

2022-11-08 Thread Andres Freund
Hi, On 2022-10-12 14:45:26 +0900, Michael Paquier wrote: > On Tue, Aug 31, 2021 at 10:56:59PM -0700, Andres Freund wrote: > > I've attached the code for posterity, but the series is large enough that I > > don't think it makes sense to do that all that often... The code is at > >

Re: Add index scan progress to pg_stat_progress_vacuum

2022-11-08 Thread Andres Freund
Hi, On 2022-11-04 13:27:34 +, Imseih (AWS), Sami wrote: > diff --git a/src/backend/access/gin/ginvacuum.c > b/src/backend/access/gin/ginvacuum.c > index b4fa5f6bf8..3d5e4600dc 100644 > --- a/src/backend/access/gin/ginvacuum.c > +++ b/src/backend/access/gin/ginvacuum.c > @@ -633,6 +633,9 @@

RE: Perform streaming logical transactions by background workers and parallel apply

2022-11-08 Thread Hayato Kuroda (Fujitsu)
Hi all, I have tested the patch set in two cases, so I want to share the result. Case 1. deadlock caused by leader worker, parallel worker, and backend. Case 2. deadlock caused by non-immutable trigger === It has worked well in both cases. PSA reports what I did. I want to investigate

Re: Improve logging when using Huge Pages

2022-11-08 Thread Kyotaro Horiguchi
At Tue, 8 Nov 2022 11:34:53 +1300, Thomas Munro wrote in > On Tue, Nov 8, 2022 at 4:56 AM Tom Lane wrote: > > Andres Freund writes: > > > On 2022-11-06 14:04:29 +0700, John Naylor wrote: > > Agreed --- changing "on" to be exactly like "try" isn't an improvement. > > If you want "try"

Re: Add connection active, idle time to pg_stat_activity

2022-11-08 Thread David G. Johnston
On Tue, Nov 8, 2022 at 7:37 PM Andres Freund wrote: > On 2022-11-08 19:25:27 -0700, David G. Johnston wrote: > > Actually two, because I also suggest that not only is the duration > recorded, > > but a counter be incremented each time a given state becomes the > currently > > active state.

Re: Collation version tracking for macOS

2022-11-08 Thread Thomas Munro
On Tue, Nov 8, 2022 at 1:22 AM Peter Eisentraut wrote: > I made a Homebrew repository for ICU versions 50 through 72: > https://github.com/petere/homebrew-icu Nice! > All of these packages build and pass their self-tests on my machine. So > from that experience, I think maintaining a

Re: Add connection active, idle time to pg_stat_activity

2022-11-08 Thread Andres Freund
On 2022-11-08 19:25:27 -0700, David G. Johnston wrote: > Actually two, because I also suggest that not only is the duration recorded, > but a counter be incremented each time a given state becomes the currently > active state. Seems like having access to a divisor of some form may be > useful.

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-11-08 Thread sho kato
The following review has been posted through the commitfest application: make installcheck-world: tested, failed Implements feature: tested, failed Spec compliant: tested, failed Documentation:tested, failed Hello, I tested this patch on Linux and there is no

Re: allow segment size to be set to < 1GiB

2022-11-08 Thread Andres Freund
Hi, On 2022-11-07 21:36:33 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2022-11-07 12:52:25 -0500, Tom Lane wrote: > >> How about instead allowing the segment size to be set in pages? > > > In addition or instead of --with-segsize/-Dsegsize? > > In addition to. What I meant by

Re: Add connection active, idle time to pg_stat_activity

2022-11-08 Thread David G. Johnston
On Tue, Nov 8, 2022 at 6:56 PM Andres Freund wrote: > > Separately from that, I'm a bit worried about starting to add accumulative > counters to pg_stat_activity. It's already gotten hard to use interactively > due to the number of columns - and why stop with the columns you suggest? > Why > not

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2022-11-08 Thread David Rowley
On Tue, 8 Nov 2022 at 19:51, Richard Guo wrote: > For unsorted paths, the original logic here is to explicitly add a Sort > path only for the cheapest-total path. This patch changes that and may > add a Sort path for other paths besides the cheapest-total path. I > think this may introduce in

Re: Add connection active, idle time to pg_stat_activity

2022-11-08 Thread Andres Freund
Hi, On 2022-07-21 18:22:51 +0200, Sergey Dudoladov wrote: > From b5298301a3f5223bd78c519ddcddbd1bec9cf000 Mon Sep 17 00:00:00 2001 > From: Sergey Dudoladov > Date: Wed, 20 Apr 2022 23:47:37 +0200 > Subject: [PATCH] pg_stat_activity: add 'total_active_time' and > 'total_idle_in_transaction_time'

Re: Slow standby snapshot

2022-11-08 Thread Thomas Munro
On Wed, Nov 9, 2022 at 1:54 PM Andres Freund wrote: > On 2022-11-09 11:42:36 +1300, Thomas Munro wrote: > > On Sat, Sep 17, 2022 at 6:27 PM Simon Riggs > > wrote: > > > I've cleaned up the comments and used a #define for the constant. > > > > > > IMHO this is ready for commit. I will add it to

Re: Cygwin cleanup

2022-11-08 Thread Justin Pryzby
On Thu, Oct 20, 2022 at 10:40:40PM -0500, Justin Pryzby wrote: > On Thu, Aug 04, 2022 at 04:16:06PM +1200, Thomas Munro wrote: > > On Thu, Aug 4, 2022 at 3:38 PM Justin Pryzby wrote: > > > [train wreck] > > > > Oh my, so I'm getting the impression we might actually be totally > > unstable on

Re: User functions for building SCRAM secrets

2022-11-08 Thread Jacob Champion
On 11/8/22 12:26, Peter Eisentraut wrote: > On 04.11.22 21:39, Jacob Champion wrote: >> I don't think it's helpful for me to try to block progress on this >> patchset behind the other one. But is there a way for me to help this >> proposal skate in the same general direction? Could Peter's

Re: Slow standby snapshot

2022-11-08 Thread Andres Freund
Hi, On 2022-11-09 11:42:36 +1300, Thomas Munro wrote: > On Sat, Sep 17, 2022 at 6:27 PM Simon Riggs > wrote: > > I've cleaned up the comments and used a #define for the constant. > > > > IMHO this is ready for commit. I will add it to the next CF. > > FYI This had many successful cfbot runs but

Re: security_context_t marked as deprecated in libselinux 3.1

2022-11-08 Thread Michael Paquier
On Fri, Nov 04, 2022 at 08:49:24AM +0900, Michael Paquier wrote: > In line of ad96696, seems like that it would make sense to do the same > here even if the bar is lower. sepgsql has not changed in years, so I > suspect few conflicts. Alvaro, if you want to take care of that, > that's fine by

Re: Allow file inclusion in pg_hba and pg_ident files

2022-11-08 Thread Michael Paquier
On Tue, Nov 08, 2022 at 10:04:16AM +0900, Michael Paquier wrote: > CF bot unhappy as I have messed up with rules.out. Rebased. I have > removed the restriction on MAXPGPATH in AbsoluteConfigLocation() in > 0001, while on it. The absolute paths built on GUC or ident > inclusions are the same.

Re: EINTR in ftruncate()

2022-11-08 Thread Thomas Munro
On Wed, Aug 17, 2022 at 7:51 AM Thomas Munro wrote: > On Sat, Jul 16, 2022 at 5:18 PM Thomas Munro wrote: > > On Sat, Jul 16, 2022 at 1:28 AM Tom Lane wrote: > > > Thomas Munro writes: > > > > On Fri, Jul 15, 2022 at 9:34 AM Tom Lane wrote: > > > >> (Someday we oughta go ahead and make our

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-11-08 Thread David Christensen
Enclosed is v6, which squashes your refactor and adds the additional recent suggestions. Thanks! v6-0001-Teach-pg_waldump-to-extract-FPIs-from-the-WAL-str.patch Description: Binary data

Re: Crash in BRIN minmax-multi indexes

2022-11-08 Thread Justin Pryzby
On Mon, Oct 03, 2022 at 10:29:38PM +0200, Tomas Vondra wrote: > I'll get this fixed in a couple days. Considering the benign nature of > this issue (unnecessary assert) I'm not going to rush. Is this still an outstanding issue ? -- Justin

Re: psql: Add command to use extended query protocol

2022-11-08 Thread Corey Huinker
> > > Btw., this also allows doing things like > > SELECT $1, $2 > \bind '1' '2' \g > \bind '3' '4' \g > That's one of the things I was hoping for. Very cool. > > This isn't a prepared statement being reused, but it relies on the fact > that psql \g with an empty query buffer resends the

Re: Commit fest 2022-11

2022-11-08 Thread Justin Pryzby
On Thu, Nov 03, 2022 at 07:43:03PM -0500, Justin Pryzby wrote: > On Thu, Nov 03, 2022 at 11:33:57AM +0900, Ian Lawrence Barwick wrote: > > 2022年11月2日(水) 19:10 Greg Stark : > > > On Tue, 1 Nov 2022 at 06:56, Michael Paquier wrote: > > > > > > > Two people showing up to help is really great,

Re: libpq support for NegotiateProtocolVersion

2022-11-08 Thread Jacob Champion
On 11/8/22 00:40, Peter Eisentraut wrote: > On 02.11.22 20:02, Jacob Champion wrote: >> This new code path doesn't go through the message length checks that are >> done for the 'R' and 'E' cases, and pqGetNegotiateProtocolVersion3() >> doesn't take the message length to know where to stop anyway,

Re: WIN32 pg_import_system_collations

2022-11-08 Thread Juan José Santamaría Flecha
On Mon, Nov 7, 2022 at 4:08 PM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > > This looks pretty good to me. The refactoring of the non-Windows parts > makes sense. The Windows parts look reasonable on manual inspection, > but again, I don't have access to Windows here, so

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-11-08 Thread David Christensen
On Tue, Nov 8, 2022 at 4:45 PM Justin Pryzby wrote: > > On Mon, Nov 07, 2022 at 05:01:01PM -0600, David Christensen wrote: > > Hi Justin et al, > > > > Enclosed is v5 of this patch which now passes the CirrusCI checks for > > all supported OSes. I went ahead and reworked the test a bit so it's a

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-11-08 Thread Justin Pryzby
On Mon, Nov 07, 2022 at 05:01:01PM -0600, David Christensen wrote: > Hi Justin et al, > > Enclosed is v5 of this patch which now passes the CirrusCI checks for > all supported OSes. I went ahead and reworked the test a bit so it's a > little more amenable to the OS-agnostic approach for testing.

Re: Slow standby snapshot

2022-11-08 Thread Thomas Munro
On Sat, Sep 17, 2022 at 6:27 PM Simon Riggs wrote: > I've cleaned up the comments and used a #define for the constant. > > IMHO this is ready for commit. I will add it to the next CF. FYI This had many successful cfbot runs but today it blew up on Windows when the assertion

Re: Suppressing useless wakeups in walreceiver

2022-11-08 Thread Nathan Bossart
On Tue, Nov 08, 2022 at 09:45:40PM +1300, Thomas Munro wrote: > On Tue, Nov 8, 2022 at 9:20 PM Bharath Rupireddy > wrote: >> Thanks. Do we need a similar wakeup approach for logical replication >> workers in worker.c? Or is it okay that the nap time is 1sec there? > > Yeah, I think so. At least

Re: Suppressing useless wakeups in walreceiver

2022-11-08 Thread Nathan Bossart
On Tue, Nov 08, 2022 at 08:46:26PM +1300, Thomas Munro wrote: > On Tue, Nov 8, 2022 at 3:20 PM Thomas Munro wrote: >> This looks pretty good to me. Thanks for picking it up! I can live >> with the change to use a global variable; it seems we couldn't quite >> decide what the scope was for

Re: Non-emergency patch for bug #17679

2022-11-08 Thread Tom Lane
Andres Freund writes: > On 2022-11-08 11:28:08 -0500, Tom Lane wrote: >> Hence, the attached reverts everything 4ab5dae94 did to this function, >> and most of 0e758ae89 too, and instead makes IsBinaryUpgrade an >> additional reason to take the immediate-unlink path. > I wonder if it's worth

Re: Non-emergency patch for bug #17679

2022-11-08 Thread Andres Freund
Hi, On 2022-11-08 11:28:08 -0500, Tom Lane wrote: > In the release team's discussion leading up to commit 0e758ae89, > Andres opined that what commit 4ab5dae94 had done to mdunlinkfork > was a mess, and I concur. It invented an entirely new code path > through that function, and required two

Re: User functions for building SCRAM secrets

2022-11-08 Thread Peter Eisentraut
On 04.11.22 21:39, Jacob Champion wrote: It seems to me that the use case here is extremely similar to the one being tackled by Peter E's client-side encryption [1]. People want to write SQL to perform a cryptographic operation using a secret, and then send the resulting ciphertext (or in this

Re: [PATCHES] Post-special page storage TDE support

2022-11-08 Thread David Christensen
Looking into some CF bot failures which didn't show up locally. Will send a v3 when resolved.

Re: Introduce "log_connection_stages" setting.

2022-11-08 Thread Sergey Dudoladov
Hi hackers, I've sketched an initial patch version; feedback is welcome. Regards, Sergey Dudoladov From be2e6b5c2d6fff1021f52f150b4d849dfbd26ec7 Mon Sep 17 00:00:00 2001 From: Sergey Dudoladov Date: Tue, 8 Nov 2022 18:56:26 +0100 Subject: [PATCH] Introduce 'log_connection_messages' This patch

Re: Add connection active, idle time to pg_stat_activity

2022-11-08 Thread Sergey Dudoladov
Hello hackers, Is there anything we can do to facilitate merging of this patch ? It has been in the "ready-for-commiter" state for 3 commitfests in a row now. We would appreciate if the patch makes it to version 16: the need to monitor idle-in-transaction connections is very real for us.

Out-of-date clang/llvm version lists in PGAC_LLVM_SUPPORT

2022-11-08 Thread Tom Lane
I happened to notice that these lists of supported versions haven't been updated in a good long time: PGAC_PATH_PROGS(LLVM_CONFIG, llvm-config llvm-config-7 llvm-config-6.0 llvm-config-5.0 llvm-config-4.0 llvm-config-3.9) PGAC_PATH_PROGS(CLANG, clang clang-7 clang-6.0 clang-5.0 clang-4.0

Re: [PoC] Improve dead tuple storage for lazy vacuum

2022-11-08 Thread Peter Geoghegan
On Fri, Nov 4, 2022 at 8:25 AM Masahiko Sawada wrote: > For parallel heap pruning, multiple workers will insert key-value > pairs to the radix tree concurrently. The simplest solution would be a > single lock to protect writes but the performance will not be good. > Another solution would be that

Non-emergency patch for bug #17679

2022-11-08 Thread Tom Lane
In the release team's discussion leading up to commit 0e758ae89, Andres opined that what commit 4ab5dae94 had done to mdunlinkfork was a mess, and I concur. It invented an entirely new code path through that function, and required two different behaviors from the segment-deletion loop. I think a

Re: Tables not getting vacuumed in postgres

2022-11-08 Thread Mark Dilger
> On Nov 8, 2022, at 5:21 AM, Karthik Jagadish (kjagadis) > wrote: > > I didn’t get your point dead tuples are visible to transaction means? > Vacuuming job is to remove dead tuples right? Please see https://www.2ndquadrant.com/en/blog/when-autovacuum-does-not-vacuum/ for more information

Re: [PoC] Improve dead tuple storage for lazy vacuum

2022-11-08 Thread Masahiko Sawada
On Sat, Nov 5, 2022 at 6:23 PM John Naylor wrote: > > On Fri, Nov 4, 2022 at 10:25 PM Masahiko Sawada wrote: > > > > For parallel heap pruning, multiple workers will insert key-value > > pairs to the radix tree concurrently. The simplest solution would be a > > single lock to protect writes but

Re: Tables not getting vacuumed in postgres

2022-11-08 Thread Karthik Jagadish (kjagadis)
I didn’t get your point dead tuples are visible to transaction means? Vacuuming job is to remove dead tuples right? Regards, Karthik From: Amul Sul Date: Tuesday, 8 November 2022 at 6:39 PM To: Karthik Jagadish (kjagadis) Cc: pgsql-hack...@postgresql.org , Prasanna Satyanarayanan (prassaty)

Re: Check return value of pclose() correctly

2022-11-08 Thread Peter Eisentraut
On 01.11.22 21:30, Peter Eisentraut wrote: There are some places where the return value is apparently intentionally ignored, such as in error recovery paths, or psql ignoring a failure to launch the pager.  (The intention can usually be inferred by the kind of error checking attached to the

Re: Tables not getting vacuumed in postgres

2022-11-08 Thread Amul Sul
On Tue, Nov 8, 2022 at 6:11 PM Karthik Jagadish (kjagadis) wrote: > > Hi, > > > > Thanks for the response. > > > > But what I understand that insert update and delete would still work and will > not interfere with vacuuming process. Yes we do perform a lot of updates on > that particular table

Re: Tables not getting vacuumed in postgres

2022-11-08 Thread Karthik Jagadish (kjagadis)
Hi, Thanks for the response. But what I understand that insert update and delete would still work and will not interfere with vacuuming process. Yes we do perform a lot of updates on that particular table which is not vacuuming. Does it mean that it waiting for the lock to be released?

Re: psql: Add command to use extended query protocol

2022-11-08 Thread Peter Eisentraut
On 08.11.22 13:02, Daniel Verite wrote: A pset variable to control the default seems reasonable as well. The implication would be that if you set that pset variable there is no way to have individual commands use simple query mode directly. +1 except that it would be a \set variable for

Re: psql: Add command to use extended query protocol

2022-11-08 Thread Peter Eisentraut
On 05.11.22 07:34, Corey Huinker wrote: The most compact idea I can think of is to have \bind and \endbind (or more terse equivalents \bp and \ebp) SELECT * FROM foo WHERE type_id = $1 AND cost > $2 \bind 'param1' 'param2' \endbind $2 \g filename.csv I like it. It makes my code even

Re: when the startup process doesn't (logging startup delays)

2022-11-08 Thread Bharath Rupireddy
On Tue, Nov 8, 2022 at 4:35 PM Thomas Munro wrote: > > On Sat, Oct 30, 2021 at 7:44 AM Robert Haas wrote: > > Committed. > > Is it expected that an otherwise idle standby's recovery process > receives SIGALRM every N seconds, or should the timer be canceled at > that point, as there is no

Re: Tables not getting vacuumed in postgres

2022-11-08 Thread Amul Sul
On Tue, Nov 8, 2022 at 5:00 PM Karthik Jagadish (kjagadis) wrote: > > Hi, > > We have a NMS application where we are using postgres as database, what we > are noticing is that vacuuming is not happening for certain tables for 2-3 > days and eventually the table bloats and disk space is running

Re: psql: Add command to use extended query protocol

2022-11-08 Thread Daniel Verite
David G. Johnston wrote: > I would keep the \gp meta-command to force extended mode regardless > of whether the query itself requires it. +1 > A pset variable to control the default seems reasonable as well. > The implication would be that if you set that pset variable there is > no way

Re: Perform streaming logical transactions by background workers and parallel apply

2022-11-08 Thread Amit Kapila
On Mon, Nov 7, 2022 at 6:49 PM houzj.f...@fujitsu.com wrote: > > On Friday, November 4, 2022 7:45 PM Amit Kapila > wrote: > > 3. > > apply_handle_stream_start(StringInfo s) > > { > > ... > > + if (!first_segment) > > + { > > + /* > > + * Unlock the shared object lock so that parallel apply

Re: [PoC] Reducing planning time when tables have many partitions

2022-11-08 Thread Andrey Lepikhov
On 2/11/2022 15:27, Yuya Watari wrote: I noticed that the previous patch does not apply to the current HEAD. I attached the rebased version to this email. Looking into find_em_for_rel() changes I see that you replaced if (bms_is_subset(em->em_relids, rel->relids) with assertion statement.

Tables not getting vacuumed in postgres

2022-11-08 Thread Karthik Jagadish (kjagadis)
Hi, We have a NMS application where we are using postgres as database, what we are noticing is that vacuuming is not happening for certain tables for 2-3 days and eventually the table bloats and disk space is running out. What could be the reason for auto vacuuming not happening for certain

Re: when the startup process doesn't (logging startup delays)

2022-11-08 Thread Thomas Munro
On Sat, Oct 30, 2021 at 7:44 AM Robert Haas wrote: > Committed. Is it expected that an otherwise idle standby's recovery process receives SIGALRM every N seconds, or should the timer be canceled at that point, as there is no further progress to report?

Re: Use proc instead of MyProc in ProcArrayGroupClearXid()/TransactionGroupUpdateXidStatus()

2022-11-08 Thread Bharath Rupireddy
On Tue, Nov 8, 2022 at 11:59 AM Amit Kapila wrote: > > On Mon, Nov 7, 2022 at 3:17 PM rajesh singarapu > wrote: > > > > In both TransactionGroupUpdateXidStatus and ProcArrayGroupClearXid > > global MyProc is used. for consistency, replaced with a function local > > variable. > > > > In

Re: hash_xlog_split_allocate_page: failed to acquire cleanup lock

2022-11-08 Thread Amit Kapila
On Mon, Nov 7, 2022 at 11:12 PM Robert Haas wrote: > > On Mon, Oct 31, 2022 at 11:49 PM Amit Kapila wrote: > > I am fine with any of those. Would you like to commit or do you prefer > > me to take care of this? > > Sorry for not responding to this sooner. I think it's too late to do > anything

Re: Reviving lost replication slots

2022-11-08 Thread Amit Kapila
On Tue, Nov 8, 2022 at 12:08 PM sirisha chamarthi wrote: > > On Fri, Nov 4, 2022 at 11:02 PM Amit Kapila wrote: >> >> On Fri, Nov 4, 2022 at 1:40 PM sirisha chamarthi >> wrote: >> > >> > A replication slot can be lost when a subscriber is not able to catch up >> > with the load on the primary

Re: Tracking last scan time

2022-11-08 Thread Dave Page
On Tue, 8 Nov 2022 at 04:10, Michael Paquier wrote: > On Mon, Nov 07, 2022 at 04:54:07PM +0900, Michael Paquier wrote: > > FWIW, all the other areas of pgstatfuncs.c manipulate timestamptz > > fields with a style like the attached. That's a nit, still per the > > role of consistency with the

Re: Condition pushdown: why (=) is pushed down into join, but BETWEEN or >= is not?

2022-11-08 Thread Andy Fan
Hi: > cfbot reports the patch no longer applies [1]. As CommitFest 2022-11 is > currently underway, this would be an excellent time to update the patch. > Thank you Ian & Andrey for taking care of this! I am planning to start a new thread for this topic in 2 weeks, and will post an update

Re: Suppressing useless wakeups in walreceiver

2022-11-08 Thread Thomas Munro
On Tue, Nov 8, 2022 at 9:20 PM Bharath Rupireddy wrote: > Thanks. Do we need a similar wakeup approach for logical replication > workers in worker.c? Or is it okay that the nap time is 1sec there? Yeah, I think so. At least for its idle/nap case (waiting for flush is also a technically

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2022-11-08 Thread Ronan Dunklau
Le mardi 8 novembre 2022, 02:31:12 CET David Rowley a écrit : > 1. Adjusts add_paths_to_grouping_rel so that we don't add a Sort path > when we can add an Incremental Sort path instead. This removes quite a > few redundant lines of code. This seems sensible > 2. Removes the * 1.5 fuzz-factor in

Re: libpq support for NegotiateProtocolVersion

2022-11-08 Thread Peter Eisentraut
On 02.11.22 20:02, Jacob Champion wrote: A few notes: + else if (beresp == 'v') + { + if (pqGetNegotiateProtocolVersion3(conn)) + { +

Re: Suppressing useless wakeups in walreceiver

2022-11-08 Thread Bharath Rupireddy
On Tue, Nov 8, 2022 at 1:17 PM Thomas Munro wrote: > > And with that change and a pgindent, pushed. Thanks. Do we need a similar wakeup approach for logical replication workers in worker.c? Or is it okay that the nap time is 1sec there? -- Bharath Rupireddy PostgreSQL Contributors Team RDS

Re: PL/pgSQL cursors should get generated portal names by default

2022-11-08 Thread Kirk Wolak
On Mon, Nov 7, 2022 at 11:10 AM Jan Wieck wrote: > On 11/4/22 19:46, Tom Lane wrote: > > Jan Wieck writes: > >> I need to do some testing on this. I seem to recall that the naming was > >> originally done because a reference cursor is basically a named cursor > >> that can be handed around