Re: TAP output format in pg_regress

2022-11-27 Thread Nikolay Shaplov
В письме от суббота, 26 ноября 2022 г. 23:35:45 MSK пользователь Daniel Gustafsson написал: > > + #define bail_noatexit(...) bail_out(true, __VA_ARGS__) > > > > BTW what does "noat" stands for? I thought it is typo too :-) and > > originally meant to be "not". > > Calling _exit() will cause exit

Re: Allow file inclusion in pg_hba and pg_ident files

2022-11-27 Thread Julien Rouhaud
On Sun, Nov 27, 2022 at 03:39:44PM +0800, Julien Rouhaud wrote: > Le dim. 27 nov. 2022 à 15:31, Ian Lawrence Barwick > > > > > I'm trying to reconcile open CommitFest entries with their actual > > status; the entry for this: > > > > https://commitfest.postgresql.org/40/3558/ > > > > shows as "Wa

Re: Allow file inclusion in pg_hba and pg_ident files

2022-11-27 Thread Ian Lawrence Barwick
2022年11月27日(日) 20:04 Julien Rouhaud : > > On Sun, Nov 27, 2022 at 03:39:44PM +0800, Julien Rouhaud wrote: > > Le dim. 27 nov. 2022 à 15:31, Ian Lawrence Barwick > > > > > > > > I'm trying to reconcile open CommitFest entries with their actual > > > status; the entry for this: > > > > > > https://

mprove tab completion for ALTER EXTENSION ADD/DROP

2022-11-27 Thread vignesh C
Hi, Tab completion for ALTER EXTENSION ADD and DROP was missing, this patch adds the tab completion for the same. Regards, Vignesh From 35e9e8bd22ae8767baa95a04c41ee8f68a9c5338 Mon Sep 17 00:00:00 2001 From: Vignesh C Date: Sat, 26 Nov 2022 20:18:58 +0530 Subject: [PATCH v1] Missing tab completi

Re: MSVC vs Perl

2022-11-27 Thread Andrew Dunstan
On 2022-11-26 Sa 16:25, Andrew Dunstan wrote: > On 2022-11-26 Sa 16:05, Andres Freund wrote: >> Hi, >> >> On 2022-11-26 09:43:19 -0500, Andrew Dunstan wrote: >>> OK, so this cures the problem for drongo: >>> >>> >>> diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm >>> index

Re: Add tracking of backend memory allocated to pg_stat_activity

2022-11-27 Thread Justin Pryzby
On Sun, Nov 27, 2022 at 12:32:19AM -0500, Reid Thompson wrote: > attempt to remedy cfbot windows build issues You can trigger those tests under your own/private repo by pushing a branch to github. See src/tools/ci/README I suppose the cfbot page ought to point that out. -- Justin

Re: Documentation for building with meson

2022-11-27 Thread Justin Pryzby
Thanks; two more things I saw: - In other docs, isn't used around { a | b } lists: git grep '[^<]*|' doc - I think this is(was) missing a word; Setting this option allows you to override THE value of all 'auto' features -- Justin

Re: Add tracking of backend memory allocated to pg_stat_activity

2022-11-27 Thread Ted Yu
On Sat, Nov 26, 2022 at 9:32 PM Reid Thompson wrote: > On Sat, 2022-11-26 at 22:10 -0500, Reid Thompson wrote: > > Code rebased to current master. > > Updated to incorporate additional recommendations from the the list > >- add units to variables in view > >- remove 'backend_' prefix from

Re: Add tracking of backend memory allocated to pg_stat_activity

2022-11-27 Thread Justin Pryzby
On Sun, Nov 27, 2022 at 12:32:19AM -0500, Reid Thompson wrote: > @@ -32,6 +33,12 @@ typedef enum BackendState > STATE_DISABLED > } BackendState; > > +/* Enum helper for reporting memory allocated bytes */ > +enum allocation_direction > +{ > + DECREASE = -1, > + INCREASE = 1, > +};

Re: pglz compression performance, take two

2022-11-27 Thread Tomas Vondra
Hi, I took a look at the v6 patch, with the intention to get it committed. I have a couple minor comments: 1) For PGLZ_HISTORY_SIZE it uses literal 0x0fff, with the explanation: /* to avoid compare in iteration */ which I think means intent to use this value as a bit mask, but then the only

Re: pglz compression performance, take two

