Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-16 Thread Nathan Bossart
On Thu, Dec 15, 2022 at 10:10:43AM -0800, Jeff Davis wrote: > The proposal to skip privilege checks for partitions would be > consistent with INSERT, SELECT, REINDEX that flow through to the > underlying partitions regardless of permissions/ownership (and even > RLS). It would be very minor

Re: Raising the SCRAM iteration count

2022-12-16 Thread Michael Paquier
On Thu, Dec 15, 2022 at 12:09:15PM +0100, Daniel Gustafsson wrote: >> On 15 Dec 2022, at 00:52, Michael Paquier wrote: >>conn->in_hot_standby = PG_BOOL_UNKNOWN; >> + conn->scram_iterations = SCRAM_DEFAULT_ITERATIONS; >> >> s/SCRAM_DEFAULT_ITERATIONS/SCRAM_SHA_256_DEFAULT_ITERATIONS/ and >>

Re: Refactor SCRAM code to dynamically handle hash type and key length

2022-12-16 Thread Michael Paquier
On Thu, Dec 15, 2022 at 04:59:52AM +0900, Michael Paquier wrote: > However, that's only half of the picture. The key length and the hash > type (or just the hash type to know what's the digest/key length to > use but that's more invasive) still need to be sent across the > internal routines of

Re: New strategies for freezing, advancing relfrozenxid early

2022-12-16 Thread Peter Geoghegan
On Thu, Dec 15, 2022 at 11:59 PM Nikita Malakhov wrote: > I've found this discussion very interesting, in view of vacuuming > TOAST tables is always a problem because these tables tend to > bloat very quickly with dead data - just to remind, all TOAST-able > columns of the relation use the same

Re: [PoC] Federated Authn/z with OAUTHBEARER

2022-12-16 Thread Jacob Champion
On Mon, Dec 12, 2022 at 9:06 PM Andrey Chudnovsky wrote: > If your concern is extension not honoring the DBA configured values: > Would a server-side logic to prefer HBA value over extension-provided > resolve this concern? Yeah. It also seals the role of the extension here as "optional". > We

Re: New strategies for freezing, advancing relfrozenxid early

2022-12-16 Thread Peter Geoghegan
On Thu, Dec 15, 2022 at 11:48 PM John Naylor wrote: > Thanks for this. This is the kind of concrete, data-based evidence that I > find much more convincing, or at least easy to reason about. I'm glad to hear that it helped. It's always difficult to judge where other people are coming from,

Re: On login trigger: take three

2022-12-16 Thread Nikita Malakhov
Hi, Mikhail, I've checked the patch and previous discussion, the condition mentioned earlier is still actual: >The example trigger from the documentation +DECLARE + hour integer = EXTRACT('hour' FROM current_time); + rec boolean; +BEGIN +-- 1. Forbid logging in between 2AM and 4AM. +IF

Re: Error-safe user functions

2022-12-16 Thread Tom Lane
I wrote: > I'm going to step back from this for now and get on with other work, > but before that I thought there was one more input function I should > look at: xml_in, because xml.c is such a hairy can of worms. Pushed that. For the record, my list of input functions still needing attention

Re: On login trigger: take three

2022-12-16 Thread Mikhail Gribkov
Hi hackers, Attached v33 is a new rebase of the flagless version of the patch. As there were no objections at first glance, I’ll try to post it to the upcoming commitfest, thus the brief recap of all the patch details is below. v33-On_client_login_event_trigger The patch introduces a trigger on

Re: pg_upgrade: Make testing different transfer modes easier

2022-12-16 Thread Peter Eisentraut
On 14.12.22 10:40, Daniel Gustafsson wrote: On 14 Dec 2022, at 08:04, Peter Eisentraut wrote: On 07.12.22 17:33, Peter Eisentraut wrote: I think if we want to make this configurable on the fly, and environment variable would be much easier, like my $mode = $ENV{PG_TEST_PG_UPGRADE_MODE}

Re: Minimal logical decoding on standbys

2022-12-16 Thread Drouvot, Bertrand
Hi, On 12/16/22 5:38 PM, Robert Haas wrote: On Fri, Dec 16, 2022 at 10:08 AM Drouvot, Bertrand wrote: After 1489b1ce728 the name mayConflictInLogicalDecoding seems odd. Seems it should be a riff on snapshotConflictHorizon? Gotcha, what about logicalSnapshotConflictThreat?

Re: Minimal logical decoding on standbys

2022-12-16 Thread Robert Haas
On Fri, Dec 16, 2022 at 10:08 AM Drouvot, Bertrand wrote: > > After 1489b1ce728 the name mayConflictInLogicalDecoding seems odd. Seems > > it should be a riff on snapshotConflictHorizon? > > Gotcha, what about logicalSnapshotConflictThreat? logicalConflictPossible? checkDecodingConflict? I

Re: Privileges on PUBLICATION

2022-12-16 Thread Antonin Houska
Antonin Houska wrote: > Antonin Houska wrote: > > > Peter Eisentraut wrote: > > > > > On 04.11.22 08:28, Antonin Houska wrote: > > > > I thought about the whole concept a bit more and I doubt if the > > > > PUBLICATION > > > > privilege is the best approach. In particular, the user

