Re: Handle infinite recursion in logical replication setup

2022-03-07 Thread Amit Kapila
On Tue, Mar 8, 2022 at 12:17 PM Peter Smith wrote: > > On Tue, Mar 8, 2022 at 4:21 PM Amit Kapila wrote: > > > > On Tue, Mar 8, 2022 at 10:31 AM Peter Smith wrote: > > > > > > IIUC the new option may be implemented subscriber-side and/or > > > publisher-side and/or both, and the subscriber-side

Re: Logical replication timeout problem

2022-03-07 Thread Masahiko Sawada
Hi, On Tue, Mar 8, 2022 at 10:25 AM wangw.f...@fujitsu.com wrote: > > On Fri, Mar 4, 2022 at 4:26 PM Kuroda, Hayato/黒田 隼人 > wrote: > > > Thanks for your test and comments. > > > Some codes were added in ReorderBufferProcessTXN() for treating DDL, > > but I doubted updating accept_writes is need

Re: Handle infinite recursion in logical replication setup

2022-03-07 Thread Peter Smith
On Tue, Mar 8, 2022 at 4:21 PM Amit Kapila wrote: > > On Tue, Mar 8, 2022 at 10:31 AM Peter Smith wrote: > > > > IIUC the new option may be implemented subscriber-side and/or > > publisher-side and/or both, and the subscriber-side option may be > > "enhanced" in future to prevent cycles. And prob

Re: Adding CI to our tree (ccache)

2022-03-07 Thread Justin Pryzby
On Mon, Mar 07, 2022 at 11:10:54AM -0800, Andres Freund wrote: > On 2022-03-06 10:16:54 -0600, Justin Pryzby wrote: > > On Fri, Mar 04, 2022 at 05:30:03PM -0800, Andres Freund wrote: > > > I tried to use it, but saw that no caching was happening, and debugged > > > it. Which yielded that it can't b

Re: Add index scan progress to pg_stat_progress_vacuum

2022-03-07 Thread Masahiko Sawada
On Thu, Mar 3, 2022 at 2:08 PM Imseih (AWS), Sami wrote: > > >>> If the failsafe kicks in midway through a vacuum, the number > > indexes_total will not be reset to 0. If INDEX_CLEANUP is turned off, then > > the value will be 0 at the start of the vacuum. > >> > >> The way that this

Re: Optionally automatically disable logical replication subscriptions on error

2022-03-07 Thread Amit Kapila
On Tue, Mar 8, 2022 at 9:37 AM Peter Smith wrote: > > Please find below some review comments for v29. > > == > > 1. src/backend/replication/logical/worker.c - worker_post_error_processing > > +/* > + * Abort and cleanup the current transaction, then do post-error processing. > + * This functio

Re: Comment typo in CheckCmdReplicaIdentity

2022-03-07 Thread Peter Smith
On Tue, Mar 8, 2022 at 4:31 PM Michael Paquier wrote: > > On Mon, Mar 07, 2022 at 10:28:08AM +0800, Julien Rouhaud wrote: > > +1 > > And done. > -- > Michael Thanks! -- Kind Regards, Peter Smith. Fujitsu Australia

Re: Comment typo in CheckCmdReplicaIdentity

2022-03-07 Thread Michael Paquier
On Mon, Mar 07, 2022 at 10:28:08AM +0800, Julien Rouhaud wrote: > +1 And done. -- Michael signature.asc Description: PGP signature

Re: Handle infinite recursion in logical replication setup

2022-03-07 Thread Amit Kapila
On Tue, Mar 8, 2022 at 10:31 AM Peter Smith wrote: > > IIUC the new option may be implemented subscriber-side and/or > publisher-side and/or both, and the subscriber-side option may be > "enhanced" in future to prevent cycles. And probably there are more > features I don't know about or that have

Re: Make relfile tombstone files conditional on WAL level

2022-03-07 Thread Dilip Kumar
On Tue, Mar 8, 2022 at 1:27 AM Robert Haas wrote: > > The only part I do not like in the patch is that before this patch we > > could directly access the buftag->rnode. But since now we are not > > having directly relfilenode as part of the buffertag and instead of > > that we are keeping indivi

Re: Handle infinite recursion in logical replication setup

2022-03-07 Thread Peter Smith
IIUC the new option may be implemented subscriber-side and/or publisher-side and/or both, and the subscriber-side option may be "enhanced" in future to prevent cycles. And probably there are more features I don't know about or that have not yet been thought of. ~~ Even if the plan is only to impl

Re: Time to drop plpython2?

2022-03-07 Thread Andres Freund
Hi, On 2022-03-07 23:39:39 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2022-03-07 20:11:52 -0500, Tom Lane wrote: > >> This version seems ready-to-go to me, or at least ready to see > >> what the buildfarm makes of it. > > > Pushed. Let's see... > > wrasse says you were too quick to d

Re: Time to drop plpython2?

2022-03-07 Thread Tom Lane
Andres Freund writes: > On 2022-03-07 20:11:52 -0500, Tom Lane wrote: >> This version seems ready-to-go to me, or at least ready to see >> what the buildfarm makes of it. > Pushed. Let's see... wrasse says you were too quick to drop plpython_error_5.out. Otherwise looks pretty good so far.

Re: role self-revocation

2022-03-07 Thread Mark Dilger
> On Mar 7, 2022, at 12:16 PM, Tom Lane wrote: > > What would be > lost if we drop it? I looked into this a bit. Removing that bit of code, the only regression test changes for "check-world" are the expected ones, with nothing else breaking. Running installcheck+pg_upgrade to the patched v

Re: Optionally automatically disable logical replication subscriptions on error

2022-03-07 Thread Peter Smith
Please find below some review comments for v29. == 1. src/backend/replication/logical/worker.c - worker_post_error_processing +/* + * Abort and cleanup the current transaction, then do post-error processing. + * This function must be called in a PG_CATCH() block. + */ +static void +worker_po