2022-11-27 Thread Tomas Vondra
On 11/27/22 17:02, Tomas Vondra wrote: > Hi, > > I took a look at the v6 patch, with the intention to get it committed. I > have a couple minor comments: > > 1) For PGLZ_HISTORY_SIZE it uses literal 0x0fff, with the explanation: > > /* to avoid compare in iteration */ > > which I think mean

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2022-11-27 Thread Laurenz Albe
On Sat, 2022-11-26 at 11:00 -0800, Peter Geoghegan wrote: > > I think that is a good idea. > > Wouldn't it make sense to trigger that at *half* > > "autovacuum_freeze_max_age"? > > That would be equivalent to what I've done here, provided you also > double the autovacuum_freeze_max_age setting.

Re: Add tracking of backend memory allocated to pg_stat_activity

2022-11-27 Thread Ted Yu
On Sun, Nov 27, 2022 at 7:41 AM Justin Pryzby wrote: > On Sun, Nov 27, 2022 at 12:32:19AM -0500, Reid Thompson wrote: > > @@ -32,6 +33,12 @@ typedef enum BackendState > > STATE_DISABLED > > } BackendState; > > > > +/* Enum helper for reporting memory allocated bytes */ > > +enum allocation

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2022-11-27 Thread Peter Geoghegan
On Sun, Nov 27, 2022 at 8:54 AM Laurenz Albe wrote: > That's exactly what I was trying to debate. Wouldn't it make sense to > trigger VACUUM earlier so that it has a chance of being less heavy? > On the other hand, if there are not sufficiently many modifications > on the table to trigger autovac

Re: pglz compression performance, take two

2022-11-27 Thread Andrey Borodin
Hi Tomas, On Sun, Nov 27, 2022 at 8:02 AM Tomas Vondra wrote: > > 1) For PGLZ_HISTORY_SIZE it uses literal 0x0fff, with the explanation: > > /* to avoid compare in iteration */ > > which I think means intent to use this value as a bit mask, but then the > only place using PGLZ_HISTORY_SIZE do

Re: Use fadvise in wal replay

2022-11-27 Thread Andrey Borodin
On Fri, Nov 25, 2022 at 1:12 PM Pavel Borisov wrote: > > As I've written up in the thread we can not gain much from this > optimization. The results of Jakub shows around 2% difference: > > >baseline, master, default Linux readahead (128kb): > >33.979, 0.478 > >35.137, 0.504 > >34.649, 0.518> > >

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

2022-11-27 Thread Andrey Borodin
On Tue, Nov 8, 2022 at 9:06 PM Andrey Borodin wrote: > > 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.

Re: ALTER TABLE uses a bistate but not for toast tables

2022-11-27 Thread Justin Pryzby
On Wed, Sep 07, 2022 at 10:48:39AM +0200, Drouvot, Bertrand wrote: > Hi, > > On 6/22/22 4:38 PM, Justin Pryzby wrote: > > ATRewriteTable() calls table_tuple_insert() with a bistate, to avoid > > clobbering > > and polluting the buffers. > > > > But heap_insert() then calls > > heap_prepare_inser

Re: Amcheck verification of GiST and GIN

