Re: pg_receivewal starting position

2021-10-23 Thread Michael Paquier
On Sun, Oct 24, 2021 at 09:08:01AM +0530, Bharath Rupireddy wrote: > pg_get_replication_slots holds the ReplicationSlotControlLock until > the end of the function so it can be assured that *slot contents will > not change. In ReadReplicationSlot, the ReplicationSlotControlLock is > released immedia

Re: [PATCH] postgres_fdw: suppress explicit casts in text:text comparisons (was: column option to override foreign types)

2021-10-23 Thread Dian M Fay
On Sun Sep 5, 2021 at 6:43 PM EDT, Tom Lane wrote: > "Dian M Fay" writes: > > [ 0001-Suppress-explicit-casts-of-text-constants-in-postgre.patch ] > > I took a quick look at this. The restriction to type text seems like > very obviously a hack rather than something we actually want; wouldn't > it m

Re: pg_receivewal starting position

2021-10-23 Thread Bharath Rupireddy
On Sun, Oct 24, 2021 at 4:40 AM Michael Paquier wrote: > On Sat, Oct 23, 2021 at 10:46:30PM +0530, Bharath Rupireddy wrote: > > 2) As I previously mentioned, we are not copying the slot contents > > while holding the spinlock, it's just we are taking the memory address > > and releasing the lock,

Re: MDAM techniques and Index Skip Scan patch

2021-10-23 Thread Dmitry Dolgov
> On Thu, Oct 21, 2021 at 07:16:00PM -0700, Peter Geoghegan wrote: > > My general concern is that the skip scan patch may currently be > structured in a way that paints us into a corner, MDAM-wise. > > Note that the MDAM paper treats skipping a prefix of columns as a case > where the prefix is hand

Re: Allow pg_signal_backend members to use pg_log_backend_memory_stats().

2021-10-23 Thread Michael Paquier
On Sat, Oct 23, 2021 at 08:42:29PM +, Bossart, Nathan wrote: > Otherwise, presumably we will need to update func.sgml and the comment > above pg_log_backend_memory_contexts() in mcxtfuncs.c. Yes, the documentation of any SQL function whose hardcoded superuser() check is removed needs a refresh

Re: Refactoring: join MakeSingleTupleTableSlot() and MakeTupleTableSlot()

2021-10-23 Thread Michael Paquier
On Fri, Oct 22, 2021 at 04:39:37PM +0300, Aleksander Alekseev wrote: > I propose keeping only one of these procedures to simplify navigating > through the code and debugging, and maybe saving a CPU cycle or two. A > search for MakeTupleTableSlot produced 8 matches across 2 files, while > MakeSingle

Re: pg_receivewal starting position

2021-10-23 Thread Michael Paquier
On Sat, Oct 23, 2021 at 10:46:30PM +0530, Bharath Rupireddy wrote: > 1) It's better to initialize nulls with false, we can avoid setting > them to true. The instances where the columns are not nulls is going > to be more than the columns with null values, so we could avoid some > of nulls[i] = fals

Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.

2021-10-23 Thread Jeff Davis
Add new predefined role pg_maintenance, which can issue VACUUM, ANALYZE, CHECKPOINT. Patch attached. Regards, Jeff Davis From e615ad4b4a8c390a4b937dbb5721de5daad5 Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Sat, 23 Oct 2021 13:41:41 -0700 Subject: [PATCH] Predefined role pg_mai

Re: Allow pg_signal_backend members to use pg_log_backend_memory_stats().

2021-10-23 Thread Bossart, Nathan
On 10/23/21, 12:57 PM, "Jeff Davis" wrote: > pg_signal_backend seems like the appropriate predefined role, because > pg_log_backend_memory_contexts() is implemented by a sending signal. This seems reasonable to me. The stated reason in the original commit message for keeping it restricted to sup

Re: How to retain lesser paths at add_path()?

2021-10-23 Thread Greg Stark
On Wed, 31 Jul 2019 at 11:45, Robert Haas wrote: > > On Wed, Jul 31, 2019 at 11:07 AM Tom Lane wrote: > > What you'd want to do for something like the above, I think, is to > > have some kind of figure of merit or other special marking for paths > > that will have some possible special advantage

Re: should we allow users with a predefined role to access pg_backend_memory_contexts view and pg_log_backend_memory_contexts function?gr

2021-10-23 Thread Jeff Davis
On Wed, 2021-10-13 at 11:43 +0530, Bharath Rupireddy wrote: > Here comes the v2 patch. Note that I've retained superuser() check in > the pg_log_backend_memory_contexts(). Please review it. FYI: I submitted a separate patch here to allow pg_signal_backend to execute pg_log_backend_memory_contexts(