Re: pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2022-12-16 Thread Daniel Gustafsson
> On 16 Dec 2022, at 16:09, Daniel Watzinger wrote: > first-time contributor here. I certainly hope I got the patch > creation and email workflow right. Let me know if anything can be > improved as I`m eager to learn. Welcome! The patch seems to be in binary format or using some form of

pg_dump/pg_restore: Fix stdin/stdout handling of custom format on Win32

2022-12-16 Thread Daniel Watzinger
Hi there, first-time contributor here. I certainly hope I got the patch creation and email workflow right. Let me know if anything can be improved as I`m eager to learn. Regression tests (check) were successful on native Win32 MSVC as well as Debian. Here comes the patch and corresponding

Re: Minimal logical decoding on standbys

2022-12-16 Thread Drouvot, Bertrand
Hi, On 12/16/22 2:51 PM, Andres Freund wrote: Hi, On 2022-12-16 11:33:50 +0100, Drouvot, Bertrand wrote: @@ -235,13 +236,14 @@ typedef struct xl_btree_delete TransactionId snapshotConflictHorizon; uint16 ndeleted; uint16 nupdated; + bool

Re: Minimal logical decoding on standbys

2022-12-16 Thread Andres Freund
Hi, On 2022-12-16 11:33:50 +0100, Drouvot, Bertrand wrote: > @@ -235,13 +236,14 @@ typedef struct xl_btree_delete > TransactionId snapshotConflictHorizon; > uint16 ndeleted; > uint16 nupdated; > + boolmayConflictInLogicalDecoding; After 1489b1ce728

Re: pg_upgrade allows itself to be run twice

2022-12-16 Thread Justin Pryzby
On Thu, Dec 01, 2022 at 10:30:16AM +0100, Peter Eisentraut wrote: > On 01.11.22 14:07, Justin Pryzby wrote: > > On Tue, Nov 01, 2022 at 01:54:35PM +0100, Peter Eisentraut wrote: > > > On 07.07.22 08:22, Justin Pryzby wrote: > > > > > This one comes from NextOID in the control data file after a

(non) translatable string splicing

2022-12-16 Thread Justin Pryzby
I was surprised to see that this has been here for a few years (since 77517ba59) without complaints or inquiries from translators. src/bin/pg_upgrade/option.c:check_required_directory(_cluster.bindir, "PGBINOLD", false, src/bin/pg_upgrade/option.c-

Feature request to add rows extracted using pg_dump utility

2022-12-16 Thread vinay kumar
Hi Team, Good Day! My name is Vinay Kumar. I am checking with you to see if you can add the number of rows extracted by the pg_dump utility for tables when using verbose mode. This will help end users to validate the amount of data extracted. I understand that pg_class.reltuples can help

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

2022-12-16 Thread Amit Kapila
On Fri, Dec 16, 2022 at 2:47 PM houzj.f...@fujitsu.com wrote: > > > --- > > + active_workers = list_copy(ParallelApplyWorkerPool); > > + > > + foreach(lc, active_workers) > > + { > > + int slot_no; > > + uint16 generation;

Re: [PATCH] Add native windows on arm64 support

2022-12-16 Thread Niyas Sait
On 12/12/2022 23:56, Michael Paquier wrote: On Mon, Dec 12, 2022 at 01:38:37PM +, Niyas Sait wrote: On 05/12/2022 18:14, Andres Freund wrote: I think the old build system specific part is really minimal in the patch. I can strip out those if that's preferred. Removing all the changes from

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

2022-12-16 Thread Amit Kapila
On Thu, Dec 15, 2022 at 6:29 PM Amit Kapila wrote: > I have noticed that the origin information of the rollback is not restored after restart of the server. So, the apply worker will send the old origin information in that case. It seems we need the below change in XactLogAbortRecord(). What do

Re: Minimal logical decoding on standbys

2022-12-16 Thread Drouvot, Bertrand
Hi, On 12/15/22 11:31 AM, Drouvot, Bertrand wrote: Hi, On 12/14/22 4:55 PM, Robert Haas wrote:   On Wed, Dec 14, 2022 at 8:06 AM Drouvot, Bertrand> Other comments: +    if RelationIsAccessibleInLogicalDecoding(rel) +    xlrec.flags |=

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

2022-12-16 Thread houzj.f...@fujitsu.com
On Friday, December 16, 2022 3:08 PM Masahiko Sawada wrote: > > >Here are some minor comments: Thanks for the comments! > --- > +pa_has_spooled_message_pending() > +{ > + PartialFileSetState fileset_state; > + > + fileset_state = pa_get_fileset_state(); > + > + if

Re: Inconsistency in reporting checkpointer stats

2022-12-16 Thread Kyotaro Horiguchi
At Wed, 14 Dec 2022 16:54:53 +0530, Bharath Rupireddy wrote in > Indeed PendingCheckpointerStats.buf_written_checkpoints needs to count > buffer writes in SlruInternalWritePage(). However, does it need to be > done immediately there? The stats will not be visible to the users > until the next

Re: [PATCH] psql: \dn+ to show size of each schema (and \dA+ for AMs)

2022-12-16 Thread Pavel Stehule
čt 15. 12. 2022 v 17:13 odesílatel Justin Pryzby napsal: > Rebased on c727f511b. > > This patch record was "closed for lack of interest", but I think what's > actually needed is committer review of which approach to take. > > - add backend functions but do not modify psql ? > - add to psql

Re: New strategies for freezing, advancing relfrozenxid early

2022-12-16 Thread Nikita Malakhov
Hi! I've found this discussion very interesting, in view of vacuuming TOAST tables is always a problem because these tables tend to bloat very quickly with dead data - just to remind, all TOAST-able columns of the relation use the same TOAST table which is one for the relation, and TOASTed data