2022-11-27 Thread Andrey Borodin
Hello! Thank you for the review! On Thu, Nov 24, 2022 at 6:04 PM Jose Arthur Benetasso Villanova wrote: > > It compiled with those 2 warnings: > > verify_gin.c: In function 'gin_check_parent_keys_consistency': > verify_gin.c:481:38: warning: declaration of 'maxoff' shadows a previous > local [-W

Re: O(n) tasks cause lengthy startups and checkpoints

2022-11-27 Thread Nathan Bossart
Thanks for taking a look! On Thu, Nov 24, 2022 at 05:31:02PM +, Simon Riggs wrote: > * not sure I believe that everything it does can always be aborted out > of and shutdown - to achieve that you will need a > CHECK_FOR_INTERRUPTS() calls in the loops in patches 5 and 6 at least I did somethi

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-11-27 Thread Nathan Bossart
On Thu, Nov 24, 2022 at 05:26:27AM +, Hayato Kuroda (Fujitsu) wrote: > I have no comments for the v3 patch. Thanks for reviewing! Does anyone else have thoughts on the patch? -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Reducing power consumption on idle servers

2022-11-27 Thread Thomas Munro
On Sun, Nov 27, 2022 at 6:15 PM Ian Lawrence Barwick wrote: > 2022年11月22日(火) 5:50 Laurenz Albe : > > On Mon, 2022-11-21 at 12:11 -0500, Tom Lane wrote: > > > Robert Haas writes: > > > > The reason that I pushed back -- not as successfully as I would have > > > > liked -- on the changes to pg_stop

Re: [DOCS] Stats views and functions not in order?

2022-11-27 Thread Peter Smith
On Fri, Nov 25, 2022 at 11:09 PM Peter Eisentraut wrote: > > On 23.11.22 09:36, Peter Smith wrote: > > PSA new patches. Now there are 6 of them. If some of the earlier > > patches are agreeable can those ones please be committed? (because I > > think this patch may be susceptible to needing a big

Re: [DOCS] Stats views and functions not in order?

2022-11-27 Thread Peter Smith
On Sat, Nov 26, 2022 at 2:43 PM David G. Johnston wrote: > > On Wed, Nov 23, 2022 at 1:36 AM Peter Smith wrote: >> >> On Thu, Nov 17, 2022 at 8:46 AM David G. Johnston >> wrote: >> >> > Also, make it so each view ends up being its own separate page. >> > >> >> I did not do this. AFAIK those view

Re: Missing update of all_hasnulls in BRIN opclasses

2022-11-27 Thread Tomas Vondra
Here's an improved version of the fix I posted about a month ago. 0001 Adds tests demonstrating the issue, as before. I realized there's an isolation test in src/test/module/brin that can demonstrate this, so I modified it too, not just the pageinspect test as before. 0002 Uses the combination

Re: Bug in row_number() optimization

2022-11-27 Thread David Rowley
On Sat, 26 Nov 2022 at 05:19, Tom Lane wrote: > > Sergey Shinderuk writes: > > What about user-defined operators? I created my own <= operator for int8 > > which returns true on null input, and put it in a btree operator class. > > Admittedly, it's weird that (null <= 1) evaluates to true. But do

Re: Amcheck verification of GiST and GIN

2022-11-27 Thread Andrey Borodin
On Sun, Nov 27, 2022 at 1:29 PM Andrey Borodin wrote: > > GiST verification checks only one invariant that can be verified if > page locks acquired the same way as page split does. > GIN does not require ShareLock because it does not check cross-level > invariants. > I was wrong. GIN check does

Re: Allow file inclusion in pg_hba and pg_ident files

2022-11-27 Thread Michael Paquier
On Sun, Nov 27, 2022 at 09:49:31PM +0900, Ian Lawrence Barwick wrote: > Thanks for the quick update! FWIW, I do intend to tackle this last part ASAP, as the last piece to commit to get the full picture in the tree. -- Michael signature.asc Description: PGP signature

Re: [BUG] FailedAssertion in SnapBuildPurgeOlderTxn

2022-11-27 Thread Masahiko Sawada
On Fri, Nov 25, 2022 at 5:58 PM Maxim Orlov wrote: > > > > On Fri, 25 Nov 2022 at 09:40, Amit Kapila wrote: >> >> On Thu, Nov 24, 2022 at 4:43 PM Amit Kapila wrote: >> > >> > On Thu, Nov 24, 2022 at 1:48 PM Masahiko Sawada >> > wrote: >> > > >> > > On Wed, Nov 23, 2022 at 12:00 PM Amit Kapila

Re: Report roles in pg_upgrade pg_ prefix check

2022-11-27 Thread Michael Paquier
On Thu, Nov 24, 2022 at 12:31:09PM +0100, Daniel Gustafsson wrote: > Looking at a recent pg_upgrade thread I happened to notice that the check for > roles with a pg_ prefix only reports the error, not the roles it found. Other > similar checks where the user is expected to alter the old cluster ty

Fix comment in SnapBuildFindSnapshot

2022-11-27 Thread Masahiko Sawada
Hi, We have the following comment in SnapBuildFindSnapshot(): * c) transition from FULL_SNAPSHOT to CONSISTENT. * * In FULL_SNAPSHOT state (see d) ), and this xl_running_xacts' It mentions "(state d) )", which seems like a typo of "(state d)", but there is no "state d" in the first p

Re: Remove a unused argument from qual_is_pushdown_safe

2022-11-27 Thread Michael Paquier
On Fri, Nov 25, 2022 at 04:05:13PM +0800, Richard Guo wrote: > +1. In 964c0d0f the checks in qual_is_pushdown_safe() that need to > reference 'subquery' were moved to subquery_is_pushdown_safe(), so param > 'subquery' is not used any more. I think we can just remove it. > > I wonder if we need t

Re: Support logical replication of DDLs

2022-11-27 Thread li jie
> > > All three commands are captured by the event trigger. The first and > second command ends up getting deparsed, WAL-logged and > replayed on the subscriber. The replay of the ALTER TABLE command > causes a duplicate constraint error. The problem is that > while subcommands are captured by even

Re: Reducing power consumption on idle servers

2022-11-27 Thread Bharath Rupireddy
On Mon, Nov 28, 2022 at 5:27 AM Thomas Munro wrote: > > "The trigger_file and promote_trigger_file have been removed." was > missing some words. I've also added a sentence to say which releases > were involved, to make it like nearby paragraphs about other obsolete > stuff. LGTM. > The funny th