Allow pg_signal_backend members to use pg_log_backend_memory_stats().

2021-10-23 Thread Jeff Davis
Simple patch to implement $SUBJECT attached. pg_signal_backend seems like the appropriate predefined role, because pg_log_backend_memory_contexts() is implemented by a sending signal. Regards, Jeff Davis From 473e0bb2e1ae0d56dbc6b0262c16b10c6c0454cc Mon Sep 17 00:00:00 2001 From: Jeff D

Re: [PATCH] Make ENOSPC not fatal in semaphore creation

2021-10-23 Thread Mikhail
On Sun, Oct 17, 2021 at 10:52:38AM -0400, Tom Lane wrote: > I am, however, concerned that this'll just trade off one hazard for > another. Instead of a risk of failing with ENOSPC (which the DBA > can fix), we'll have a risk of kneecapping some other process at > random (which the DBA can do nothi

Re: add retry mechanism for achieving recovery target before emitting FATA error "recovery ended before configured recovery target was reached"

2021-10-23 Thread Jeff Davis
On Sat, 2021-10-23 at 09:31 +0530, Bharath Rupireddy wrote: > If you are suggesting ... Your complaint seems to be coming from commit dc788668, so the most direct answer would be to make that configurable to the old behavior, not to invent a new timeout behavior. If I understand correctly, you ar

Re: logical decoding/replication: new functions pg_ls_logicaldir and pg_ls_replslotdir

2021-10-23 Thread Bharath Rupireddy
On Fri, Oct 22, 2021 at 9:26 PM Justin Pryzby wrote: > I concluded that it's better to add a function to list metadata of an > arbitrary > dir, rather than adding more functions to handle specific, hardcoded dirs: > https://www.postgresql.org/message-id/flat/20191227170220.ge12...@telsasoft.com

Re: pg_receivewal starting position

2021-10-23 Thread Bharath Rupireddy
On Sat, Oct 23, 2021 at 1:14 PM Michael Paquier wrote: > > On Thu, Oct 21, 2021 at 10:36:42AM +0200, Ronan Dunklau wrote: > > Done. I haven't touched the timeline switch test patch for now, but I still > > include it here for completeness. > > Thanks. I have applied and back-patched 0001, then lo

Re: XTS cipher mode for cluster file encryption

2021-10-23 Thread Bruce Momjian
On Tue, Oct 19, 2021 at 02:54:56PM -0400, Stephen Frost wrote: > * Sasasu (i...@sasa.su) wrote: > > A unified block-based I/O API sounds great. Has anyone tried to do this > > before? It would be nice if the front-end tools could also use these API. > > The TDE patch from Cybertec did go down this

Re: XTS cipher mode for cluster file encryption

2021-10-23 Thread Bruce Momjian
On Mon, Oct 18, 2021 at 12:37:39PM -0400, Robert Haas wrote: > I do really like the idea of using AES-GCM-SIV not because I know > anything about it, but because the integrity checking seems cool, and -- > storing the nonce seems like

Re: [PATCH] Make ENOSPC not fatal in semaphore creation

2021-10-23 Thread Mikhail
On Fri, Oct 22, 2021 at 09:00:31PM -0400, Tom Lane wrote: > I tried this on an OpenBSD 6.0 image I had handy. The good news is > that it works, and I can successfully start the postmaster with a lot > of semaphores (I tried with max_connections=1) without any special > system configuration. T

Re: XTS cipher mode for cluster file encryption

2021-10-23 Thread Bruce Momjian
On Tue, Oct 19, 2021 at 02:44:26PM -0400, Stephen Frost wrote: > Another threat model to consider is if the attacker has read-only access > to the data directory through, say, unix group read privileges or maybe > the ability to monitor the traffic on the SAN, or the ability to > read-only mount th

Re: [Proposal] Global temporary tables

2021-10-23 Thread Andrew Bille
Thanks, the vacuum is fixed But I found another crash (on v57 patches), reproduced with: psql -t -c "create global temp table t (a integer); insert into t values (1); select count(*) from t group by t;" server closed the connection unexpectedly This probably means the server terminated ab

Re: pg_receivewal starting position

2021-10-23 Thread Michael Paquier
On Thu, Oct 21, 2021 at 10:36:42AM +0200, Ronan Dunklau wrote: > Done. I haven't touched the timeline switch test patch for now, but I still > include it here for completeness. Thanks. I have applied and back-patched 0001, then looked again at 0002 that adds READ_REPLICATION_SLOT: - Change the T