Re: Logical replication timeout problem

2022-03-07 Thread Ajin Cherian
On Tue, Mar 8, 2022 at 12:25 PM wangw.f...@fujitsu.com wrote: > Attach the new patch. > 1. Fix wrong variable setting and skip unnecessary time records.[suggestion > by Kuroda-San and me.] > 2. Introduce version information.[suggestion by Peter, Kuroda-San] > > Regards, > Wang wei Some comments.

Re: Expose JIT counters/timing in pg_stat_statements

2022-03-07 Thread Julien Rouhaud
On Mon, Mar 07, 2022 at 01:40:34PM +0100, Magnus Hagander wrote: > > I wonder if there might be an interesting middle ground, or if that is > making it too much. That is, we could have an > Option 3: > jit_count > total_jit_time - for sum of functions+inlining+optimization+emission time > min_jit_t

Re: pg_tablespace_location() failure with allow_in_place_tablespaces

2022-03-07 Thread Kyotaro Horiguchi
At Tue, 8 Mar 2022 10:28:46 +0900, Michael Paquier wrote in > On Tue, Mar 08, 2022 at 10:06:50AM +0900, Kyotaro Horiguchi wrote: > > At Tue, 8 Mar 2022 10:39:06 +1300, Thomas Munro > > wrote in > >> Thanks, you're right. Test on a Win10 VM. Here's a new version. > > Looks fine to me. > >

Re: [RFC] building postgres with meson

2022-03-07 Thread Andres Freund
On 2022-03-07 09:58:41 -0800, Andres Freund wrote: > On 2022-03-07 14:56:24 +0100, Peter Eisentraut wrote: > > Is there a current patch set to review in this thread at the moment? > > I've been regularly rebasing and improving the patchset, but didn't post to > the thread about it most of the time

Re: [RFC] building postgres with meson -v6

2022-03-07 Thread Andres Freund
Hi, Attached is v6 of the meson patchset. There are a lots of changes since the last version posted. These include: - python2 removal is now committed, so not needed in here anymore - CI changed to be based on the CI now merged into postgres - CI also tests suse, rhel, fedora (Nazir Bilal Yavuz).

Re: Time to drop plpython2?

2022-03-07 Thread Andres Freund
On 2022-03-07 20:11:52 -0500, Tom Lane wrote: > This version seems ready-to-go to me, or at least ready to see > what the buildfarm makes of it. Pushed. Let's see...

Re: refreshing query id for pg_stat_statements based on comment in sql