Re: Allow processes to reset procArrayGroupNext themselves instead of leader resetting for all the followers

2022-11-27 Thread Bharath Rupireddy
On Sun, Nov 27, 2022 at 2:48 AM Andres Freund wrote: > > Hi, > > On 2022-11-24 10:43:46 +0530, Bharath Rupireddy wrote: > > While working on something else, I noticed that the proc array group > > XID clearing leader resets procArrayGroupNext of all the followers > > atomically along with procArra

Re: Collation version tracking for macOS

2022-11-27 Thread Thomas Munro
On Sat, Nov 26, 2022 at 6:27 PM Thomas Munro wrote: > This is just a first cut, but enough to try out and see if we like it, > what needs to be improved, what edge cases we haven't thought about > etc. Let me know what you think. BTW one problem to highlight (mentioned but buried in the test com

Re: Decouple last important WAL record LSN from WAL insert locks

2022-11-27 Thread Bharath Rupireddy
On Sun, Nov 27, 2022 at 2:43 AM Andres Freund wrote: > > Hi, > > On 2022-11-23 19:12:07 +0530, Bharath Rupireddy wrote: > > While working on something else, I noticed that each WAL insert lock > > tracks its own last important WAL record's LSN (lastImportantAt) and > > both the bgwriter and checkp

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

2022-11-27 Thread Bharath Rupireddy
On Mon, Nov 28, 2022 at 12:57 AM Andrey Borodin wrote: > > Some funny stuff. If a user tries to cancel a non-replicated transaction > Azure Postgres will answer: "user requested cancel while waiting for > synchronous replication ack. The COMMIT record has already flushed to > WAL locally and might

Re: Allow file inclusion in pg_hba and pg_ident files

2022-11-27 Thread Michael Paquier
On Sun, Nov 27, 2022 at 07:04:46PM +0800, Julien Rouhaud wrote: > And here's the rebased patch for the TAP tests. I will switch the CF entry to > Needs Review. I have been looking at that, and applied the part 1 of the test for the positive tests to cover the basic ground I'd like to see covered

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

2022-11-27 Thread Peter Smith
Here are some review comments for patch v51-0002 == 1. GENERAL - terminology: spool/serialize and data/changes/message The terminology seems to be used at random. IMO it might be worthwhile rechecking at least that terms are used consistently in all the comments. e.g "serialize message dat

Re: Remove a unused argument from qual_is_pushdown_safe

2022-11-27 Thread Michael Paquier
On Mon, Nov 28, 2022 at 11:54:45AM +0900, Michael Paquier wrote: > On Fri, Nov 25, 2022 at 04:05:13PM +0800, Richard Guo wrote: >> I wonder if we need to revise the comment atop qual_is_pushdown_safe() >> too which says >> >> * rinfo is a restriction clause applying to the given subquery (whose R

Re: Fix comment in SnapBuildFindSnapshot

2022-11-27 Thread Michael Paquier
On Mon, Nov 28, 2022 at 11:13:23AM +0900, Masahiko Sawada wrote: > We have the following comment in SnapBuildFindSnapshot(): > > * c) transition from FULL_SNAPSHOT to CONSISTENT. > * > * In FULL_SNAPSHOT state (see d) ), and this xl_running_xacts' > > It mentions "(state d) )", which

Re: Understanding, testing and improving our Windows filesystem code

2022-11-27 Thread Ian Lawrence Barwick
2022年10月25日(火) 13:12 Thomas Munro : > > I pushed the bug fixes from this series, without their accompanying > tests. Here's a rebase of the test suite, with all those tests now > squashed into the main test patch, and also the > tell-Windows-to-be-more-like-Unix patch. Registered in the > commitf

Re: Remove a unused argument from qual_is_pushdown_safe

2022-11-27 Thread Yugo NAGATA
On Mon, 28 Nov 2022 16:40:52 +0900 Michael Paquier wrote: > On Mon, Nov 28, 2022 at 11:54:45AM +0900, Michael Paquier wrote: > > On Fri, Nov 25, 2022 at 04:05:13PM +0800, Richard Guo wrote: > >> I wonder if we need to revise the comment atop qual_is_pushdown_safe() > >> too which says > >> > >>

Re: Understanding, testing and improving our Windows filesystem code

2022-11-27 Thread Ian Lawrence Barwick
2022年10月25日(火) 13:12 Thomas Munro : > > I pushed the bug fixes from this series, without their accompanying > tests. Here's a rebase of the test suite, with all those tests now > squashed into the main test patch, and also the > tell-Windows-to-be-more-like-Unix patch. Registered in the > commitf