Fix incorrect variable type for origin_id

2022-09-19 Thread Masahiko Sawada
Hi, I realized that there are some places where we use XLogRecPtr for variables for replication origin id. The attached patch fixes them to use RepOriginiId instead. Regards, -- Masahiko Sawada PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com

Re: predefined role(s) for VACUUM and ANALYZE

2022-09-19 Thread Michael Paquier
On Mon, Sep 19, 2022 at 08:51:47PM -0700, Nathan Bossart wrote: > Are there any concerns with simply expanding AclMode to 64 bits, as done in > v5 [0]? > > [0] https://postgr.es/m/20220908055035.GA2100193%40nathanxps13 I have gone through the thread, and I'd agree with getting more granularity

Re: Reducing the chunk header sizes on all memory context types

2022-09-19 Thread Tom Lane
David Rowley writes: > On Tue, 20 Sept 2022 at 13:23, Tom Lane wrote: >> ... but I'm completely not satisfied with the current >> situation in HEAD. > Maybe you've forgotten that MemoryContextContains() is broken in the > back branches or just don't think it is broken? "Broken" is a strong

Re: [PoC] Federated Authn/z with OAUTHBEARER

2022-09-19 Thread mahendrakar s
Hi Hackers, We are trying to implement AAD(Azure AD) support in PostgreSQL and it can be achieved with support of the OAuth method. To support AAD on top of OAuth in a generic fashion (i.e for all other OAuth providers), we are proposing this patch. It basically exposes two new hooks (one for

Re: Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Peter Geoghegan
On Mon, Sep 19, 2022 at 9:48 PM Tom Lane wrote: > As Munro adduces nearby, it'd be a stretch to conclude that the current > format was designed with any Postgres-related goals in mind at all. > I think he's right that it's a variant of some Lisp-y dump format that's > probably far hoarier than

Re: remove more archiving overhead

2022-09-19 Thread Noah Misch
On Mon, Sep 19, 2022 at 12:49:58PM -0400, Robert Haas wrote: > On Mon, Sep 19, 2022 at 10:39 AM Noah Misch wrote: > > I wanted it to stop saying anything like the second paragraph, hence commit > > d263ced. Implementing a proper archiving setup is not especially difficult, > > and inviting the

Re: Reducing the chunk header sizes on all memory context types

2022-09-19 Thread David Rowley
On Tue, 20 Sept 2022 at 13:23, Tom Lane wrote: > > David Rowley writes: > > Aside from that, I don't have any ideas on how to get rid of the > > possible additional datumCopy() from non-Var arguments to these window > > functions. Should we just suffer it? It's quite likely that most > >

Re: Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Tom Lane
Peter Geoghegan writes: > On Mon, Sep 19, 2022 at 8:39 PM Tom Lane wrote: >> Our existing format is certainly not great on those metrics, but >> I do not see how "let's use JSON!" is a route to improvement. > The existing format was designed with developer convenience as a goal, > though --

Re: Patch proposal: make use of regular expressions for the username in pg_hba.conf

2022-09-19 Thread Michael Paquier
On Tue, Sep 20, 2022 at 12:09:33AM -0400, Tom Lane wrote: > You have to assume that somebody (a) has a role or DB name starting > with slash, (b) has an explicit reference to that name in their > pg_hba.conf, (c) doesn't read the release notes, and (d) doesn't > notice that things are misbehaving

Re: A question about wording in messages

2022-09-19 Thread Amit Kapila
On Fri, Sep 16, 2022 at 12:29 PM Amit Kapila wrote: > > > > > > > > > +1, I saw that today and thought it was outside our usual style. > > > > The whole thing is awfully verbose for a GUC description, too. > > > > Maybe > > > > > > > > "Maximum distance to read ahead in WAL to prefetch data

Re: Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Thomas Munro
On Tue, Sep 20, 2022 at 4:03 PM Thomas Munro wrote: > On Tue, Sep 20, 2022 at 3:58 PM Tom Lane wrote: > > Thomas Munro writes: > > > FWIW, it derives from Lisp s-expressions, but deviates from Lisp's > > > default reader/printer behaviour in small ways, including being case > > > sensitive and

Re: Patch proposal: make use of regular expressions for the username in pg_hba.conf

2022-09-19 Thread Tom Lane
Michael Paquier writes: >> On Thu, Sep 8, 2022 at 5:46 PM Tom Lane wrote: >>> Meh ... that concern seems overblown to me. I guess it's possible >>> that somebody has an HBA entry that looks like that, but it doesn't >>> seem very plausible. Note that we made this exact same change in >>>

Re: Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Thomas Munro
On Tue, Sep 20, 2022 at 3:58 PM Tom Lane wrote: > Thomas Munro writes: > > FWIW, it derives from Lisp s-expressions, but deviates from Lisp's > > default reader/printer behaviour in small ways, including being case > > sensitive and using {NAME :x 1 ...} instead of #S(NAME :x 1 ...) for > >

Re: Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Peter Geoghegan
On Mon, Sep 19, 2022 at 8:58 PM Tom Lane wrote: > Wow, where did you find a commit history for Berkeley's code? > There's evidence in the tarballs I have that they were using > RCS, but I never heard that the repo was made public. It's on Github: https://github.com/kelvich/postgres_pre95 --

Re: Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Peter Geoghegan
On Mon, Sep 19, 2022 at 8:39 PM Tom Lane wrote: > There are certainly use-cases for something like that, but let's > be clear about it: that's a niche case of interest to developers > and pretty much nobody else. For ordinary users, what matters about > the node tree storage format is

Re: Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Tom Lane
Thomas Munro writes: > FWIW, it derives from Lisp s-expressions, but deviates from Lisp's > default reader/printer behaviour in small ways, including being case > sensitive and using {NAME :x 1 ...} instead of #S(NAME :x 1 ...) for > structs for reasons that are lost AFAIK (there's a dark age

Re: Patch proposal: make use of regular expressions for the username in pg_hba.conf

2022-09-19 Thread Michael Paquier
On Fri, Sep 09, 2022 at 03:05:18PM -0700, Jacob Champion wrote: > On Thu, Sep 8, 2022 at 5:46 PM Tom Lane wrote: >> Jacob Champion writes: >> > I think you're going to have to address backwards compatibility >> > concerns. Today, I can create a role named "/a", and I can put that >> > into the

Re: predefined role(s) for VACUUM and ANALYZE

2022-09-19 Thread Nathan Bossart
On Thu, Sep 08, 2022 at 09:41:20AM -0400, Robert Haas wrote: > Now on the other hand, I also do think we need more privilege bits. > You're not alone in making the case that this is a problem which needs > to be solved, and the set of other people who are also making that > argument includes me.

Re: Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Amit Kapila
On Tue, Sep 20, 2022 at 7:59 AM Tom Lane wrote: > > Michel Pelletier writes: > > I would like to propose a discussion that in a future major release > > Postgres switch from this custom format to JSON. > > There are certainly reasons to think about changing the node tree > storage format; but if

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

2022-09-19 Thread shiy.f...@fujitsu.com
On Mon, Sept 19, 2022 11:26 AM Wang, Wei/王 威 wrote: > > > Improved as suggested. > Thanks for updating the patch. Here are some comments on 0001 patch. 1. + case TRANS_LEADER_SERIALIZE: - oldctx = MemoryContextSwitchTo(ApplyContext); + /* +

Re: Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Tom Lane
Peter Geoghegan writes: > Writing declarative @> containment queries against (say) a JSON > variant of node tree format seems like it could be a huge quality of > life improvement. There are certainly use-cases for something like that, but let's be clear about it: that's a niche case of interest

Re: Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Thomas Munro
On Tue, Sep 20, 2022 at 12:16 PM Michel Pelletier wrote: > This non-standard format FWIW, it derives from Lisp s-expressions, but deviates from Lisp's default reader/printer behaviour in small ways, including being case sensitive and using {NAME :x 1 ...} instead of #S(NAME :x 1 ...) for structs

Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures

2022-09-19 Thread Nathan Bossart
On Mon, Sep 19, 2022 at 03:16:42PM -0700, Nathan Bossart wrote: > It seems like you want the opposite of pg_walfile_name_offset(). Perhaps > we could add a function like pg_walfile_offset_lsn() that accepts a WAL > file name and byte offset and returns the LSN. Like so... -- Nathan Bossart

Re: Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Peter Geoghegan
On Mon, Sep 19, 2022 at 7:29 PM Tom Lane wrote: > Maybe a compromise could be found whereby we provide a conversion > function that converts whatever the catalog storage format is to > some JSON equivalent. That would address the needs of external > code that doesn't want to write a custom

Re: Support pg_attribute_aligned and noreturn in MSVC

2022-09-19 Thread Michael Paquier
On Mon, Sep 19, 2022 at 08:51:37PM -0400, James Coleman wrote: > Yes, fixed. The CF bot is failing compilation on Windows: http://commitfest.cputube.org/james-coleman.html https://api.cirrus-ci.com/v1/task/5376566577332224/logs/build.log There is something going on with noreturn() after applying

Re: why can't a table be part of the same publication as its schema

2022-09-19 Thread Jonathan S. Katz
On 9/19/22 4:52 PM, Jonathan S. Katz wrote: On 9/19/22 11:16 AM, Alvaro Herrera wrote: This seems a pretty arbitrary restriction.  It feels like you're adding this restriction precisely so that you don't have to write the code to reject the ALTER .. SET SCHEMA if an incompatible configuration

Re: Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Tom Lane
Michel Pelletier writes: > I would like to propose a discussion that in a future major release > Postgres switch from this custom format to JSON. There are certainly reasons to think about changing the node tree storage format; but if we change it, I'd like to see it go to something more compact

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2022-09-19 Thread Peter Smith
I had quick look at the latest v11-0001 patch differences from v10. Here are some initial comments: == 1. Commit message It looks like some small mistake happened. You wrote [1] that my previous review comments about the commit message were fixed, but it seems the v11 commit message is

Re: [RFC] building postgres with meson - v13

2022-09-19 Thread Andres Freund
Hi, On 2022-09-19 05:25:59 -0400, Peter Eisentraut wrote: > IMO, the following commits are ready to be pushed now: Slowly working through them. To have some initial "translation" for other developers I've started a wiki page with a translation table. Still very WIP:

Re: why can't a table be part of the same publication as its schema

2022-09-19 Thread Amit Kapila
On Mon, Sep 19, 2022 at 8:46 PM Alvaro Herrera wrote: > > > diff --git a/doc/src/sgml/logical-replication.sgml > > b/doc/src/sgml/logical-replication.sgml > > index 1ae3287..0ab768d 100644 > > --- a/doc/src/sgml/logical-replication.sgml > > +++ b/doc/src/sgml/logical-replication.sgml > > @@

RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2022-09-19 Thread kuroda.hay...@fujitsu.com
Dear Önder, Thanks for updating the patch! I will check it later. Currently I just reply to your comments. > Hmm, I couldn't realize this comment earlier. So you suggest "slow" here > refers to the additional function call "GetRelationIdentityOrPK"? If so, yes > I'll update that. Yes I meant

Re: Refactor backup related code (was: Is it correct to say, "invalid data in file \"%s\"", BACKUP_LABEL_FILE in do_pg_backup_stop?)

2022-09-19 Thread Michael Paquier
On Mon, Sep 19, 2022 at 06:26:34PM +0530, Bharath Rupireddy wrote: > On Mon, Sep 19, 2022 at 2:38 PM Fujii Masao > wrote: > Fixed. I believed that the regression tests cover pg_backup_start() > and pg_backup_stop(), and relied on make check-world, surprisingly > there's no test that covers these

Re: pg_create_logical_replication_slot argument incongruency

2022-09-19 Thread Michael Paquier
On Mon, Sep 19, 2022 at 07:02:16PM +0200, Florin Irion wrote: > This was introduced in commit 19890a06. > > IMHO we should use the documented argument name `two_phase` and change the > function to accept it. > > What do you think? 19890a0 is included in REL_14_STABLE, and changing an argument

Re: pg_upgrade test failure

2022-09-19 Thread Justin Pryzby
On Mon, Sep 19, 2022 at 02:32:17PM -0700, Andres Freund wrote: > Hi, > > After my last rebase of the meson tree I encountered the following test > failure: > > https://cirrus-ci.com/task/5532444261613568 > > [20:23:04.171] - 8< >

Re: pg_upgrade test failure

2022-09-19 Thread Michael Paquier
On Mon, Sep 19, 2022 at 06:13:17PM -0700, Andres Freund wrote: > I don't really see what'd race with what here? pg_upgrade has precise control > over what's happening here, no? A code path could have forgotten a fclose() for example, but this code is rather old and close-proof as far as I know.

Re: Reducing the chunk header sizes on all memory context types

2022-09-19 Thread Tom Lane
David Rowley writes: > Aside from that, I don't have any ideas on how to get rid of the > possible additional datumCopy() from non-Var arguments to these window > functions. Should we just suffer it? It's quite likely that most > arguments to these functions are plain Vars anyway. No, we

Re: pg_upgrade test failure

2022-09-19 Thread Andres Freund
Hi, On 2022-09-20 10:08:41 +0900, Michael Paquier wrote: > On Mon, Sep 19, 2022 at 02:32:17PM -0700, Andres Freund wrote: > > I don't know if actually related to the commit below, but there've been a > > lot of runs of the pg_upgrade tests in the meson branch, and this is the > > first > >

Re: Reducing the chunk header sizes on all memory context types

2022-09-19 Thread David Rowley
On Tue, 13 Sept 2022 at 20:27, David Rowley wrote: > I see that one of the drawbacks from not using MemoryContextContains() > is that window functions such as lead(), lag(), first_value(), > last_value() and nth_value() may now do the datumCopy() when it's not > needed. For example, with a window

Re: pg_upgrade test failure

2022-09-19 Thread Michael Paquier
On Mon, Sep 19, 2022 at 02:32:17PM -0700, Andres Freund wrote: > I don't know if actually related to the commit below, but there've been a > lot of runs of the pg_upgrade tests in the meson branch, and this is the first > failure of this kind. Unfortunately the error seems to be transient - >

Re: Support tls-exporter as channel binding for TLSv1.3

2022-09-19 Thread Michael Paquier
On Mon, Sep 19, 2022 at 09:27:41AM -0700, Jacob Champion wrote: > While looking into this I noticed that I left the following code in place: > >> #ifdef HAVE_BE_TLS_GET_CERTIFICATE_HASH >> if (strcmp(selected_mech, SCRAM_SHA_256_PLUS_NAME) == 0 && >> port->ssl_in_use) > > In other words,

Re: Support pg_attribute_aligned and noreturn in MSVC

2022-09-19 Thread James Coleman
On Mon, Sep 19, 2022 at 8:21 PM Michael Paquier wrote: > > On Mon, Sep 19, 2022 at 06:21:58PM -0400, James Coleman wrote: > > It turns out that MSVC supports both noreturn [2] [3] and alignment > > [4] [5] attributes, so this patch adds support for those. MSVC also > > supports a form of packing,

Re: Support pg_attribute_aligned and noreturn in MSVC

2022-09-19 Thread Michael Paquier
On Mon, Sep 19, 2022 at 06:21:58PM -0400, James Coleman wrote: > It turns out that MSVC supports both noreturn [2] [3] and alignment > [4] [5] attributes, so this patch adds support for those. MSVC also > supports a form of packing, but the implementation as I can tell > requires wrapping the

Proposal to use JSON for Postgres Parser format

2022-09-19 Thread Michel Pelletier
Hello hackers, As noted in the source: https://github.com/postgres/postgres/blob/master/src/include/nodes/pg_list.h#L6-L11 * Once upon a time, parts of Postgres were written in Lisp and used real * cons-cell lists for major data structures. When that code was rewritten * in C, we initially

Re: Silencing the remaining clang 15 warnings

2022-09-19 Thread Tom Lane
Thomas Munro writes: > On Tue, Sep 20, 2022 at 7:20 AM Tom Lane wrote: >> * xlog.c's AdvanceXLInsertBuffer has a local variable "npages" >> that is only read in the "#ifdef WAL_DEBUG" stanza at the >> bottom. Here I've done the rather ugly and brute-force thing >> of wrapping all the variable's

Re: Silencing the remaining clang 15 warnings

2022-09-19 Thread Thomas Munro
On Tue, Sep 20, 2022 at 7:20 AM Tom Lane wrote: > * With %pure-parser, Bison makes the "yynerrs" variable local > instead of static, and then if you don't use it clang notices > that it's set but never read. There doesn't seem to be a way > to persuade Bison not to emit the variable at all, so

Support pg_attribute_aligned and noreturn in MSVC

2022-09-19 Thread James Coleman
Over in the "Add last commit LSN to pg_last_committed_xact()" [1] thread this patch had been added as a precursor, but Michael Paquier suggested it be broken out separately, so I'm doing that here. It turns out that MSVC supports both noreturn [2] [3] and alignment [4] [5] attributes, so this

Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures

2022-09-19 Thread Nathan Bossart
On Mon, Sep 19, 2022 at 07:26:57PM +0530, Bharath Rupireddy wrote: > We have a bunch of messages [1] that have an offset, but not LSN in > the error message. Firstly, is there an easiest way to figure out LSN > from offset reported in the error messages? If not, is adding LSN to > these messages

pg_upgrade test failure

2022-09-19 Thread Andres Freund
Hi, After my last rebase of the meson tree I encountered the following test failure: https://cirrus-ci.com/task/5532444261613568 [20:23:04.171] - 8< - [20:23:04.171] stderr: [20:23:04.171] # Failed test

Re: POC: GROUP BY optimization

2022-09-19 Thread David Rowley
On Wed, 13 Jul 2022 at 15:37, David Rowley wrote: > I'm just in this general area of the code again today and wondered > about the header comment for the preprocess_groupclause() function. > > It says: > > * In principle it might be interesting to consider other orderings of the > * GROUP BY

Re: Kerberos delegation support in libpq and postgres_fdw

2022-09-19 Thread Jacob Champion
On 9/19/22 10:05, Stephen Frost wrote: > This is coming across as if it's a surprise of some kind when it > certainly isn't.. If the delegated credentials are being used to > authenticate and establish the connection from that backend to another > system then, yes, naturally that means that the

Re: why can't a table be part of the same publication as its schema

2022-09-19 Thread Jonathan S. Katz
On 9/19/22 11:16 AM, Alvaro Herrera wrote: diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml index 1ae3287..0ab768d 100644 --- a/doc/src/sgml/logical-replication.sgml +++ b/doc/src/sgml/logical-replication.sgml @@ -1120,6 +1120,11 @@ test_sub=# SELECT

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-09-19 Thread Dmitry Koval
Thanks for comments and advice! I thought about this problem and discussed about it with colleagues. Unfortunately, I don't know of a good general solution. 19.09.2022 22:56, Robert Haas пишет: If you know that a certain partition is not changing, and you would like to split it, you can create

Re: Fix typos in code comments

2022-09-19 Thread David Rowley
On Mon, 19 Sept 2022 at 23:10, Justin Pryzby wrote: > Find below some others. Thanks. Pushed. David

Re: Consider parallel for lateral subqueries with limit

2022-09-19 Thread Robert Haas
On Mon, Sep 19, 2022 at 3:58 PM James Coleman wrote: > But in the case where there's correlation via LATERAL we already don't > guarantee unique executions for a given set of params into the lateral > subquery execution, right? For example, suppose we have: > > select * > from foo > left

Re: Consider parallel for lateral subqueries with limit

2022-09-19 Thread James Coleman
On Tue, Mar 1, 2022 at 5:35 PM Tom Lane wrote: > > But more generally, I don't think you've addressed the fundamental > concern, which is that a query involving Limit is potentially > nondeterministic (if it lacks a fully-deterministic ORDER BY), > so that different workers could get different

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2022-09-19 Thread Robert Haas
On Tue, May 31, 2022 at 5:33 AM Dmitry Koval wrote: > There are not many commands in PostgreSQL for working with partitioned > tables. This is an obstacle to their widespread use. > Adding SPLIT PARTITION/MERGE PARTITIONS operations can make easier to > use partitioned tables in PostgreSQL. >

Re: has_privs_of_role vs. is_member_of_role, redux

2022-09-19 Thread Robert Haas
On Thu, Sep 8, 2022 at 1:06 PM wrote: > A different line of thought (compared to the "USAGE" privilege I > discussed earlier), would be: > To transfer ownership of an object, you need two sets of privileges: > - You need to have the privilege to initiate a request to transfer > ownership. > - You

Silencing the remaining clang 15 warnings

2022-09-19 Thread Tom Lane
While working on the -Wdeprecated-non-prototype fixups discussed nearby, I saw that clang 15.0 produces a few other new warnings (which are also visible in the buildfarm). Pursuant to our usual policy that we should suppress warnings on compilers likely to be used for development, here's a patch

Re: has_privs_of_role vs. is_member_of_role, redux

2022-09-19 Thread Robert Haas
On Fri, Aug 26, 2022 at 10:11 AM Robert Haas wrote: > Here's a small patch. Despite the small size of the patch, there are a > couple of debatable points here: Nobody's commented on this patch specifically, but it seemed like we had consensus that ALTER DEFAULT PRIVILEGES was doing The Wrong

Re: Tree-walker callbacks vs -Wdeprecated-non-prototype

2022-09-19 Thread Robert Haas
On Sun, Sep 18, 2022 at 4:58 PM Tom Lane wrote: > BTW, I was distressed to discover that someone decided they could > use ExecShutdownNode as a planstate_tree_walker() walker even though > its argument list is not even the right length. I'm a bit flabbergasted > that we seem to have gotten away

Re: Tree-walker callbacks vs -Wdeprecated-non-prototype

2022-09-19 Thread Tom Lane
Here's a second-generation patch that fixes the warnings by inserting casts into a layer of macro wrappers. I had supposed that this would cause us to lose all detection of wrongly-chosen walker functions, so I was very pleased to see this when applying it to yesterday's HEAD:

Re: walmethods.c/h are doing some strange things

2022-09-19 Thread Robert Haas
On Thu, Sep 15, 2022 at 9:39 PM Kyotaro Horiguchi wrote: > At Fri, 2 Sep 2022 11:52:38 -0400, Robert Haas wrote > in > > that type that can ever exist, and the pointer to that object is > > stored in a global variable managed by walmethods.c. So whereas in > > other cases we give you the object

Re: Kerberos delegation support in libpq and postgres_fdw

2022-09-19 Thread Stephen Frost
Greetings, * Jacob Champion (jchamp...@timescale.com) wrote: > On Thu, Jul 7, 2022 at 4:24 PM Jacob Champion wrote: > > So my question is this: does substituting my credentials for the admin's > > credentials let me weaken or break the transport encryption on the > > backend connection, and grab

pg_create_logical_replication_slot argument incongruency

2022-09-19 Thread Florin Irion
Hello, The function `pg_create_logical_replication_slot()` is documented to have a `two_phase` argument(note the underscore), but the function instead requires `twophase`. ``` \df pg_catalog.pg_create_logical_replication_slot List of functions -[ RECORD 1

Re: remove more archiving overhead

2022-09-19 Thread Robert Haas
On Mon, Sep 19, 2022 at 10:39 AM Noah Misch wrote: > I wanted it to stop saying anything like the second paragraph, hence commit > d263ced. Implementing a proper archiving setup is not especially difficult, > and inviting the operator to work around a wrong implementation invites > damaging

Re: remove more archiving overhead

2022-09-19 Thread Robert Haas
On Mon, Sep 19, 2022 at 6:08 AM Peter Eisentraut wrote: > I suspect what we are really trying to say here is > > === > Archiving setups (using either archive_command or archive_library) > should be prepared for the rare case that an identical archive file is > being archived a second time. In

Re: HOT chain validation in verify_heapam()

2022-09-19 Thread Aleksander Alekseev
Hi Himanshu, > I have changed this in the attached patch. If it's not too much trouble could you please base your changes on v4 that I submitted? I put some effort into writing a proper commit message, editing the comments, etc. The easiest way of doing this is using `git am` and `git

Re: Free list same_input_transnos in preprocess_aggref

2022-09-19 Thread Zhang Mingli
Regards, Zhang Mingli On Sep 20, 2022, 00:27 +0800, Zhang Mingli , wrote: > > SaveBytes = Sum results of accumulate_list_size: 32(4+4+8+8), as we have 5 > aggs in sql Correction: SaveBytes = Sum results of accumulate_list_size: 24(4+4+8+8),

Re: Support tls-exporter as channel binding for TLSv1.3

2022-09-19 Thread Jacob Champion
On Wed, Sep 7, 2022 at 10:03 AM Jacob Champion wrote: > Yeah, that should be fine. Requiring newer OpenSSLs for stronger > crypto will probably be uncontroversial. While looking into this I noticed that I left the following code in place: > #ifdef HAVE_BE_TLS_GET_CERTIFICATE_HASH > if

Tab complete for CREATE SUBSCRIPTION ... CONECTION does not work

2022-09-19 Thread Japin Li
Hi hacker, As $subject detailed, the tab-complete cannot work such as: CREATE SUBSCRIPTION sub CONNECTION 'dbname=postgres port=6543' \t It seems that the get_previous_words() could not parse the single quote. OTOH, it works for CREATE SUBSCRIPTION sub CONNECTION xx \t, should we fix it?

Re: Free list same_input_transnos in preprocess_aggref

2022-09-19 Thread Zhang Mingli
Regards, Zhang Mingli On Sep 19, 2022, 23:14 +0800, Tom Lane , wrote: > Very little of the planner bothers with freeing small allocations > like that. I think so too, as said, not sure if it worths. > Can you demonstrate a case where this would actually > make a meaningful difference? Offhand, an

Re: HOT chain validation in verify_heapam()

2022-09-19 Thread Himanshu Upadhyaya
On Mon, Sep 19, 2022 at 8:27 PM Aleksander Alekseev < aleksan...@timescale.com> wrote: > Hi Himanshu, > > > Done, updated in the v3 patch. > > Thanks for the updated patch. > > Here is v4 with fixed compiler warnings and some minor tweaks from me. > > I didn't put too much thought into the

Re: START_REPLICATION SLOT causing a crash in an assert build

2022-09-19 Thread Jaime Casanova
On Fri, Sep 16, 2022 at 02:37:17PM +0900, Kyotaro Horiguchi wrote: > At Thu, 15 Sep 2022 11:15:12 -0500, Jaime Casanova > wrote in > > It fails at ./src/backend/utils/activity/pgstat_shmem.c:530 inside > > Thanks for the info. I reproduced by make check.. stupid.. > > It's the thinko about

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2022-09-19 Thread Önder Kalacı
Hi Peter, Thanks again for the review, see my comments below: > > == > > 1. Commit message > > It is often not feasible to use `REPLICA IDENTITY FULL` on the publication > because it leads to full table scan per tuple change on the subscription. > This makes `REPLICA IDENTITY FULL`

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2022-09-19 Thread Önder Kalacı
Hi Hayato Kuroda, Thanks for the review, please see my reply below: > === > For execRelation.c > > 01. RelationFindReplTupleByIndex() > > ``` > /* Start an index scan. */ > InitDirtySnapshot(snap); > - scan = index_beginscan(rel, idxrel, , > - >

Re: Pruning never visible changes

2022-09-19 Thread Matthias van de Meent
On Mon, 19 Sept 2022 at 01:16, Greg Stark wrote: > > On Fri, 16 Sept 2022 at 10:27, Tom Lane wrote: > > > > Simon Riggs writes: > > > A user asked me whether we prune never visible changes, such as > > > BEGIN; > > > INSERT... > > > UPDATE.. (same row) > > > COMMIT; > > > > Didn't we just have

Re: why can't a table be part of the same publication as its schema

2022-09-19 Thread Alvaro Herrera
> diff --git a/doc/src/sgml/logical-replication.sgml > b/doc/src/sgml/logical-replication.sgml > index 1ae3287..0ab768d 100644 > --- a/doc/src/sgml/logical-replication.sgml > +++ b/doc/src/sgml/logical-replication.sgml > @@ -1120,6 +1120,11 @@ test_sub=# SELECT * FROM child ORDER BY a; > >

Re: Free list same_input_transnos in preprocess_aggref

2022-09-19 Thread Tom Lane
Zhang Mingli writes: > In preprocess_aggref(), list same_input_transnos is used to track compatible > transnos. > Free it if we don’t need it anymore. Very little of the planner bothers with freeing small allocations like that. Can you demonstrate a case where this would actually make a

Re: HOT chain validation in verify_heapam()

2022-09-19 Thread Aleksander Alekseev
Hi Himanshu, > Done, updated in the v3 patch. Thanks for the updated patch. Here is v4 with fixed compiler warnings and some minor tweaks from me. I didn't put too much thought into the algorithm but I already see something strange. At verify_heapam.c:553 you declared curr_xmax and next_xmin.

Re: remove more archiving overhead

2022-09-19 Thread David Steele
On 9/19/22 07:39, Noah Misch wrote: On Mon, Sep 19, 2022 at 06:08:29AM -0400, Peter Eisentraut wrote: On 18.09.22 09:13, Noah Misch wrote: This documentation change only covers archive_library. How are users of archive_command supposed to handle this? I believe users of archive_command

Re:Ubuntu 16.04: Xenial: Why was it removed from the apt repo?

2022-09-19 Thread Sergei Kornilov
Hi Ubuntu 16.04 is EOL from April 2021, over a year ago. https://wiki.postgresql.org/wiki/Apt/FAQ#Where_are_older_versions_of_the_packages.3F regards, Sergei

Re: Ubuntu 16.04: Xenial: Why was it removed from the apt repo?

2022-09-19 Thread Magnus Hagander
Hello! Because it has been removed and moved to the archives, as per the warning from early July. See https://www.postgresql.org/message-id/flat/YsV8fmomNNC%2BGpIR%40msg.credativ.de //Magnus On Mon, Sep 19, 2022 at 4:46 PM Larry Rosenman wrote: > > All of a sudden I'm getting repo not found

binary version of pg_current_wal_insert_lsn and pg_walfile_name functions

2022-09-19 Thread Ashutosh Sharma
Hi All, Currently, we have pg_current_wal_insert_lsn and pg_walfile_name sql functions which gives us information about the next wal insert location and the WAL file that the next wal insert location belongs to. Can we have a binary version of these sql functions? It would be like any other

Ubuntu 16.04: Xenial: Why was it removed from the apt repo?

2022-09-19 Thread Larry Rosenman
All of a sudden I'm getting repo not found for Ubuntu 16.04 LTS on the APT repo. Why? -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: l...@lerctr.org US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106

Re: remove more archiving overhead

2022-09-19 Thread Noah Misch
On Mon, Sep 19, 2022 at 06:08:29AM -0400, Peter Eisentraut wrote: > On 18.09.22 09:13, Noah Misch wrote: > >>>This documentation change only covers archive_library. How are users of > >>>archive_command supposed to handle this? > >> > >>I believe users of archive_command need to do something

Re: confirmed_flush_lsn shows LSN of the data that has not yet been received by the logical subscriber.

2022-09-19 Thread Ashutosh Sharma
On Mon, Sep 19, 2022 at 5:24 PM Ashutosh Bapat wrote: > > On Mon, Sep 19, 2022 at 1:43 PM Ashutosh Sharma wrote: > > > > On Fri, Sep 9, 2022 at 5:36 PM Ashutosh Bapat > > wrote: > > > > > > On Thu, Sep 8, 2022 at 8:32 PM Ashutosh Sharma > > > wrote: > > > > > > > > On Thu, Sep 8, 2022 at 6:23

Re: Switching XLog source from archive to streaming when primary available

2022-09-19 Thread Bharath Rupireddy
On Fri, Sep 16, 2022 at 4:58 PM Bharath Rupireddy wrote: > > On Fri, Sep 16, 2022 at 12:06 PM Kyotaro Horiguchi > wrote: > > > > In other words, it seems to me that the macro name doesn't manifest > > the condition correctly. > > > > I don't think we don't particularly want to do that

Re: cataloguing NOT NULL constraints

2022-09-19 Thread Matthias van de Meent
On Mon, 19 Sept 2022 at 15:32, Robert Haas wrote: > > On Wed, Aug 17, 2022 at 2:12 PM Alvaro Herrera > wrote: > > If you say CREATE TABLE (a int NOT NULL), you'll get a CHECK constraint > > printed by psql: (this is a bit more noisy that previously and it > > changes a lot of regression tests

Re: cataloguing NOT NULL constraints

2022-09-19 Thread Tom Lane
Isaac Morland writes: > I thought I saw some discussion about the SQL standard saying that there is > a difference between putting NOT NULL in a column definition, and CHECK > (column_name NOT NULL). So if we're going to take this seriously, I think > that means there needs to be a field in

Re: Tree-walker callbacks vs -Wdeprecated-non-prototype

2022-09-19 Thread Tom Lane
Thomas Munro writes: > On Mon, Sep 19, 2022 at 10:16 AM Thomas Munro wrote: >> Huh... wouldn't systems that pass arguments right-to-left on the stack >> receive NULL for node? That'd include the SysV i386 convention used >> on Linux, *BSD etc. But that can't be right or we'd know about it...

Add LSN along with offset to error messages reported for WAL file read/write/validate header failures

2022-09-19 Thread Bharath Rupireddy
Hi, I was recently asked about converting an offset reported in WAL read error messages[1] to an LSN with which pg_waldump can be used to verify the records or WAL file around that LSN (basically one can filter out the output based on LSN). AFAICS, there's no function that takes offset as an

Re: cataloguing NOT NULL constraints

2022-09-19 Thread Isaac Morland
On Mon, 19 Sept 2022 at 09:32, Robert Haas wrote: > On Wed, Aug 17, 2022 at 2:12 PM Alvaro Herrera > wrote: > > If you say CREATE TABLE (a int NOT NULL), you'll get a CHECK constraint > > printed by psql: (this is a bit more noisy that previously and it > > changes a lot of regression tests

Re: cataloguing NOT NULL constraints

2022-09-19 Thread Robert Haas
On Wed, Aug 17, 2022 at 2:12 PM Alvaro Herrera wrote: > If you say CREATE TABLE (a int NOT NULL), you'll get a CHECK constraint > printed by psql: (this is a bit more noisy that previously and it > changes a lot of regression tests output). > > 55489 16devel 1776237=# create table tab (a int not

pgstat: stats added in ReadPageInternal() aren't getting reported via pg_stat_wal

2022-09-19 Thread Bharath Rupireddy
Hi, I added xlogreader cache stats (hits/misses) to pg_stat_wal in ReadPageInternal() for some of my work and ran some tests with logical replication subscribers. I had expected that the new stats generated by walsenders serving the subscribers would be accumulated and shown via pg_stat_wal view

Re: Refactor backup related code (was: Is it correct to say, "invalid data in file \"%s\"", BACKUP_LABEL_FILE in do_pg_backup_stop?)

2022-09-19 Thread Bharath Rupireddy
On Mon, Sep 19, 2022 at 2:38 PM Fujii Masao wrote: > > Thanks for updating the patch! > > =# SELECT * FROM pg_backup_start('test', true); > =# SELECT * FROM pg_backup_stop(); > LOG: server process (PID 15651) was terminated by signal 11: Segmentation > fault: 11 > DETAIL: Failed process was

Re: confirmed_flush_lsn shows LSN of the data that has not yet been received by the logical subscriber.

2022-09-19 Thread Ashutosh Bapat
On Mon, Sep 19, 2022 at 1:43 PM Ashutosh Sharma wrote: > > On Fri, Sep 9, 2022 at 5:36 PM Ashutosh Bapat > wrote: > > > > On Thu, Sep 8, 2022 at 8:32 PM Ashutosh Sharma > > wrote: > > > > > > On Thu, Sep 8, 2022 at 6:23 PM Ashutosh Bapat > > > wrote: > > > > > > > > On Thu, Sep 8, 2022 at

Re: cataloguing NOT NULL constraints

2022-09-19 Thread Alvaro Herrera
On 2022-Sep-14, Peter Eisentraut wrote: > Reading through the SQL standard again, I think this patch goes a bit too > far in folding NOT NULL and CHECK constraints together. The spec says that > you need to remember whether a column was defined as NOT NULL, and that the > commands DROP NOT NULL

Re: Fix typos in code comments

2022-09-19 Thread Justin Pryzby
On Mon, Sep 19, 2022 at 02:44:12AM +, houzj.f...@fujitsu.com wrote: > While working on some other patches, I found serval typos(duplicate words and > incorrect function name reference) in the code comments. Here is a small patch > to fix them. Thanks. On Mon, Sep 19, 2022 at 11:05:24AM

Re: RFC: Logging plan of the running query

2022-09-19 Thread a.rybakina
Hi, I'm sorry,if this message is duplicated previous this one, but the previous message is sent incorrectly. I sent it from email address lena.riback...@yandex.ru. I liked this idea and after reviewing code I noticed some moments and I'd rather ask you some questions. Firstly, I suggest

Free list same_input_transnos in preprocess_aggref

2022-09-19 Thread Zhang Mingli
Hi, In preprocess_aggref(), list same_input_transnos is used to track compatible transnos. Free it if we don’t need it anymore. ``` /*  * 2. See if this aggregate can share transition state with another  * aggregate that we've initialized already.  */  transno = find_compatible_trans(root,

  1   2   >