2022-03-07 Thread Julien Rouhaud
Hi, On Mon, Mar 07, 2022 at 09:42:26AM -0800, Zhihong Yu wrote: > Hi, > Currently the query id for pg_stat_statements gets calculated based on the > parse nodes specifics. > This means that the user cannot add a comment to a SQL query to test > something. (though some other RDBMS allows this pract

Re: pg_tablespace_location() failure with allow_in_place_tablespaces

2022-03-07 Thread Michael Paquier
On Tue, Mar 08, 2022 at 10:06:50AM +0900, Kyotaro Horiguchi wrote: > At Tue, 8 Mar 2022 10:39:06 +1300, Thomas Munro > wrote in >> Thanks, you're right. Test on a Win10 VM. Here's a new version. Looks fine to me. > FYI, on Windows11, pg_basebackup didn't work correctly without the > patch.

RE: Logical replication timeout problem

2022-03-07 Thread wangw.f...@fujitsu.com
On Fri, Mar 4, 2022 at 4:26 PM Kuroda, Hayato/黒田 隼人 wrote: > Thanks for your test and comments. > Some codes were added in ReorderBufferProcessTXN() for treating DDL, > but I doubted updating accept_writes is needed. > IMU, the parameter is read by OutputPluginPrepareWrite() in order align > mes

Re: make tuplestore helper function

2022-03-07 Thread Michael Paquier
On Mon, Mar 07, 2022 at 05:09:19PM -0500, Melanie Plageman wrote: > I've attached a patch using the helper in most locations in contrib > modules that seemed useful. Thanks for the patch. I was also looking at that yesterday, and this pretty much maps to what I have finished with, except for dbli

Re: Time to drop plpython2?

2022-03-07 Thread Tom Lane
Andres Freund writes: > A related question is whether we want to remove $(python_majorversion) > references in the makefiles? I wouldn't. I'm doubtful of your theory that there will never be a Python 4. This version seems ready-to-go to me, or at least ready to see what the buildfarm makes of i

Re: pg_tablespace_location() failure with allow_in_place_tablespaces

2022-03-07 Thread Kyotaro Horiguchi
At Tue, 8 Mar 2022 10:39:06 +1300, Thomas Munro wrote in > On Tue, Mar 8, 2022 at 12:58 AM Michael Paquier wrote: > > On Fri, Mar 04, 2022 at 11:26:43PM +1300, Thomas Munro wrote: > > > + /* Skip in-place tablespaces (testing use only) */ > > > + if (get_dirent_type(fullpath, de, false,

Re: refreshing query id for pg_stat_statements based on comment in sql

2022-03-07 Thread Bruce Momjian
On Mon, Mar 7, 2022 at 09:42:26AM -0800, Zhihong Yu wrote: > Hi, > Currently the query id for pg_stat_statements gets calculated based on the > parse nodes specifics.  > This means that the user cannot add a comment to a SQL query to test > something. > (though some other RDBMS allows this practi

Re: Fix overflow in DecodeInterval

2022-03-07 Thread Joseph Koshakow
I just realized another issue today. It may have been obvious from one of Tom's earlier messages, but I'm just now putting the pieces together. On Fri, Feb 18, 2022 at 11:44 PM Tom Lane wrote: > Also, I notice that there's an overflow hazard upstream of here, > in interval2tm: > > regression=# sel

Recovering stat file from crash

2022-03-07 Thread Marek Kulik
Hi, I created a .patch that will allow me to recover the stat files after a potential crash. Depending on the traffic on the server some records might be lost (0.5 sec of records / more or less ? ). >From what I read it is still better than no stat files at all. I restricted it to the default rec

Re: ltree_gist indexes broken after pg_upgrade from 12 to 13

2022-03-07 Thread Alexander Korotkov
On Sun, Mar 6, 2022 at 8:28 PM Tomas Vondra wrote: > On 3/6/22 08:09, Alexander Korotkov wrote: > > Sorry for this terrible oversight by me. > > > > On Sat, Mar 5, 2022 at 10:13 AM Tomas Vondra > > wrote: > >> On 3/4/22 23:09, Nikita Glukhov wrote: > >>> On 04.03.2022 23:28, Tom Lane wrote: > >>>

Re: New developer papercut - Makefile references INSTALL

2022-03-07 Thread Tom Lane
Magnus Hagander writes: > But taking a step back, who is the actual audience for this? Do we > *need* a link pointing directly there, or is it enough to just point > to "use the docs on the web"? We can't link to the incorrect version, > but can we just link to /docs/ and leave it at that? Well,

Re: support for MERGE

2022-03-07 Thread Zhihong Yu
On Mon, Mar 7, 2022 at 12:04 PM Álvaro Herrera wrote: > On Mon, Mar 7, 2022, at 4:59 PM, Álvaro Herrera wrote: > > I attach v13 here. This version includes a 0002 that's does the split of > nodeModifyTable.c routines, then 0003 implements MERGE on top of that. > 0001 is as before. > > > In 0002,

Re: make tuplestore helper function

2022-03-07 Thread Melanie Plageman
On Sun, Mar 6, 2022 at 9:29 PM Michael Paquier wrote: > > On Wed, Mar 02, 2022 at 03:43:17PM +0900, Michael Paquier wrote: > > This is actually setting up a function in the context of a single call > > where we fill the tuplestore with all its values, so instead I have > > settled down to name tha

Re: Doc about how to set max_wal_senders when setting minimal wal_level

2022-03-07 Thread David G. Johnston
On Fri, Mar 4, 2022 at 2:49 AM Japin Li wrote: > Thanks for your review. Modified. > Works for me. I have some additional sparks of ideas but nothing that need hold this up. David J.

Re: Doc about how to set max_wal_senders when setting minimal wal_level

2022-03-07 Thread David G. Johnston
On Thu, Mar 3, 2022 at 11:05 PM Kyotaro Horiguchi wrote: > But, > anyway, IMHO, it is mere a performance tips that is not necessarily > required in this section, or even in this documentaiotn. Addtion to > that, if we write this for max_wal_senders, archive_mode will deserve > the similar tips b

Re: pg_tablespace_location() failure with allow_in_place_tablespaces

2022-03-07 Thread Thomas Munro
On Tue, Mar 8, 2022 at 10:39 AM Thomas Munro wrote: > Test on a Win10 VM. Erm, "Tested" (as in, I tested), I meant to write...

Re: pg_tablespace_location() failure with allow_in_place_tablespaces

2022-03-07 Thread Thomas Munro
On Tue, Mar 8, 2022 at 12:58 AM Michael Paquier wrote: > On Fri, Mar 04, 2022 at 11:26:43PM +1300, Thomas Munro wrote: > > + /* Skip in-place tablespaces (testing use only) */ > > + if (get_dirent_type(fullpath, de, false, ERROR) == PGFILETYPE_DIR) > > + continue; > > I saw the

Re: role self-revocation

2022-03-07 Thread David G. Johnston
On Mon, Mar 7, 2022 at 1:16 PM Tom Lane wrote: > Based on Robert's archaeological dig, it now seems that the fact that > we have any such behavior at all was just a mistake. What would be > lost if we drop it? > Probably nothing that couldn't be replaced, and with a better model, but I do have

Re: logical decoding and replication of sequences

2022-03-07 Thread Tomas Vondra
On 3/7/22 17:53, Tomas Vondra wrote: > On 2/28/22 12:46, Amit Kapila wrote: >> On Sat, Feb 12, 2022 at 6:04 AM Tomas Vondra >> wrote: >>> >>> On 2/10/22 19:17, Tomas Vondra wrote: I've polished & pushed the first part adding sequence decoding infrastructure etc. Attached are the two r

Re: refactoring basebackup.c

2022-03-07 Thread Robert Haas
On Wed, Feb 16, 2022 at 8:46 PM Jeevan Ladhe wrote: > Thanks for the comments Robert. I have addressed your comments in the > attached patch v13-0002-ZSTD-add-server-side-compression-support.patch. > Rest of the patches are similar to v12, but just bumped the version number. OK, here's a consolid

Re: logical decoding and replication of sequences

2022-03-07 Thread Tomas Vondra
On 3/7/22 17:39, Tomas Vondra wrote: > > > On 3/1/22 12:53, Amit Kapila wrote: >> On Mon, Feb 28, 2022 at 5:16 PM Amit Kapila wrote: >>> >>> On Sat, Feb 12, 2022 at 6:04 AM Tomas Vondra >>> wrote: On 2/10/22 19:17, Tomas Vondra wrote: > I've polished & pushed the first part add

Re: New developer papercut - Makefile references INSTALL

2022-03-07 Thread Magnus Hagander
On Mon, Mar 7, 2022 at 4:57 PM Tom Lane wrote: > > Magnus Hagander writes: > > If anything, I'm more behind the idea of just getting rid of the > > INSTALL file. A reference to the install instructions in the README > > should be enough today. The likelihood of somebody getting a postgres > > sou

Re: role self-revocation

2022-03-07 Thread Tom Lane
Mark Dilger writes: >> On Mar 7, 2022, at 12:01 PM, Robert Haas wrote: >> >> It's been pointed out upthread that this would have undesirable >> security implications, because the admin option would be inherited, >> and the implicit permission isn't. > Right, but with a reflexive self-admin-opti

Re: role self-revocation

2022-03-07 Thread Mark Dilger
> On Mar 7, 2022, at 12:03 PM, Mark Dilger wrote: > > Right, but with a reflexive self-admin-option, we could document that it > works in a non-inherited way. We'd just be saying the current hard-coded > behavior is an option which can be revoked rather than something you're stuck > with.

Re: Time to drop plpython2?

2022-03-07 Thread Tom Lane
Andres Freund writes: > Now that the BF has stabilized, I've rebased and cleaned up the patches I'd > posted earlier. Attached for the first time is my attempt at cleaning up the > docs. I looked through this quickly, and have a couple of nitpicks. The PGFILEDESC value for jsonb_plpython is word

Re: support for MERGE

2022-03-07 Thread Álvaro Herrera
On Mon, Mar 7, 2022, at 4:59 PM, Álvaro Herrera wrote: > I attach v13 here. This version includes a 0002 that's does the split of > nodeModifyTable.c routines, then 0003 implements MERGE on top of that. 0001 > is as before. In 0002, I've opted to have two separate structs. One is the ModifyT

Re: role self-revocation

2022-03-07 Thread Mark Dilger
> On Mar 7, 2022, at 12:01 PM, Robert Haas wrote: > > It's been pointed out upthread that this would have undesirable > security implications, because the admin option would be inherited, > and the implicit permission isn't. Right, but with a reflexive self-admin-option, we could document tha

Re: role self-revocation

2022-03-07 Thread Robert Haas
On Mon, Mar 7, 2022 at 2:59 PM Mark Dilger wrote: > This test failure is just a manifestation of the intended change, but > assuming we make no other changes, the error message would clearly need to be > updated, because it suggests the role should have admin_option on itself, a > situation whi

Re: role self-revocation

2022-03-07 Thread Mark Dilger
> On Mar 7, 2022, at 10:28 AM, Tom Lane wrote: > > Does anything interesting break if you do just take it out? SET SESSION AUTHORIZATION regress_priv_group2; GRANT regress_priv_group2 TO regress_priv_user5; -- ok: a role can self-admin -NOTICE: role "regress_priv_user5" is already a member

Re: Make relfile tombstone files conditional on WAL level

2022-03-07 Thread Robert Haas
On Fri, Mar 4, 2022 at 12:37 AM Dilip Kumar wrote: > In this version I have fixed both of these issues. Thanks Robert for > suggesting the solution for both of these problems in our offlist > discussion. Basically, for the first problem we can flush the xlog > immediately because we are actually

Re: Make relfile tombstone files conditional on WAL level

2022-03-07 Thread Robert Haas
On Mon, Feb 21, 2022 at 2:51 AM Dilip Kumar wrote: > While working on this I realized that even if we make the relfilenode > 56 bits we can not remove the loop inside GetNewRelFileNode() for > checking the file existence. Because it is always possible that the > file reaches to the disk even befo

Re: role self-revocation

2022-03-07 Thread Robert Haas
On Mon, Mar 7, 2022 at 2:29 PM David G. Johnston wrote: > You mean the one that was based upon your "ooops"...I discounted that > immediately because members cannot revoke their own membership in a group > unless they were given WITH ADMIN OPTION on that group. Oh, hmm. That example might be ba

Re: role self-revocation

2022-03-07 Thread David G. Johnston
On Mon, Mar 7, 2022 at 11:18 AM Robert Haas wrote: > In terms of how > things work today, see Joshua Brindle's email about the use of groups > in pg_hba.conf. That is an excellent example of how removing oneself > from a group could enable one to bypass security restrictions intended > by the DBA

Re: role self-revocation

2022-03-07 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > I'm not quite following this bit. Where would SET ROLE come into play > > when we're talking about old dump scripts and how the commands in those > > scripts might be interpreted by newer versions of PG..? > > No, the

Re: role self-revocation

2022-03-07 Thread Robert Haas
On Mon, Mar 7, 2022 at 1:58 PM Tom Lane wrote: > Stephen Frost writes: > > I'm not quite following this bit. Where would SET ROLE come into play > > when we're talking about old dump scripts and how the commands in those > > scripts might be interpreted by newer versions of PG..? > > No, the con

Re: role self-revocation

2022-03-07 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > * Tom Lane (t...@sss.pgh.pa.us) wrote: > >> Agreed, this is not something to move on quickly. We might want > >> to think about adjusting pg_dump to use explicit GRANTED BY > >> options in GRANT/REVOKE a release or two

Re: Adding CI to our tree (ccache)

2022-03-07 Thread Andres Freund
Hi, On 2022-03-06 10:16:54 -0600, Justin Pryzby wrote: > On Fri, Mar 04, 2022 at 05:30:03PM -0800, Andres Freund wrote: > > I tried to use it, but saw that no caching was happening, and debugged > > it. Which yielded that it can't be used due to the way output files are > > specified (and due to m

Re: role self-revocation

2022-03-07 Thread Tom Lane
Stephen Frost writes: > I'm not quite following this bit. Where would SET ROLE come into play > when we're talking about old dump scripts and how the commands in those > scripts might be interpreted by newer versions of PG..? No, the concern there is the other way around: what if you take a scri

Re: role self-revocation

2022-03-07 Thread Tom Lane
Stephen Frost writes: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> Agreed, this is not something to move on quickly. We might want >> to think about adjusting pg_dump to use explicit GRANTED BY >> options in GRANT/REVOKE a release or two before making incompatible >> changes. > I'm with Robert on

Re: role self-revocation

2022-03-07 Thread Stephen Frost
Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Sun, Mar 6, 2022 at 11:34 AM Tom Lane wrote: > > I was thinking the former ... however, after a bit of experimentation > > I see that we accept "grant foo to bar granted by baz" a VERY long > > way back, but the "granted by" option for

Re: role self-revocation

2022-03-07 Thread David G. Johnston
On Mon, Mar 7, 2022 at 11:18 AM Robert Haas wrote: > On Sun, Mar 6, 2022 at 11:01 PM David G. Johnston > wrote: > > The example, which you moved here, then attempts to demonstrate this > "fact" but gets it wrong. Boss became a member of peon so if you want to > demonstrate self-administration o

Re: role self-revocation

2022-03-07 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Robert Haas writes: > > 1. What should be the exact rule for whether A can remove a grant made > > by B? Is it has_privs_of_role()? is_member_of_role()? Something else? > > No strong opinion here, but I'd lean slightly to the more restrictive >

Re: role self-revocation

2022-03-07 Thread Robert Haas
On Mon, Mar 7, 2022 at 1:28 PM Tom Lane wrote: > Ugh, I think you are right. It's been a long time of course, but it sure > looks like that was copied-and-pasted without recognizing that it was > wrong in this function because of the need to check the admin_option flag. > And then in the later se

Re: role self-revocation

2022-03-07 Thread Tom Lane
Robert Haas writes: > It appears to me that the actual behavior of having is_admin_of_role() > return true when member == role dates to > f9fd1764615ed5d85fab703b0ffb0c323fe7dfd5 (Tom Lane, 2005). If I'm not > reading this code wrong, prior to that commit, it seems to me that we > only searched th

Re: role self-revocation

2022-03-07 Thread Robert Haas
On Sun, Mar 6, 2022 at 11:01 PM David G. Johnston wrote: > The example, which you moved here, then attempts to demonstrate this "fact" > but gets it wrong. Boss became a member of peon so if you want to > demonstrate self-administration of a role's membership in a different group > you have to

Re: [RFC] building postgres with meson

2022-03-07 Thread Andres Freund
Hi, On 2022-03-07 14:56:24 +0100, Peter Eisentraut wrote: > Is there a current patch set to review in this thread at the moment? I've been regularly rebasing and improving the patchset, but didn't post to the thread about it most of the time. I've just pushed another rebase, will work to squash

Re: role self-revocation

2022-03-07 Thread Robert Haas
On Mon, Mar 7, 2022 at 11:04 AM Tom Lane wrote: > > Is there some use case for the behavior described in that last > > sentence? > > Good question. You might try figuring out when that text was added > and then see if there's relevant discussion in the archives. Apparently the permission used to

Re: [PATCH] minor reloption regression tests improvement

2022-03-07 Thread Nikolay Shaplov
В письме от понедельник, 7 марта 2022 г. 20:04:49 MSK пользователь Greg Stark написал: > I don't think this is worth spending time adding tests for. I get what > you're saying that this is at least semi-intentional behaviour and > desirable behaviour so it should have tests ensuring that it contin

refreshing query id for pg_stat_statements based on comment in sql

2022-03-07 Thread Zhihong Yu
Hi, Currently the query id for pg_stat_statements gets calculated based on the parse nodes specifics. This means that the user cannot add a comment to a SQL query to test something. (though some other RDBMS allows this practice). Consider this use case: for query q, admin looks at stats and perfor

Re: [PATCH] minor reloption regression tests improvement

2022-03-07 Thread Greg Stark
I don't think this is worth spending time adding tests for. I get what you're saying that this is at least semi-intentional behaviour and desirable behaviour so it should have tests ensuring that it continues to work. But it's not documented behaviour and the test is basically testing that the impl

Re: role self-revocation

2022-03-07 Thread David G. Johnston
On Mon, Mar 7, 2022 at 9:04 AM Tom Lane wrote: > Just looking at it now, without having done any historical research, > I wonder why it is that we don't attach significance to WITH ADMIN > OPTION being granted to the role itself. It seems like the second > part of that sentence is effectively sa

Re: logical decoding and replication of sequences

2022-03-07 Thread Tomas Vondra
On 2/28/22 12:46, Amit Kapila wrote: > On Sat, Feb 12, 2022 at 6:04 AM Tomas Vondra > wrote: >> >> On 2/10/22 19:17, Tomas Vondra wrote: >>> I've polished & pushed the first part adding sequence decoding >>> infrastructure etc. Attached are the two remaining parts. >>> >>> I plan to wait a day or

Re: logical decoding and replication of sequences

2022-03-07 Thread Tomas Vondra
On 3/1/22 12:53, Amit Kapila wrote: > On Mon, Feb 28, 2022 at 5:16 PM Amit Kapila wrote: >> >> On Sat, Feb 12, 2022 at 6:04 AM Tomas Vondra >> wrote: >>> >>> On 2/10/22 19:17, Tomas Vondra wrote: I've polished & pushed the first part adding sequence decoding infrastructure etc. Attac

Re: Handle infinite recursion in logical replication setup

2022-03-07 Thread vignesh C
On Mon, Mar 7, 2022 at 5:51 PM Amit Kapila wrote: > > On Mon, Mar 7, 2022 at 5:01 PM Ashutosh Bapat > wrote: > > > > Hi Vignesh, > > I agree with Peter's comment that the changes to > > FilterRemoteOriginData() should be part of FilterByOrigin() > > > > Further, I wonder why "onlylocal_data" is a

Re: New Table Access Methods for Multi and Single Inserts

2022-03-07 Thread Matthias van de Meent
On Sun, 6 Mar 2022 at 12:12, Bharath Rupireddy wrote: > > On Fri, Mar 4, 2022 at 8:07 PM Matthias van de Meent > wrote: > > > Another rebase due to conflicts in 0003. Attaching v6 for review. > > > > I recently touched the topic of multi_insert, and I remembered this > > patch. I had to dig a bit

Re: Changing "Hot Standby" to "hot standby"

2022-03-07 Thread Daniel Westermann (DWE)
>>> Thanks for having a look. Are you suggesting to change it like this? >>> -Hot Standby is the term used to describe the ability to connect to >>> +Hot standby is the term used to describe the ability to connect to >>Yes. Isn't it the right form of a sentence? I've created and entry in

Re: role self-revocation

2022-03-07 Thread Tom Lane
Robert Haas writes: > Hmm. I think the real issue is what David Johnson calls the session > user exception. I hadn't quite understood how that played into this. > According to the documentation: "If WITH ADMIN OPTION is specified, > the member can in turn grant membership in the role to others, an

Re: role self-revocation

2022-03-07 Thread David G. Johnston
On Mon, Mar 7, 2022 at 8:37 AM Robert Haas wrote: > A role is not considered to hold WITH > ADMIN OPTION on itself, but it may grant or revoke membership in > itself from a database session where the session user matches the > role." > > Is there some use case for the behavior described in that l

Re: role self-revocation

2022-03-07 Thread Robert Haas
On Sun, Mar 6, 2022 at 2:09 PM David G. Johnston wrote: > So, do we really want to treat every single login role as a potential group > by keeping the session_user exception? I think that we DO want to continue to treat login roles as potentially grantable privileges. That feels fundamentally us

Re: New developer papercut - Makefile references INSTALL

2022-03-07 Thread Tom Lane
Magnus Hagander writes: > If anything, I'm more behind the idea of just getting rid of the > INSTALL file. A reference to the install instructions in the README > should be enough today. The likelihood of somebody getting a postgres > source tarball and trying to build it for the first time while

Re: role self-revocation

2022-03-07 Thread Robert Haas
On Sun, Mar 6, 2022 at 11:53 AM Tom Lane wrote: > Really? > > regression=# grant admin to joe; > GRANT ROLE > regression=# grant admin to sally; > GRANT ROLE > regression=# \c - joe > You are now connected to database "regression" as user "joe". > regression=> revoke admin from sally; > ERROR: mu

Re: role self-revocation

2022-03-07 Thread Robert Haas
On Sun, Mar 6, 2022 at 11:34 AM Tom Lane wrote: > I was thinking the former ... however, after a bit of experimentation > I see that we accept "grant foo to bar granted by baz" a VERY long > way back, but the "granted by" option for object privileges is > (a) pretty new and (b) apparently restrict

Re: New developer papercut - Makefile references INSTALL

2022-03-07 Thread Magnus Hagander
On Thu, Feb 10, 2022 at 12:52 AM Tom Lane wrote: (bringing this one back from the dead) > > Andres Freund writes: > > On 2022-02-09 22:32:59 +0100, Magnus Hagander wrote: > >> post-commit hooks don't run on the git server, they run locally on > >> your machine. There is a "post receive" hook

Re: Add parameter jit_warn_above_fraction

2022-03-07 Thread Magnus Hagander
On Mon, Mar 7, 2022 at 2:09 PM Justin Pryzby wrote: > > On Mon, Mar 07, 2022 at 01:10:32PM +0100, Magnus Hagander wrote: > > On Fri, Feb 25, 2022 at 5:23 PM Justin Pryzby wrote: > > > > > > I think it should be a NOTICE (or less?) > > > > Hmm. I'm not so sure. > > > > Other similar parameters oft

Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)

2022-03-07 Thread Nitin Jadhav
> + > + > + type text > + > + > + Type of checkpoint. See . > + > + > + > + > + > + kind text > + > + > + Kind of checkpoint. See . > + > + > > This looks a bit confusing. Two columns, one with the name "che

Re: Proposal: Support custom authentication methods using hooks,Re: Proposal: Support custom authentication methods using hooks

2022-03-07 Thread Joshua Brindle
On Fri, Mar 4, 2022 at 6:03 PM Tatsuo Ishii wrote: > > >> I still don't understand why using plaintex password authentication > >> over SSL connection is considered insecure. Actually we have been > >> stating opposite in the manual: > >> https://www.postgresql.org/docs/14/auth-password.html > >>

Re: generic plans and "initial" pruning

2022-03-07 Thread Amit Langote
On Fri, Feb 11, 2022 at 7:02 AM Robert Haas wrote: > On Thu, Feb 10, 2022 at 3:14 AM Amit Langote wrote: > > Maybe this should be more than one patch? Say: > > > > 0001 to add ExecutorPrep and the boilerplate, > > 0002 to teach plancache.c to use the new facility Thanks for taking a look and so

Re: suboverflowed subtransactions concurrency performance optimize

2022-03-07 Thread Julien Rouhaud
On Mon, Mar 07, 2022 at 01:27:40PM +, Simon Riggs wrote: > > +/* > > + * Single-item cache for results of SubTransGetTopmostTransaction. It's > > worth having > > + * such a cache because we frequently find ourselves repeatedly checking > > the > > + * same XID, for example when scanning a t

Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)

2022-03-07 Thread Nitin Jadhav
> 1) Can we convert below into pgstat_progress_update_multi_param, just > to avoid function calls? > pgstat_progress_update_param(PROGRESS_CHECKPOINT_LSN, checkPoint.redo); > pgstat_progress_update_param(PROGRESS_CHECKPOINT_PHASE, > > 2) Why are we not having special phase for CheckPointReplication

Re: [RFC] building postgres with meson

2022-03-07 Thread Peter Eisentraut
Is there a current patch set to review in this thread at the moment?

Re: suboverflowed subtransactions concurrency performance optimize

2022-03-07 Thread Simon Riggs
On Mon, 7 Mar 2022 at 09:49, Julien Rouhaud wrote: > > Hi, > > On Mon, Jan 17, 2022 at 01:44:02PM +, Simon Riggs wrote: > > > > Re-attached, so that the CFapp isn't confused between the multiple > > patches on this thread. > > Thanks a lot for working on this! > > The patch is simple and overa

Re: Add parameter jit_warn_above_fraction

2022-03-07 Thread Justin Pryzby
On Mon, Mar 07, 2022 at 01:10:32PM +0100, Magnus Hagander wrote: > On Fri, Feb 25, 2022 at 5:23 PM Justin Pryzby wrote: > > > > I think it should be a NOTICE (or less?) > > Hmm. I'm not so sure. > > Other similar parameters often use LOG, but the downside of that is > that it won't be sent to th

Re: Expose JIT counters/timing in pg_stat_statements

2022-03-07 Thread Dmitry Dolgov
> On Mon, Mar 07, 2022 at 01:27:02PM +0100, Magnus Hagander wrote: > On Fri, Feb 25, 2022 at 5:40 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > One interesting not-very-relevant for the patch thing I've noticed while > > reading it, is that there seems to be no way to find out what fraction >

Re: logical replication empty transactions

2022-03-07 Thread Ajin Cherian
On Mon, Mar 7, 2022 at 7:50 PM shiy.f...@fujitsu.com wrote: > > On Fri, Mar 4, 2022 9:41 AM Ajin Cherian wrote: > > > > I have split the patch into two. I have kept the logic of skipping > > streaming changes in the second patch. > > I will work on the second patch once we can figure out a soluti

Re: Expose JIT counters/timing in pg_stat_statements

2022-03-07 Thread Magnus Hagander
On Fri, Feb 25, 2022 at 5:43 PM Julien Rouhaud wrote: > > On Fri, Feb 25, 2022 at 05:38:45PM +0100, Magnus Hagander wrote: > > > > Per some off-list discussion with Julien, we have clearly been talking > > in slightly different terms. So let's summarize the options into what > > theÿ́d actually be

Re: Expose JIT counters/timing in pg_stat_statements

2022-03-07 Thread Magnus Hagander
On Fri, Feb 25, 2022 at 5:40 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > > On Fri, Feb 25, 2022 at 04:19:27PM +0100, Magnus Hagander wrote: > > On Fri, Feb 25, 2022 at 2:33 PM Julien Rouhaud wrote: > > > > > > Hi, > > > > > > On Fri, Feb 25, 2022 at 02:06:29PM +0100, Magnus Hagander wrote:

Re: Handle infinite recursion in logical replication setup

2022-03-07 Thread Amit Kapila
On Mon, Mar 7, 2022 at 5:01 PM Ashutosh Bapat wrote: > > Hi Vignesh, > I agree with Peter's comment that the changes to > FilterRemoteOriginData() should be part of FilterByOrigin() > > Further, I wonder why "onlylocal_data" is a replication slot's > property. A replication slot tracks the progres

Re: Add parameter jit_warn_above_fraction

2022-03-07 Thread Magnus Hagander
On Fri, Feb 25, 2022 at 5:23 PM Justin Pryzby wrote: > > On Fri, Feb 25, 2022 at 04:16:01PM +0100, Magnus Hagander wrote: > > + { > > + {"jit_warn_above_fraction", PGC_SUSET, LOGGING_WHEN, > > + gettext_noop("Sets the fraction of query time spent > > on JIT bef

Re: pg_tablespace_location() failure with allow_in_place_tablespaces

2022-03-07 Thread Michael Paquier
On Fri, Mar 04, 2022 at 11:26:43PM +1300, Thomas Munro wrote: > The warning from readlink() while making the mapping file isn't ideal, > and perhaps we should suppress that with something like the attached. > Or does the missing map file entry break something on Windows? > @@ -8292,6 +8293,10 @@ d

  1   2   >