Re: Teach pg_receivewal to use lz4 compression

2021-11-01 Thread Michael Paquier
On Fri, Oct 29, 2021 at 08:38:33PM +0900, Michael Paquier wrote: > Why would the header size change between the moment the segment is > begun and it is finished? We could store it in memory and write it > again when the segment is closed instead, even if it means to fseek() > back to the beginning

Re: Teach pg_receivewal to use lz4 compression

2021-11-01 Thread gkokolatos
‐‐‐ Original Message ‐‐‐ On Monday, November 1st, 2021 at 9:09 AM, Michael Paquier wrote: > On Fri, Oct 29, 2021 at 08:38:33PM +0900, Michael Paquier wrote: > > It would be good to test with many segments, but could we think about > just relying on LZ4F_decompress() with a frame and

Re: wait event and archive_command

2021-11-01 Thread Fujii Masao
On 2021/10/21 23:55, Bharath Rupireddy wrote: Also how about adding wait events for other commands like archive_cleanup_command, restore_command and recovery_end_command? +1 for the wait event. Thanks! I added the wait events for also restore_command, etc into the patch. I attached that upd

Re: wait event and archive_command

2021-11-01 Thread Fujii Masao
On 2021/10/22 18:32, Michael Paquier wrote: On Thu, Oct 21, 2021 at 10:57:50PM +0900, Fujii Masao wrote: Also how about adding wait events for other commands like archive_cleanup_command, restore_command and recovery_end_command? +1 to add something for all of them as we track the startup p

Re: Added schema level support for publication.

2021-11-01 Thread Greg Nancarrow
On Mon, Nov 1, 2021 at 5:07 PM Masahiko Sawada wrote: > > I haven't followed the discussion on pg_publication_objects view but > what is the primary use case of this view? If it's to list all tables > published in a publication (e.g, "select * from pg_publication_objects > where pubname = 'pub1'),

Fix C4819 warning in MSVC

2021-11-01 Thread Daniel Gustafsson
Reading 1051867.1635720...@sss.pgh.pa.us I noticed that hamerkop raise a C4819 warning on brin_bloom.c, which is defined as: "The file contains a character that cannot be represented in the current code page (number). Save the file in Unicode format to prevent data loss." The warning mess

Re: Partial aggregates pushdown

2021-11-01 Thread Peter Eisentraut
On 21.10.21 12:55, Alexander Pyhalov wrote: Now aggregates with internal states can be pushed down, if they are marked as pushdown safe (this flag is set to true for min/max/sum), have internal states and associated converters. Converters are called locally, they transform aggregate result to

Re: Added schema level support for publication.

2021-11-01 Thread Amit Kapila
On Mon, Nov 1, 2021 at 2:48 AM Tomas Vondra wrote: > > On 10/28/21 04:41, Amit Kapila wrote: > > On Mon, Oct 25, 2021 at 3:09 PM Amit Kapila wrote: > >> > >> On Mon, Oct 25, 2021 at 1:11 PM vignesh C wrote: > >>> > >>> I have fixed this in the v47 version attached. > >>> > >> > >> Thanks, the fi

Re: Added schema level support for publication.

2021-11-01 Thread Amit Kapila
On Mon, Nov 1, 2021 at 2:38 PM Greg Nancarrow wrote: > > On Mon, Nov 1, 2021 at 5:07 PM Masahiko Sawada wrote: > > > > I haven't followed the discussion on pg_publication_objects view but > > what is the primary use case of this view? If it's to list all tables > > published in a publication (e.g

Re: Partial aggregates pushdown

2021-11-01 Thread Alexander Pyhalov
Peter Eisentraut писал 2021-11-01 12:47: On 21.10.21 12:55, Alexander Pyhalov wrote: Now aggregates with internal states can be pushed down, if they are marked as pushdown safe (this flag is set to true for min/max/sum), have internal states and associated converters. Converters are called loca

Re: Missing include in be-secure-openssl.c?

2021-11-01 Thread Daniel Gustafsson
> On 1 Nov 2021, at 06:27, Michael Paquier wrote: > On Sun, Oct 31, 2021 at 06:45:47PM -0400, Tom Lane wrote: >> Anyway, I propose adding that #include. > > openssl/ssl.h includes openssl/x509.h if OPENSSL_NO_DEPRECATED_1_1_0 > is not defined, but agreed that adding the header makes sense here.

Re: Added schema level support for publication.

2021-11-01 Thread Tomas Vondra
On 11/1/21 11:18, Amit Kapila wrote: On Mon, Nov 1, 2021 at 2:48 AM Tomas Vondra wrote: On 10/28/21 04:41, Amit Kapila wrote: On Mon, Oct 25, 2021 at 3:09 PM Amit Kapila wrote: On Mon, Oct 25, 2021 at 1:11 PM vignesh C wrote: I have fixed this in the v47 version attached. Thanks,

Re: Feature request for adoptive indexes

2021-11-01 Thread Hayk Manukyan
I agree with the above mentioned. The only concern I have is that we compare little wrong things. For read we should compare (job, nlp, year, sequence) AND (job, nlp, year, Scan_ID) and (job, nlp, year, issue_flag ) VS (job, nlp, year, sequence, Scan_ID, issue_flag) OR (job, nlp, year INCLUDE(

Re: parallel vacuum comments

2021-11-01 Thread Masahiko Sawada
On Mon, Nov 1, 2021 at 10:44 AM Masahiko Sawada wrote: > > On Sun, Oct 31, 2021 at 6:21 AM Andres Freund wrote: > > > > Hi, > > > > Due to bug #17245: [1] I spent a considerably amount of time looking at > > vacuum > > related code. And I found a few things that I think could stand improvement:

Re: should we enable log_checkpoints out of the box?

2021-11-01 Thread Magnus Hagander
On Sun, Oct 31, 2021 at 9:05 PM Tomas Vondra wrote: > On 10/31/21 21:16, Andres Freund wrote: > > Hi, > > > > On 2021-10-31 15:43:57 -0400, Tom Lane wrote: > >> Andres Freund writes: > >>> On 2021-10-31 10:59:19 -0400, Tom Lane wrote: > No DBA would be likely to consider it as anything but

RE: Failed transaction statistics to measure the logical replication progress

2021-11-01 Thread osumi.takami...@fujitsu.com
On Thursday, October 28, 2021 11:19 PM I wrote: > I've created a new patch that extends pg_stat_subscription_workers to include > other transaction statistics. > > Note that this patch depends on v18 patch-set in [1]... Rebased based on the v19 in [1]. Also, fixed documentation a little and made t

Re: Missing include in be-secure-openssl.c?

2021-11-01 Thread Tom Lane
Daniel Gustafsson writes: > It does make sense, but it's a bit worrisome that the indirect inclusion no > longer works as there is no obvious explanation as to why. Yeah. Just to make things even more confusing, hamerkop is not failing in the back branches. v14 at least has exactly the same con

Commitfest 2021-11

2021-11-01 Thread Daniel Gustafsson
It is now November 1st AOE and thus the 2021-11 commitfest is now in progress. I've switched the status and opened 2022-01 for new patches, but noone has so far raised their hand to run it AFAICT? Do we have a volunteer Commitfest Manager keen to help the community make progress on closing patches

Re: remove internal support in pgcrypto?

2021-11-01 Thread Andrew Dunstan
On 8/24/21 08:38, Daniel Gustafsson wrote: >> On 24 Aug 2021, at 11:13, Peter Eisentraut >> wrote: >> So I'm tempted to suggest that we remove the built-in, non-OpenSSL cipher >> and hash implementations in pgcrypto (basically INT_SRCS in >> pgcrypto/Makefile), and then also pursue the simpli

Re: storing an explicit nonce

2021-11-01 Thread Antonin Houska
Sasasu wrote: > On 2021/10/6 23:01, Robert Haas wrote: > > This seems wrong to me. CTR requires that you not reuse the IV. If you > > re-encrypt the page with a different IV, torn pages are a problem. If > > you re-encrypt it with the same IV, then it's not secure any more. > for CBC if the IV i

Re: Fix C4819 warning in MSVC

2021-11-01 Thread Tom Lane
Daniel Gustafsson writes: > Reading 1051867.1635720...@sss.pgh.pa.us I noticed that hamerkop raise a C4819 > warning on brin_bloom.c, which is defined as: >"The file contains a character that cannot be represented in the current > code page (number). Save the file in Unicode format to pre

Re: pgbench bug candidate: negative "initial connection time"

2021-11-01 Thread Fujii Masao
On 2021/09/29 22:11, Fujii Masao wrote: On 2021/09/24 11:26, Fujii Masao wrote: On 2021/09/24 7:26, Yugo NAGATA wrote: That makes sense. Failures of setup connection or initial connection doesn't seem 'static problems'. I rewrote this description to explain exit status 1 indicates also in

Re: pgbench bug candidate: negative "initial connection time"

2021-11-01 Thread Fujii Masao
On 2021/10/09 0:41, Fujii Masao wrote: On 2021/10/01 15:27, Michael Paquier wrote: On Wed, Sep 29, 2021 at 10:11:53PM +0900, Fujii Masao wrote: BTW, when logfile fails to be opened, pgbench gets stuck due to commit aeb57af8e6. So even if we decided not to back-patch those changes, we shoul

Re: Non-superuser subscription owners

2021-11-01 Thread Andrew Dunstan
On 10/20/21 14:40, Mark Dilger wrote: > These patches have been split off the now deprecated monolithic "Delegating > superuser tasks to new security roles" thread at [1]. > > The purpose of these patches is to allow non-superuser subscription owners > without risk of them overwriting tables th

Re: Feature request for adoptive indexes

2021-11-01 Thread Tomas Vondra
On 11/1/21 1:24 PM, Hayk Manukyan wrote: > I agree with the above mentioned.   > The only concern I have is that we compare little wrong things. > For read we should compare   >  (job, nlp, year, sequence) AND (job, nlp, year, Scan_ID) and (job, nlp, > year,  issue_flag  ) VS  (job, nlp, year, sequ

Re: [PATCH] Added TRANSFORM FOR for COMMENT tab completion

2021-11-01 Thread Fujii Masao
On 2021/10/27 15:54, Shinya Kato wrote: On 2021-10-27 14:45, Michael Paquier wrote: On Tue, Oct 26, 2021 at 05:04:24PM +0900, Shinya Kato wrote: Barring any objection, I will change status to Ready for Committer. +   else if (Matches("COMMENT", "ON", "PROCEDURAL")) +   COMPLETE_WITH("L

enabling FOO=bar arguments to vcregress.pl

2021-11-01 Thread Andrew Dunstan
As I mentioned recently at ,  I want to get USE_MODULE_DB working for vcregress.pl. I started out writing code to strip this from the command line or get it from the environment, but then it struck me that if would be better to

Re: inefficient loop in StandbyReleaseLockList()

2021-11-01 Thread Tom Lane
Kyotaro Horiguchi writes: > At Sun, 31 Oct 2021 16:55:01 -0400, Tom Lane wrote in >> I looked at the remaining list_delete_first callers. >> >> 1. Attached is a proposed patch to get rid of the calls in trgm_regexp.c. >> I'm not certain that those lists could get long enough to be a problem, >>

Re: inefficient loop in StandbyReleaseLockList()

2021-11-01 Thread Bossart, Nathan
On 10/31/21, 12:39 PM, "Tom Lane" wrote: > Yeah, there's no expectation that this data structure needs to be kept > consistent after an error; and I'm not real sure that the existing > code could claim to satisfy such a requirement if we did need it. > (There's at least a short window where the ca

Re: Fix C4819 warning in MSVC

2021-11-01 Thread Daniel Gustafsson
> On 1 Nov 2021, at 14:56, Tom Lane wrote: > > Daniel Gustafsson writes: >> Reading 1051867.1635720...@sss.pgh.pa.us I noticed that hamerkop raise a >> C4819 >> warning on brin_bloom.c, which is defined as: >> "The file contains a character that cannot be represented in the current >>code

Re: Fix C4819 warning in MSVC

2021-11-01 Thread Tom Lane
Daniel Gustafsson writes: > On 1 Nov 2021, at 14:56, Tom Lane wrote: >> +1, but there are also C4819 warnings in fe_utils/print.c. Can we get >> rid of that too? That one's a bit more integral to the code, since >> (I think) it's complaining about the comments in the unicode_style table. >> But

Re: Improve logging when using Huge Pages

2021-11-01 Thread Fujii Masao
On 2021/10/29 7:05, Justin Pryzby wrote: Hi, On Wed, Oct 27, 2021 at 06:39:46AM +, Shinoda, Noriyoshi (PN Japan FSIP) wrote: Thank you for your comment. The attached patch stops message splitting. This patch also limits the timing of message output when huge_pages = try and HugePages i

Re: Improve logging when using Huge Pages

2021-11-01 Thread Fujii Masao
On 2021/10/29 16:00, Masahiko Sawada wrote: Which is noisy. Perhaps it's better to log it only when IsPostmasterEnvironment is true. +1 Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION

Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.

2021-11-01 Thread Stephen Frost
Greetings, * Bossart, Nathan (bossa...@amazon.com) wrote: > On 10/30/21, 11:14 AM, "Jeff Davis" wrote: > > On Sat, 2021-10-30 at 13:24 +0530, Bharath Rupireddy wrote: > >> IMHO, moving away from SQL command "CHECKPOINT" to function > >> "pg_checkpoint()" isn't nice as the SQL command has been the

Re: inefficient loop in StandbyReleaseLockList()

2021-11-01 Thread Bossart, Nathan
On 10/31/21, 1:55 PM, "Tom Lane" wrote: > 1. Attached is a proposed patch to get rid of the calls in trgm_regexp.c. > I'm not certain that those lists could get long enough to be a problem, > given the existing complexity limits in that file (MAX_EXPANDED_STATES > etc). But I'm not certain they c

Re: inefficient loop in StandbyReleaseLockList()

2021-11-01 Thread Tom Lane
"Bossart, Nathan" writes: > On 10/31/21, 1:55 PM, "Tom Lane" wrote: >> 1. Attached is a proposed patch to get rid of the calls in trgm_regexp.c. > Should there be a list_free(trgmNFA->queue) at the end of > transformGraph()? There could be, but that's visibly invoked only once per createTrgmNF

Re: inefficient loop in StandbyReleaseLockList()

2021-11-01 Thread Bossart, Nathan
On 11/1/21, 9:58 AM, "Tom Lane" wrote: > "Bossart, Nathan" writes: >> Should there be a list_free(trgmNFA->queue) at the end of >> transformGraph()? > > There could be, but that's visibly invoked only once per > createTrgmNFAInternal call, so I didn't think it was worthwhile > to do so (unlike th

Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.

2021-11-01 Thread Bossart, Nathan
On 11/1/21, 9:51 AM, "Stephen Frost" wrote: > I don't really buy off on the "because it's been around a long time" as > a reason to invent a predefined role for an individual command that > doesn't take any options and could certainly just be a function. > Applications developed to run as a superu

Re: inefficient loop in StandbyReleaseLockList()

2021-11-01 Thread Tom Lane
"Bossart, Nathan" writes: > Ah, I see it now. The patch looks good to me, then. Thanks for looking! Here's an expanded patch that also takes care of the other two easy-to-fix cases, nodeAgg.c and llvmjit.c. AFAICS, llvm_release_context is like StandbyReleaseLockList in that we don't need to wor

Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.

2021-11-01 Thread Stephen Frost
Greetings, * Bossart, Nathan (bossa...@amazon.com) wrote: > On 11/1/21, 9:51 AM, "Stephen Frost" wrote: > > All that said, I wonder if we can have our cake and eat it too. I > > haven't looked into this at all yet and perhaps it's foolish on its > > face, but, could we make CHECKPOINT; basically

Re: parallelizing the archiver

2021-11-01 Thread Stephen Frost
Greetings, * Bossart, Nathan (bossa...@amazon.com) wrote: > On 10/25/21, 1:41 PM, "Bossart, Nathan" wrote: > > Great. Unless I see additional feedback on the basic design shortly, > > I'll give the documentation updates a try. > > Okay, here is a more complete patch with a first attempt at the

Re: Non-superuser subscription owners

2021-11-01 Thread Mark Dilger
> On Nov 1, 2021, at 7:18 AM, Andrew Dunstan wrote: > > w.r.t. this: > > + On the subscriber, the subscription owner's privileges are > re-checked for > + each change record when applied, but beware that a change of > ownership for a > + subscription may not be noticed immediately by the

Re: XTS cipher mode for cluster file encryption

2021-11-01 Thread Stephen Frost
Greetings, * Bruce Momjian (br...@momjian.us) wrote: > On Tue, Oct 26, 2021 at 11:11:39PM +0200, Tomas Vondra wrote: > > BTW I'm not sure what the existing patches do, but I wonder if we should > > calculate the checksum before or after encryption. I'd say it should be > > after encryption, becaus

Re: inefficient loop in StandbyReleaseLockList()

2021-11-01 Thread Bossart, Nathan
On 11/1/21, 10:34 AM, "Tom Lane" wrote: > Thanks for looking! Here's an expanded patch that also takes care > of the other two easy-to-fix cases, nodeAgg.c and llvmjit.c. > AFAICS, llvm_release_context is like StandbyReleaseLockList > in that we don't need to worry about whether the data structur

Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.

2021-11-01 Thread Bossart, Nathan
On 11/1/21, 10:43 AM, "Stephen Frost" wrote: > Folks playing around in the catalog can break lots of things, I don't > really see this as an argument against the idea. > > I do wonder if we should put a bit more effort into preventing people > from messing with functions and such in pg_catalog. B

Re: parallelizing the archiver

2021-11-01 Thread Bossart, Nathan
On 11/1/21, 10:57 AM, "Stephen Frost" wrote: > Definitely interested and plan to look at this more shortly, and > generally this all sounds good, but maybe we should have it be posted > under a new thread as it's moved pretty far from the subject and folks > might not appreciate what this is about

removing global variable ThisTimeLineID

2021-11-01 Thread Robert Haas
Hi, The global variable ThisTimeLineID is rather confusing. During recovery, in the startup process, when we're reading a WAL record, it is the timeline of the WAL record we are trying to read or have just read, except when we're trying to read the initial checkpoint record, when it's zero. In oth

Portability report: ninja

2021-11-01 Thread Tom Lane
Meson depends on ninja, so it behooves us to look into portability of ninja if we're considering migrating to meson as the build system. I tried it out quickly on some ancient platforms, and here's what I found. 1. The documentation is kinda sucky, eg it fails to explain how to run ninja's own reg

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-11-01 Thread Stephen Frost
Greetings, * Mark Dilger (mark.dil...@enterprisedb.com) wrote: > > On Oct 29, 2021, at 4:46 PM, Jeff Davis wrote: > > But I don't think the concept of role ownership has zero potential > > confusion, either. For instance, I could certainly imagine a user A > > creating a role B (and therefore own

Re: Portability report: ninja

2021-11-01 Thread Jesper Pedersen
Hi, On 11/1/21 15:25, Tom Lane wrote: So it's pretty clear that if we go this way, it'll be the end of the line for support for some very old OS versions. I can't, however, argue with the idea that it's reasonable to require POSIX 2001 support now. Based on these results, I doubt that ninja wi

Re: Feature request for adoptive indexes

2021-11-01 Thread Robert Haas
On Tue, Oct 26, 2021 at 11:11 AM Tomas Vondra wrote: > If I get what you propose, you want to have a "top" tree for (job, nlp, > year), which "splits" the data set into subsets of ~5000-7000 rows. And > then for each subset you want a separate "small" trees on each of the > other columns, so in th

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-11-01 Thread Stephen Frost
Greetings, * Mark Dilger (mark.dil...@enterprisedb.com) wrote: > > On Oct 25, 2021, at 11:30 AM, Stephen Frost wrote: > > > Consider instead: > > > > CREATE ROLE X; > > CREATE ROLE Y; > > CREATE ROLE Z; > > > > GRANT Y to X; > > GRANT Z to X; > > > > SET ROLE X; > > CREATE EVENT TRIGGER FOR Y

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-11-01 Thread Mark Dilger
> On Nov 1, 2021, at 12:44 PM, Stephen Frost wrote: > > I can generally get behind the idea that a user who has been allowed to > create other roles should be able to do various other things with that > role, but should also be limited by what rights they themselves have > (unlike how CREATERO

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-11-01 Thread Mark Dilger
> On Nov 1, 2021, at 1:13 PM, Stephen Frost wrote: > >> Having Batman *own* all residents in Gotham city would work, if we can agree >> on a role ownership system. It has the downside that only a role's (direct >> or indirect) owner can do the auditing, though. That's more flexible than >

Re: Portability report: ninja

2021-11-01 Thread Thomas Munro
On Tue, Nov 2, 2021 at 8:25 AM Tom Lane wrote: > 6. While configure.py thinks it knows what to do on AIX, it fails > on AIX 7.1 and 7.2: > > Traceback (most recent call last): > File "./configure.py", line 544, in > if platform.is_aix() and not platform.is_os400_pase(): > File "./configur

Re: Portability report: ninja

2021-11-01 Thread Thomas Munro
On Tue, Nov 2, 2021 at 8:25 AM Tom Lane wrote: > 5. It built and passed self-test on Solaris 11, but failed self-test > on Solaris 10. I haven't had time to actually do anything with it yet, but I can report that meson and ninja are, as of quite recently, available in the package repository of Op

Re: parallel vacuum comments

2021-11-01 Thread Peter Geoghegan
On Mon, Nov 1, 2021 at 5:47 AM Masahiko Sawada wrote: > For discussion, I've written a patch only for adding some tests to > parallel vacuum. The test includes the reported case where small > indexes are not processed by the leader process as well as cases where > different kinds of indexes (i.g.,

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-11-01 Thread Stephen Frost
Greetings, * Mark Dilger (mark.dil...@enterprisedb.com) wrote: > > On Nov 1, 2021, at 12:44 PM, Stephen Frost wrote: > > I can generally get behind the idea that a user who has been allowed to > > create other roles should be able to do various other things with that > > role, but should also be

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-11-01 Thread Stephen Frost
Greetings, * Mark Dilger (mark.dil...@enterprisedb.com) wrote: > > On Nov 1, 2021, at 1:13 PM, Stephen Frost wrote: > >> Having Batman *own* all residents in Gotham city would work, if we can > >> agree on a role ownership system. It has the downside that only a role's > >> (direct or indirect

Re: Feature request for adoptive indexes

2021-11-01 Thread Tomas Vondra
On 11/1/21 21:06, Robert Haas wrote: On Tue, Oct 26, 2021 at 11:11 AM Tomas Vondra wrote: If I get what you propose, you want to have a "top" tree for (job, nlp, year), which "splits" the data set into subsets of ~5000-7000 rows. And then for each subset you want a separate "small" trees on

Re: Partial aggregates pushdown

2021-11-01 Thread Ilya Gladyshev
Hi, On 21.10.2021 13:55, Alexander Pyhalov wrote: Hi. Updated patch. Now aggregates with internal states can be pushed down, if they are marked as pushdown safe (this flag is set to true for min/max/sum), have internal states and associated converters. I don't quite understand why this is re

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-11-01 Thread Mark Dilger
> On Nov 1, 2021, at 2:00 PM, Stephen Frost wrote: > I've not directly looked at that patch, but I like it based on the name, > if we think we can actually get folks to agree to is as it's quite a > change from the current situation. Previously I've felt that we > wouldn't have support for br

Re: Partial aggregates pushdown

2021-11-01 Thread Ilya Gladyshev
On 01.11.2021 13:30, Alexander Pyhalov wrote: Peter Eisentraut писал 2021-11-01 12:47: On 21.10.21 12:55, Alexander Pyhalov wrote: Now aggregates with internal states can be pushed down, if they are marked as pushdown safe (this flag is set to true for min/max/sum), have internal states and a

Re: Partial aggregates pushdown

2021-11-01 Thread Tomas Vondra
On 11/1/21 22:31, Ilya Gladyshev wrote: Hi, On 21.10.2021 13:55, Alexander Pyhalov wrote: Hi. Updated patch. Now aggregates with internal states can be pushed down, if they are marked as pushdown safe (this flag is set to true for min/max/sum), have internal states and associated converter

Re: Fix C4819 warning in MSVC

2021-11-01 Thread Daniel Gustafsson
> On 1 Nov 2021, at 17:12, Tom Lane wrote: > > Daniel Gustafsson writes: >> On 1 Nov 2021, at 14:56, Tom Lane wrote: >>> +1, but there are also C4819 warnings in fe_utils/print.c. Can we get >>> rid of that too? That one's a bit more integral to the code, since >>> (I think) it's complaining

Re: inefficient loop in StandbyReleaseLockList()

2021-11-01 Thread Tom Lane
"Bossart, Nathan" writes: > On 10/31/21, 1:55 PM, "Tom Lane" wrote: >> 2. I think we almost certainly have a problem in SyncPostCheckpoint. > This one doesn't look as straightforward. It looks like we might need > a list_delete_first_n() to delete the first N entries all at once to > improve th

Re: Missing include in be-secure-openssl.c?

2021-11-01 Thread Daniel Gustafsson
> On 1 Nov 2021, at 14:33, Tom Lane wrote: > > Daniel Gustafsson writes: >> It does make sense, but it's a bit worrisome that the indirect inclusion no >> longer works as there is no obvious explanation as to why. > > Yeah. Just to make things even more confusing, hamerkop is not failing > in

Re: Missing include in be-secure-openssl.c?

2021-11-01 Thread Michael Paquier
On Mon, Nov 01, 2021 at 11:15:32PM +0100, Daniel Gustafsson wrote: > On 1 Nov 2021, at 14:33, Tom Lane wrote: >>> Judging by OpenSSL, including both is common practice unless the module only >>> deals with v3 extensions. Following that lead seems reasonable. >> >> I see that fe-secure-openssl.c i

Re: Teach pg_receivewal to use lz4 compression

2021-11-01 Thread Michael Paquier
On Mon, Nov 01, 2021 at 08:39:59AM +, gkokola...@pm.me wrote: > Agreed. > > I have already started on v8 of the patch with that technique. I should > be able to update the thread soon. Nice, thanks! -- Michael signature.asc Description: PGP signature

Re: Missing include in be-secure-openssl.c?

2021-11-01 Thread Tom Lane
Michael Paquier writes: > I would follow the practice of upstream to include both if were me > to be consistent, but I'm also fine if you just add x509v3.h to > be-secure-openssl.c. Another thing that's potentially relevant here is that be-secure-openssl.c and fe-secure-openssl.c are including ss

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-11-01 Thread Mark Dilger
> On Nov 1, 2021, at 2:05 PM, Stephen Frost wrote: > > I'm not quite following how your response here is addressing the > point that I brought up in what was quoted above it. Could you clarify which question I didn't answer? I fear I may have left something unanswered, but I don't know to w

Re: Non-superuser subscription owners

2021-11-01 Thread Mark Dilger
> On Nov 1, 2021, at 10:58 AM, Mark Dilger wrote: > > ALTER SUBSCRIPTION..[ENABLE | DISABLE] do not synchronously start or stop > subscription workers. The ALTER command updates the catalog's subenabled > field, but workers only lazily respond to that. Disabling and enabling the > subscri

Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit

2021-11-01 Thread David Zhang
I evaluated the effectiveness of the patch using a simple multi-statement transaction: BEGIN; SAVEPOINT s; INSERT INTO ft1 VALUES (10, 10); INSERT INTO ft2 VALUES (20, 20); RELEASE SAVEPOINT s; COMMIT; where ft1 and ft2 are foreign tables created on different foreign servers hosted on different

Re: Partial aggregates pushdown

2021-11-01 Thread Tomas Vondra
On 11/1/21 22:53, Ilya Gladyshev wrote: On 01.11.2021 13:30, Alexander Pyhalov wrote: Peter Eisentraut писал 2021-11-01 12:47: On 21.10.21 12:55, Alexander Pyhalov wrote: Now aggregates with internal states can be pushed down, if they are marked as pushdown safe (this flag is set to true f

Re: inefficient loop in StandbyReleaseLockList()

2021-11-01 Thread Kyotaro Horiguchi
At Mon, 01 Nov 2021 11:58:35 -0400, Tom Lane wrote in > Kyotaro Horiguchi writes: > > At Sun, 31 Oct 2021 16:55:01 -0400, Tom Lane wrote in > >> I looked at the remaining list_delete_first callers. > >> > >> 1. Attached is a proposed patch to get rid of the calls in trgm_regexp.c. > >> I'm no

Re: inefficient loop in StandbyReleaseLockList()

2021-11-01 Thread Kyotaro Horiguchi
At Mon, 1 Nov 2021 17:02:49 +, "Bossart, Nathan" wrote in > On 11/1/21, 9:58 AM, "Tom Lane" wrote: > > "Bossart, Nathan" writes: > >> Should there be a list_free(trgmNFA->queue) at the end of > >> transformGraph()? > > > > There could be, but that's visibly invoked only once per > > create

Re: Added schema level support for publication.

2021-11-01 Thread Masahiko Sawada
On Mon, Nov 1, 2021 at 7:28 PM Amit Kapila wrote: > > On Mon, Nov 1, 2021 at 2:38 PM Greg Nancarrow wrote: > > > > On Mon, Nov 1, 2021 at 5:07 PM Masahiko Sawada > > wrote: > > > > > > I haven't followed the discussion on pg_publication_objects view but > > > what is the primary use case of thi

Re: enabling FOO=bar arguments to vcregress.pl

2021-11-01 Thread Michael Paquier
On Mon, Nov 01, 2021 at 11:33:21AM -0400, Andrew Dunstan wrote: > As I mentioned recently at > ,  > I want to get USE_MODULE_DB working for vcregress.pl. I started out > writing code to strip this from the command line or get it

Re: inefficient loop in StandbyReleaseLockList()

2021-11-01 Thread Kyotaro Horiguchi
At Mon, 01 Nov 2021 18:01:18 -0400, Tom Lane wrote in > "Bossart, Nathan" writes: > > On 10/31/21, 1:55 PM, "Tom Lane" wrote: > >> 2. I think we almost certainly have a problem in SyncPostCheckpoint. > > > This one doesn't look as straightforward. It looks like we might need > > a list_delete

Re: removing global variable ThisTimeLineID

2021-11-01 Thread Michael Paquier
On Mon, Nov 01, 2021 at 03:16:27PM -0400, Robert Haas wrote: > At the risk of stating the obvious, using the same variable for > different purposes at different times is not a great programming > practice. Commits 2f5c4397c39dea49c5608ba583868e26d767fc32 and > 902a2c280012557b85c7e0fce3f6f0e355cb2d

Re: Add support for ALTER INDEX .. ALTER [COLUMN] col_num {SET,RESET}

2021-11-01 Thread Michael Paquier
On Sat, Oct 30, 2021 at 09:45:50AM +0900, Michael Paquier wrote: > Another thing that could be done is to mark the index as invalid once > its set of opclass parameters is updated. That would be simpler, > while allowing users to fire a concurrent or non-concurrent rebuild at > will after an ALTER

Re: Skipping logical replication transactions on subscriber side

2021-11-01 Thread Greg Nancarrow
On Fri, Oct 29, 2021 at 4:24 PM Masahiko Sawada wrote: > > I've attached a new version patch. Since the syntax of skipping > transaction id is under the discussion I've attached only the error > reporting patch for now. > I have some comments on the v19-0001 patch: v19-0001 (1) doc/src/sgml/mon

Re: Portability report: ninja

2021-11-01 Thread Andres Freund
Hi, On 2021-11-01 15:25:08 -0400, Tom Lane wrote: > Meson depends on ninja, so it behooves us to look into portability > of ninja if we're considering migrating to meson as the build system. > I tried it out quickly on some ancient platforms, and here's what > I found. Thanks, that's helpful! >

Re: archive modules

2021-11-01 Thread Fujii Masao
On 2021/11/02 3:54, Bossart, Nathan wrote: This thread is a continuation of the thread with the subject "parallelizing the archiver" [0]. That thread had morphed into an effort to allow creating archive modules, so I've created a new one to ensure that this topic has the proper visibility.

Re: Portability report: ninja

2021-11-01 Thread Tom Lane
Andres Freund writes: > On 2021-11-01 15:25:08 -0400, Tom Lane wrote: >> Fortunately for my >> purposes here, it seems to work with fairly old Python --- I built >> successfully with python 2.6.2, though not with 2.4.1. > meson will need a newer python though... Yup. I was just trying to establ

Re: Added schema level support for publication.

2021-11-01 Thread Amit Kapila
On Tue, Nov 2, 2021 at 6:43 AM Masahiko Sawada wrote: > > > I am just not sure if it is worth adding > > such a view or we leave it to users to find that information via > > querying individual views or system tables for objects. > > I've not looked at the patch for logical replication of sequence

Re: archive modules

2021-11-01 Thread Michael Paquier
On Tue, Nov 02, 2021 at 01:43:54PM +0900, Fujii Masao wrote: > On 2021/11/02 3:54, Bossart, Nathan wrote: >> This thread is a continuation of the thread with the subject >> "parallelizing the archiver" [0]. That thread had morphed into an >> effort to allow creating archive modules, so I've create

Re: Skipping logical replication transactions on subscriber side

2021-11-01 Thread Amit Kapila
On Mon, Nov 1, 2021 at 7:18 AM Masahiko Sawada wrote: > > On Fri, Oct 29, 2021 at 8:20 PM Amit Kapila wrote: > > > > > > Fair enough. So statistics can be removed either by vacuum or drop > > subscription. Also, if we go by this logic then there is no harm in > > retaining the stat entries for ta

Re: Skipping logical replication transactions on subscriber side

2021-11-01 Thread Amit Kapila
On Mon, Nov 1, 2021 at 7:25 AM Masahiko Sawada wrote: > > On Sat, Oct 30, 2021 at 12:21 PM Amit Kapila wrote: > > > > Don't we want these stats to be dealt in the same way as tables and > > functions as all the stats entries (subscription entries) are specific > > to a particular database? If so,

Re: parallel vacuum comments

2021-11-01 Thread Masahiko Sawada
On Tue, Nov 2, 2021 at 5:57 AM Peter Geoghegan wrote: > > On Mon, Nov 1, 2021 at 5:47 AM Masahiko Sawada wrote: > > For discussion, I've written a patch only for adding some tests to > > parallel vacuum. The test includes the reported case where small > > indexes are not processed by the leader p

Re: XTS cipher mode for cluster file encryption

2021-11-01 Thread Sasasu
On 2021/11/2 02:24, Stephen Frost wrote: I can understand the general idea that we should be sure to engineer this in a way that multiple methods can be used, as surely one day folks will say that AES128 isn't acceptable any more. Cheers! OpenPGP_0x4E72AF09097DAE2E.asc Description: OpenPGP pub

Re: lastOverflowedXid does not handle transaction ID wraparound

2021-11-01 Thread Nikolay Samokhvalov
On Mon, Oct 25, 2021 at 11:41 AM Nikolay Samokhvalov wrote: > On Thu, Oct 21, 2021 at 07:21 Stan Hu wrote: > >> On Wed, Oct 20, 2021 at 9:01 PM Kyotaro Horiguchi >> wrote: >> > >> > lastOverflowedXid is the smallest subxid that possibly exists but >> > possiblly not known to the standby. So if

Re: lastOverflowedXid does not handle transaction ID wraparound

2021-11-01 Thread Nikolay Samokhvalov
The following review has been posted through the commitfest application: make installcheck-world: tested, failed Implements feature: tested, failed Spec compliant: not tested Documentation:not tested The fix is trivial and works as expected, solving the problem Tested