Re: SQL JSON path enhanced numeric literals

2023-02-27 Thread Peter Eisentraut
On 28.02.23 01:09, Vik Fearing wrote: On 2/27/23 20:13, Peter Eisentraut wrote: Attached is a patch to add nondecimal integer literals and underscores in numeric literals to the SQL JSON path language.  This matches the recent additions to the core SQL syntax.  It follows ECMAScript in

Re: Allow tests to pass in OpenSSL FIPS mode

2023-02-27 Thread Peter Eisentraut
On 28.02.23 06:01, Michael Paquier wrote: On Mon, Feb 27, 2023 at 08:23:34AM +0100, Peter Eisentraut wrote: On 27.02.23 08:16, Michael Paquier wrote: This refers to brin_minmax_multi_distance_macaddr8(), no? This is amazing. I have a hard time imagining how FIPS would interact with what we

Re: Provide PID data for "cannot wait on a latch owned by another process" in latch.c

2023-02-27 Thread Peter Eisentraut
On 28.02.23 00:59, Michael Paquier wrote: On Mon, Feb 27, 2023 at 05:48:10PM +0900, Kyotaro Horiguchi wrote: +1 for adding that information, I'm afraid that MyProcId is not necessary since it is displayed in log lines in most cases. If you want to display the both PIDs I suggest making them

Re: [PoC] Improve dead tuple storage for lazy vacuum

2023-02-27 Thread John Naylor
On Fri, Feb 24, 2023 at 12:50 PM Masahiko Sawada wrote: > > On Wed, Feb 22, 2023 at 6:55 PM John Naylor > wrote: > > > > That doesn't seem useful to me. If we've done enough testing to reassure us the new way always gives the same answer, the old way is not needed at commit time. If there is any

Re: Make some xlogreader messages more accurate

2023-02-27 Thread Bharath Rupireddy
On Thu, Feb 23, 2023 at 1:06 PM Peter Eisentraut wrote: > > Here is a small patch to make some invalid-record error messages in > xlogreader a bit more accurate (IMO). +1 for these changes. > My starting point was that when you have some invalid WAL, you often get > a message like "wanted 24,

Re: ICU locale validation / canonicalization

2023-02-27 Thread Jeff Davis
On Mon, 2023-02-20 at 15:23 -0800, Jeff Davis wrote: > > New patch attached. The new patch also includes a GUC that (when > enabled) validates that the collator is actually found. New patch attached. Now it always preserves the exact locale string during pg_upgrade, and does not attempt to

Re: Track Oldest Initialized WAL Buffer Page

2023-02-27 Thread Bharath Rupireddy
On Tue, Feb 28, 2023 at 5:52 AM Nathan Bossart wrote: > > On Tue, Feb 07, 2023 at 07:30:00PM +0530, Bharath Rupireddy wrote: > > + /* > > + * Try updating oldest initialized XLog buffer page. > > + * > > + * Update it if we are initializing an

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2023-02-27 Thread Bharath Rupireddy
On Tue, Feb 28, 2023 at 6:14 AM Nathan Bossart wrote: > > On Wed, Feb 08, 2023 at 08:00:00PM +0530, Bharath Rupireddy wrote: > > + /* > > + * We read some of the requested bytes. Continue to > > read remaining > > + * bytes. > > +

Re: Force testing of query jumbling code in TAP tests

2023-02-27 Thread Michael Paquier
On Thu, Feb 16, 2023 at 02:08:42PM +0900, Michael Paquier wrote: > Other ideas are welcome. At least this would be a start. The main idea of the patch is here: > +# Check some data from pg_stat_statements. > +$node_primary->safe_psql('postgres', 'CREATE EXTENSION pg_stat_statements'); > +# This

Re: Allow tests to pass in OpenSSL FIPS mode

2023-02-27 Thread Michael Paquier
On Mon, Feb 27, 2023 at 08:23:34AM +0100, Peter Eisentraut wrote: > On 27.02.23 08:16, Michael Paquier wrote: >> This refers to brin_minmax_multi_distance_macaddr8(), no? This is >> amazing. I have a hard time imagining how FIPS would interact with >> what we do in mac8.c to explain that, so it

Re: Doc update for pg_stat_statements normalization

2023-02-27 Thread Michael Paquier
On Fri, Feb 24, 2023 at 08:54:00PM +, Imseih (AWS), Sami wrote: > I think the only thing to do here is to call this out in docs with a > suggestion to increase > pg_stat_statements.max to reduce the likelihood. I also attached the suggested > doc enhancement as well. + + A query text may

Re: pg_upgrade and logical replication

2023-02-27 Thread Julien Rouhaud
On Tue, Feb 28, 2023 at 08:56:37AM +0530, Amit Kapila wrote: > On Tue, Feb 28, 2023 at 7:55 AM Julien Rouhaud wrote: > > > > > > The scenario I'm interested in is to rely on logical replication only for > > the > > upgrade, so the end state (and start state) is to go back to physical > >

Re: We shouldn't signal process groups with SIGQUIT

2023-02-27 Thread Michael Paquier
On Tue, Feb 14, 2023 at 12:47:12PM -0800, Andres Freund wrote: > Just naively hacking this behaviour change into the current code, would yield > sending SIGQUIT to postgres, and then SIGTERM to the whole process > group. Which seems like a reasonable order? quickdie() should _exit() > immediately

RE: Rework LogicalOutputPluginWriterUpdateProgress

2023-02-27 Thread Takamichi Osumi (Fujitsu)
Hi, On Monday, February 27, 2023 6:30 PM wangw.f...@fujitsu.com wrote: > Attach the new patch. Thanks for sharing v3. Minor review comments and question. (1) UpdateDecodingProgressAndKeepalive header comment The comment should be updated to explain maybe why we reset some other flags as

Re: pg_upgrade and logical replication

2023-02-27 Thread Amit Kapila
On Tue, Feb 28, 2023 at 7:55 AM Julien Rouhaud wrote: > > On Mon, Feb 27, 2023 at 03:39:18PM +0530, Amit Kapila wrote: > > > > BTW, thinking some more > > on this, how will we allow to continue replication after upgrading the > > publisher? During upgrade, we don't retain slots, so the

Re: Time delayed LR (WAS Re: logical replication restrictions)

2023-02-27 Thread Amit Kapila
On Tue, Feb 28, 2023 at 8:14 AM Kyotaro Horiguchi wrote: > > At Mon, 27 Feb 2023 14:56:19 +0530, Amit Kapila > wrote in > > The one difference w.r.t recovery_min_apply_delay is that here we will > > hold locks for the duration of the delay which didn't seem to be a > > good idea. This will also

Re: Time delayed LR (WAS Re: logical replication restrictions)

2023-02-27 Thread Kyotaro Horiguchi
At Mon, 27 Feb 2023 14:56:19 +0530, Amit Kapila wrote in > The one difference w.r.t recovery_min_apply_delay is that here we will > hold locks for the duration of the delay which didn't seem to be a > good idea. This will also probably lead to more bloat as we will keep > transactions open for

Re: Non-superuser subscription owners

2023-02-27 Thread Stephen Frost
Greetings, * Jeff Davis (pg...@j-davis.com) wrote: > Not all steps would be breaking changes, and a lot of those steps are > things we should do anyway. We could make it easier to write safe > SECURITY DEFINER functions, provide more tools for users to opt-out of > executing SECURITY INVOKER

Re: Non-superuser subscription owners

2023-02-27 Thread Stephen Frost
Greetings, * Jeff Davis (pg...@j-davis.com) wrote: > On Mon, 2023-02-27 at 14:10 -0500, Stephen Frost wrote: > > I do think there are some use-cases for it, but agree that it'd be > > better to encourage more use of SECURITY DEFINER and one approach to > > that might be to have a way for users to

Re: pg_upgrade and logical replication

2023-02-27 Thread Julien Rouhaud
On Mon, Feb 27, 2023 at 03:39:18PM +0530, Amit Kapila wrote: > > BTW, thinking some more > on this, how will we allow to continue replication after upgrading the > publisher? During upgrade, we don't retain slots, so the replication > won't continue. I think after upgrading subscriber-node, user

Re: Should vacuum process config file reload more often

2023-02-27 Thread Masahiko Sawada
On Tue, Feb 28, 2023 at 10:21 AM Andres Freund wrote: > > Hi, > > On 2023-02-27 23:11:53 +0900, Masahiko Sawada wrote: > > As far as I know there are not such GUC parameters in the core but > > there might be in third-party table AM and index AM extensions. > > We already reload in a pretty broad

Re: pg_rewind: warn when checkpoint hasn't happened after promotion

2023-02-27 Thread kuroda . keisuke
hi Heikki, Thanks to mail, and thanks also for the commit(0a0500207a) to fix the document. I'm glad the problem was solved. Best Regards, Keisuke Kuroda NTT COMWARE 2023-02-27 16:33 に Heikki Linnakangas さんは書きました: On 16/11/2022 07:17, kuroda.keis...@nttcom.co.jp wrote: I fixed this last week

Re: Should vacuum process config file reload more often

2023-02-27 Thread Andres Freund
Hi, On 2023-02-27 23:11:53 +0900, Masahiko Sawada wrote: > As far as I know there are not such GUC parameters in the core but > there might be in third-party table AM and index AM extensions. We already reload in a pretty broad range of situations, so I'm not sure there's a lot that could be

Re: Rework LogicalOutputPluginWriterUpdateProgress

2023-02-27 Thread Peter Smith
Here are some comments for the v2-0001 patch. (I haven't looked at the v3 that was posted overnight; maybe some of my comments have already been addressed.) == General 1. (Info from the commit message) Since we can know whether the change is an end of transaction change in the common code,

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2023-02-27 Thread Nathan Bossart
On Wed, Feb 08, 2023 at 08:00:00PM +0530, Bharath Rupireddy wrote: > + /* > + * We read some of the requested bytes. Continue to > read remaining > + * bytes. > + */ > + ptr += nread; > +

Re: Non-superuser subscription owners

2023-02-27 Thread Jeff Davis
On Mon, 2023-02-27 at 16:13 -0500, Robert Haas wrote: > On Mon, Feb 27, 2023 at 1:25 PM Jeff Davis wrote: > > I think you are saying that we should still run Alice's code with > > the > > privileges of Bob, but somehow make that safe(r) for Bob. Is that > > right? > > Yeah. That's the idea I was

Re: Track Oldest Initialized WAL Buffer Page

2023-02-27 Thread Nathan Bossart
On Tue, Feb 07, 2023 at 07:30:00PM +0530, Bharath Rupireddy wrote: > + /* > + * Try updating oldest initialized XLog buffer page. > + * > + * Update it if we are initializing an XLog buffer page for the > first > + * time or if XLog

Re: verbose mode for pg_input_error_message?

2023-02-27 Thread Nathan Bossart
On Tue, Feb 28, 2023 at 09:01:48AM +0900, Michael Paquier wrote: > On Mon, Feb 27, 2023 at 11:25:01AM -0800, Nathan Bossart wrote: >> I found a couple of more small changes required to make cfbot happy. >> Otherwise, it looks good to me. > > Thanks, I have confirmed the spots the CI was

Re: SQL JSON path enhanced numeric literals

2023-02-27 Thread Vik Fearing
On 2/27/23 20:13, Peter Eisentraut wrote: Attached is a patch to add nondecimal integer literals and underscores in numeric literals to the SQL JSON path language.  This matches the recent additions to the core SQL syntax.  It follows ECMAScript in combination with the current SQL draft.

Re: Doc update for pg_stat_statements normalization

2023-02-27 Thread Michael Paquier
On Mon, Feb 27, 2023 at 10:53:26PM +, Imseih (AWS), Sami wrote: > Wouldn't be less in terms of memory usage to just store the required > JumbleState fields in Query[Desc]? > > clocations_count, > highest_extern_param_id, > clocations_locations, > clocations_length Yes, these would be enough

Re: Non-superuser subscription owners

2023-02-27 Thread Jeff Davis
On Mon, 2023-02-27 at 14:10 -0500, Stephen Frost wrote: > I do think there are some use-cases for it, but agree that it'd be > better to encourage more use of SECURITY DEFINER and one approach to > that might be to have a way for users to explicitly say "don't run > code > that isn't mine or a

Re: verbose mode for pg_input_error_message?

2023-02-27 Thread Michael Paquier
On Mon, Feb 27, 2023 at 11:25:01AM -0800, Nathan Bossart wrote: > I found a couple of more small changes required to make cfbot happy. > Otherwise, it looks good to me. Thanks, I have confirmed the spots the CI was complaining about, so applied. There was an extra place that was not right in

Re: Provide PID data for "cannot wait on a latch owned by another process" in latch.c

2023-02-27 Thread Michael Paquier
On Mon, Feb 27, 2023 at 05:48:10PM +0900, Kyotaro Horiguchi wrote: > +1 for adding that information, I'm afraid that MyProcId is not > necessary since it is displayed in log lines in most cases. If you > want to display the both PIDs I suggest making them more distinctive. What would you

Re: Adding argument names to aggregate functions

2023-02-27 Thread Vik Fearing
On 2/27/23 14:22, Dagfinn Ilmari Mannsåker wrote: Hi hackers, I'm sure I'm not the only one who can never remember which way around the value and delimiter arguments go for string_agg() and has to look it up in the manual every time. To make it more convenient, here's a patch that adds

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-02-27 Thread Andres Freund
On 2023-02-27 14:58:30 -0500, Tom Lane wrote: > Agreed. I'll push this along with the earlier patch if there are > not objections. None here.

Re: Doc update for pg_stat_statements normalization

2023-02-27 Thread Imseih (AWS), Sami
>On Sat, Feb 25, 2023 at 01:59:04PM +, Imseih (AWS), Sami wrote:> >> The overhead of storing this additional private data for the life of the > query >> execution may not be desirable. >Okay, but why? Additional memory to maintain the JumbleState data in other structs, and

Re: Proposal: :SQL_EXEC_TIME (like :ROW_COUNT) Variable (psql)

2023-02-27 Thread Kirk Wolak
On Sun, Feb 26, 2023 at 11:45 PM Pavel Stehule wrote: > po 27. 2. 2023 v 5:08 odesílatel Kirk Wolak napsal: > >> On Fri, Feb 24, 2023 at 10:56 PM Kirk Wolak wrote: >> >>> On Fri, Feb 24, 2023 at 2:11 AM Gurjeet Singh wrote: >>> On Thu, Feb 23, 2023 at 8:42 PM Kirk Wolak wrote: >>>

Re: WIN32 pg_import_system_collations

2023-02-27 Thread Juan José Santamaría Flecha
El lun, 27 feb 2023, 23:05, Juan José Santamaría Flecha < juanjo.santama...@gmail.com> escribió: > > The command that's failing is "SET lc_time TO 'de_DE';", and that area of > code is untouched by this patch. As mentioned in [1], the problem seems to > come from a Windows bug that the CI images

Re: WIN32 pg_import_system_collations

2023-02-27 Thread Juan José Santamaría Flecha
On Mon, Feb 27, 2023 at 1:10 PM Andrew Dunstan wrote: > On 2023-02-26 Su 16:02, Andrew Dunstan wrote: > > Now that I have removed the barrier to testing this in the buildfarm, and > added an appropriate locale setting to drongo, we can see that this test > fails like this: > > > diff -w -U3 >

Re: refactoring relation extension and BufferAlloc(), faster COPY

2023-02-27 Thread Andres Freund
Hi, On 2023-02-27 18:06:22 +0200, Heikki Linnakangas wrote: > We also do this in freespace.c and visibilitymap.c: > > /* Extend as needed. */ > while (fsm_nblocks_now < fsm_nblocks) > { > PageSetChecksumInplace((Page) pg.data, fsm_nblocks_now); > > smgrextend(reln,

Re: PGDOCS - sgml linkend using single-quotes

2023-02-27 Thread Peter Smith
On Mon, Feb 27, 2023 at 7:04 PM Heikki Linnakangas wrote: > ... > > There were also a few "id" attributes using single-quotes. Fixed those > too, and pushed. Thanks! > Thankyou for pushing. -- Kind Regards, Peter Smith. Fujitsu Australia

Re: Option to not use ringbuffer in VACUUM, using it in failsafe mode

2023-02-27 Thread Andres Freund
Hi, On 2023-02-22 16:32:53 -0500, Melanie Plageman wrote: > I was wondering about the status of the autovacuum wraparound failsafe > test suggested in [1]. I don't see it registered for the March's > commitfest. I'll probably review it since it will be useful for this > patchset. It's pretty

Re: Non-superuser subscription owners

2023-02-27 Thread Robert Haas
On Mon, Feb 27, 2023 at 1:25 PM Jeff Davis wrote: > I think you are saying that we should still run Alice's code with the > privileges of Bob, but somehow make that safe(r) for Bob. Is that > right? Yeah. That's the idea I was floating, at least. > That sounds hard, and I'm still stuck at the

Re: tests against running server occasionally fail, postgres_fdw & tenk1

2023-02-27 Thread Tom Lane
Andres Freund writes: > On 2023-02-27 12:42:00 -0500, Tom Lane wrote: >> I went ahead and coded it that way, and it doesn't look too awful. >> Any objections? > Looks good to me. > I think it'd be an indication of a bug around the invalidation handling if the > terminations were required. So

Re: Auth extensions, with an LDAP/SCRAM example [was: Proposal: Support custom authentication methods using hooks]

2023-02-27 Thread Stephen Frost
Greetings, * Jacob Champion (jchamp...@timescale.com) wrote: > This patchset should ideally have required zero client side changes, but > because our SCRAM implementation is slightly nonstandard too -- it > doesn't embed the username into the SCRAM data -- libpq can't talk to > the OpenLDAP/Cyrus

Re: [PoC] Federated Authn/z with OAUTHBEARER

2023-02-27 Thread Stephen Frost
Greetings, * Andrey Chudnovsky (achudnovs...@gmail.com) wrote: > > This really doesn't feel like a great area to try and do hooks or > > similar in, not the least because that approach has been tried and tried > > again (PAM, GSSAPI, SASL would all be examples..) and frankly none of > > them has

Re: Move defaults toward ICU in 16?

2023-02-27 Thread Tom Lane
Jeff Davis writes: > On Fri, 2023-02-24 at 15:54 -0800, Jeff Davis wrote: >> 0001: default autoconf to build with ICU (meson already uses >> 'auto') > What's the best way to prepare for the impact of this on the buildfarm? > How should we migrate to using --without-icu for those animals not >

Re: psql: Add role's membership options to the \du+ command

2023-02-27 Thread Pavel Luzanov
On 22.02.2023 00:34, David G. Johnston wrote: This is the format I've gone for (more-or-less) in my RoleGraph view (I'll be sharing it publicly in the near future). bob from grantor (a, s, i) \n adam from postgres (a, s, i) \n emily from postgres (empty) I think this is a good compromise.

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-02-27 Thread Tom Lane
Melanie Plageman writes: > On Mon, Feb 27, 2023 at 10:30 AM Tom Lane wrote: >> The risk of needing to cast when using the "int" loop variable >> as an enum is obviously the downside of that approach, but we have >> not seen any indication that any compilers actually do warn. >> It's interesting

Re: Allow logical replication to copy tables in binary format

2023-02-27 Thread Melih Mutlu
Hi, Thanks for all of your reviews! So, I made some changes in the v10 according to your comments. 1- copy_format is changed to a boolean parameter copy_binary. It sounds easier to use a boolean to enable/disable binary copy. Default value is false, so nothing changes in the current behaviour

Re: tests against running server occasionally fail, postgres_fdw & tenk1

2023-02-27 Thread Andres Freund
Hi, On 2023-02-27 12:42:00 -0500, Tom Lane wrote: > I wrote: > > Hah - I thought of a solution. We can avoid this race condition if > > we make the remote session itself inspect pg_stat_activity and > > return its displayed application_name. Just need a foreign table > > that maps onto

Re: Move defaults toward ICU in 16?

2023-02-27 Thread Jeff Davis
On Fri, 2023-02-24 at 15:54 -0800, Jeff Davis wrote: >   0001: default autoconf to build with ICU (meson already uses > 'auto') What's the best way to prepare for the impact of this on the buildfarm? How should we migrate to using --without-icu for those animals not currently specifying

SQL JSON path enhanced numeric literals

2023-02-27 Thread Peter Eisentraut
Attached is a patch to add nondecimal integer literals and underscores in numeric literals to the SQL JSON path language. This matches the recent additions to the core SQL syntax. It follows ECMAScript in combination with the current SQL draft. Internally, all the numeric literal parsing of

Re: Non-superuser subscription owners

2023-02-27 Thread Stephen Frost
Greetings, * Jeff Davis (pg...@j-davis.com) wrote: > On Mon, 2023-02-27 at 10:45 -0500, Robert Haas wrote: > > Suppose Alice owns a table and attaches a trigger to it. If > > Bob inserts into that table, I think we have to run the trigger, > > because Alice is entitled to assume that, for

Re: meson / pg_regress --no-locale

2023-02-27 Thread Andrew Dunstan
On 2023-02-27 Mo 09:34, Andrew Dunstan wrote: I can't see an obvious way to run the regression tests via meson with the --no-locale setting. This is particularly important on Windows. The buildfarm client first runs the regression tests with this setting and then tests (via installcheck)

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-02-27 Thread Melanie Plageman
On Mon, Feb 27, 2023 at 10:30 AM Tom Lane wrote: > > Melanie Plageman writes: > > Attached is a patch to remove the *_FIRST macros. > > I was going to add in code to change > > > for (IOObject io_object = 0; io_object < IOOBJECT_NUM_TYPES; > > io_object++) > > to > > for (IOObject

Re: Non-superuser subscription owners

2023-02-27 Thread Jeff Davis
On Mon, 2023-02-27 at 10:45 -0500, Robert Haas wrote: > Suppose Alice owns a table and attaches a trigger to it. If > Bob inserts into that table, I think we have to run the trigger, > because Alice is entitled to assume that, for example, any BEFORE > triggers she might have defined that block

Re: SLRUs in the main buffer pool - Page Header definitions

2023-02-27 Thread Stephen Frost
Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Mon, Feb 27, 2023 at 8:56 AM Heikki Linnakangas wrote: > > I'm not sure if I like that or not. I think we should clean up and > > finish the other patches that this builds on first, and then decide if > > we want to use the standard

Re: pg_dump versus hash partitioning

2023-02-27 Thread Tom Lane
Robert Haas writes: > Sure, but I was responding to your assertion that there's no case in > which --load-via-partition-root could cause a restore failure. I'm not > sure that's accurate. Perhaps it's not, but it's certainly far less likely to cause a restore failure than the behavior I want to

Re: pg_dump versus hash partitioning

2023-02-27 Thread Robert Haas
On Mon, Feb 27, 2023 at 12:50 PM Tom Lane wrote: > Robert Haas writes: > > On Mon, Feb 27, 2023 at 11:20 AM Tom Lane wrote: > >> Well, that's a user error not pg_dump's fault. Particularly so for hash > >> partitioning, where there is no defensible reason to make the partitions > >>

Re: pg_dump versus hash partitioning

2023-02-27 Thread Tom Lane
Robert Haas writes: > On Mon, Feb 27, 2023 at 11:20 AM Tom Lane wrote: >> Well, that's a user error not pg_dump's fault. Particularly so for hash >> partitioning, where there is no defensible reason to make the partitions >> semantically different. > I am still of the opinion that you're going

Re: libpq: PQgetCopyData() and allocation overhead

2023-02-27 Thread Jeroen Vermeulen
Done. Thanks for looking! Jelte Fennema pointed out that I should probably be using PQExpBuffer for this. I'll look into that later; this is a proof of concept, not a production-ready API proposal. Jeroen On Mon, 27 Feb 2023 at 14:48, Bharath Rupireddy <

Re: tests against running server occasionally fail, postgres_fdw & tenk1

2023-02-27 Thread Tom Lane
I wrote: > Hah - I thought of a solution. We can avoid this race condition if > we make the remote session itself inspect pg_stat_activity and > return its displayed application_name. Just need a foreign table > that maps onto pg_stat_activity. I went ahead and coded it that way, and it doesn't

Re: [PoC] Improve dead tuple storage for lazy vacuum

2023-02-27 Thread John Naylor
On Fri, Feb 24, 2023 at 3:41 PM Masahiko Sawada wrote: > > In v29 vacuum took twice as long (286 s vs. 573 s)? Not sure what happened there, and clearly I was looking at the wrong number :/ I scripted the test for reproducibility and ran it three times. Also included some variations (attached):

Re: pg_dump versus hash partitioning

2023-02-27 Thread Robert Haas
On Mon, Feb 27, 2023 at 11:20 AM Tom Lane wrote: > Well, that's a user error not pg_dump's fault. Particularly so for hash > partitioning, where there is no defensible reason to make the partitions > semantically different. I am still of the opinion that you're going down a dangerous path of

Re: Stale references to guc.c in comments/tests

2023-02-27 Thread Tom Lane
Daniel Gustafsson writes: > On 24 Feb 2023, at 16:19, Tom Lane wrote: >> Perhaps you could use "the GUC mechanisms" in these places, but it's a bit >> longer than "guc.c". Leaving such references alone seems OK too. > I've opted for mostly leaving them in the attached v2. This version seems

Re: pgsql: pg_rewind: Fix determining TLI when server was just promoted.

2023-02-27 Thread Robert Haas
On Thu, Feb 23, 2023 at 8:40 AM Heikki Linnakangas wrote: > This is arguably a bug fix, but don't backpatch because we haven't > really treated it as a bug so far. I guess I'm having trouble understanding why this is only arguably a bug fix. Seems like flat-out wrong behavior. -- Robert Haas

Re: pg_dump versus hash partitioning

2023-02-27 Thread Tom Lane
Robert Haas writes: > On Tue, Feb 14, 2023 at 2:21 PM Tom Lane wrote: >> This made me wonder if this could be a usable solution at all, but >> after thinking for awhile, I don't see how the claim about foreign key >> constraints is anything but FUD. pg_dump/pg_restore have sufficient >>

Re: SLRUs in the main buffer pool - Page Header definitions

2023-02-27 Thread Robert Haas
On Mon, Feb 27, 2023 at 8:56 AM Heikki Linnakangas wrote: > I'm not sure if I like that or not. I think we should clean up and > finish the other patches that this builds on first, and then decide if > we want to use the standard page header for the SLRUs or not. And if we > decide that we want

Re: refactoring relation extension and BufferAlloc(), faster COPY

2023-02-27 Thread Heikki Linnakangas
On 21/02/2023 18:33, Alvaro Herrera wrote: On 2023-Feb-21, Heikki Linnakangas wrote: +static BlockNumber +BulkExtendSharedRelationBuffered(Relation rel, +SMgrRelation smgr, +

Re: pg_dump versus hash partitioning

2023-02-27 Thread Robert Haas
On Tue, Feb 14, 2023 at 2:21 PM Tom Lane wrote: > This made me wonder if this could be a usable solution at all, but > after thinking for awhile, I don't see how the claim about foreign key > constraints is anything but FUD. pg_dump/pg_restore have sufficient > dependency logic to prevent that

Re: Non-superuser subscription owners

2023-02-27 Thread Robert Haas
On Wed, Feb 22, 2023 at 12:18 PM Jeff Davis wrote: > There are two questions: > > 1. Is the security situation with logical replication bad? Yes. You > nicely summarized just how bad. > > 2. Is it the same situation as accessing a table owned by a user you > don't absolutely trust? > > Regardless

Re: PATCH: Using BRIN indexes for sorted output

2023-02-27 Thread Matthias van de Meent
Hi, On Thu, 23 Feb 2023 at 17:44, Matthias van de Meent wrote: > > I'll see to further reviewing 0004 and 0005 when I have additional time. Some initial comments on 0004: > +/* > + * brin_minmax_ranges > + *Load the BRIN ranges and sort them. > + */ > +Datum >

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-02-27 Thread Tom Lane
Melanie Plageman writes: > Attached is a patch to remove the *_FIRST macros. > I was going to add in code to change > for (IOObject io_object = 0; io_object < IOOBJECT_NUM_TYPES; io_object++) > to > for (IOObject io_object = 0; (int) io_object < IOOBJECT_NUM_TYPES; > io_object++) I

Re: tests against running server occasionally fail, postgres_fdw & tenk1

2023-02-27 Thread Tom Lane
I wrote: > ... maybe we could do "select 1 from > pg_stat_activity where application_name = computed-pattern", but that > has the same problem that a cache flush might have terminated the > remote session. Hah - I thought of a solution. We can avoid this race condition if we make the remote

Re: Add LZ4 compression in pg_dump

2023-02-27 Thread gkokolatos
--- Original Message --- On Saturday, February 25th, 2023 at 3:05 PM, Justin Pryzby wrote: > > > On Fri, Feb 24, 2023 at 11:02:14PM -0600, Justin Pryzby wrote: > > > I have some fixes (attached) and questions while polishing the patch for > > zstd compression. The fixes are

meson / pg_regress --no-locale

2023-02-27 Thread Andrew Dunstan
I can't see an obvious way to run the regression tests via meson with the --no-locale setting. This is particularly important on Windows. The buildfarm client first runs the regression tests with this setting and then tests (via installcheck) against instances set up with its configured

Re: libpq: PQgetCopyData() and allocation overhead

2023-02-27 Thread Jelte Fennema
Instead of implementing new growable buffer logic in this patch. It seems much nicer to reuse the already existing PQExpBuffer type for this patch. On Mon, 27 Feb 2023 at 14:48, Bharath Rupireddy wrote: > > On Fri, Feb 10, 2023 at 5:49 PM Jeroen Vermeulen wrote: > > > > OK, I've updated the PR

Re: Add LZ4 compression in pg_dump

2023-02-27 Thread gkokolatos
--- Original Message --- On Sunday, February 26th, 2023 at 3:59 PM, Tomas Vondra wrote: > > > > > On 2/25/23 06:02, Justin Pryzby wrote: > > > I have some fixes (attached) and questions while polishing the patch for > > zstd compression. The fixes are small and could be

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-02-27 Thread Melanie Plageman
On Sun, Feb 26, 2023 at 1:52 PM Tom Lane wrote: > > I wrote: > > The issue seems to be that code like this: > > ... > > is far too cute for its own good. > > Oh, there's another thing here that qualifies as too-cute: loops like > > for (IOObject io_object = IOOBJECT_FIRST; >

Re: Should vacuum process config file reload more often

2023-02-27 Thread Masahiko Sawada
Hi, On Fri, Feb 24, 2023 at 7:08 AM Melanie Plageman wrote: > > Hi, > > Users may wish to speed up long-running vacuum of a large table by > decreasing autovacuum_vacuum_cost_delay/vacuum_cost_delay, however the > config file is only reloaded between tables (for autovacuum) or after > the

Re: PATCH: Using BRIN indexes for sorted output

2023-02-27 Thread Matthias van de Meent
On Fri, 24 Feb 2023, 20:14 Tomas Vondra, wrote: > > On 2/24/23 19:03, Matthias van de Meent wrote: > > On Thu, 23 Feb 2023 at 19:48, Tomas Vondra > >> Yeah, that sounds like a bug. Also a sign the tests should have some > >> by-ref data types (presumably there are none, as that would certainly >

Re: SLRUs in the main buffer pool - Page Header definitions

2023-02-27 Thread Heikki Linnakangas
On 08/02/2023 22:26, Andres Freund wrote: On 2023-02-08 20:04:52 +, Bagga, Rishu wrote: To summarize, our underlying effort is to move the SLRUs to the buffer cache. We were working with Thomas Munro off a patch he introduced here [1]. Munro’s patch moves SLRUs to the buffer cache by

Re: libpq: PQgetCopyData() and allocation overhead

2023-02-27 Thread Bharath Rupireddy
On Fri, Feb 10, 2023 at 5:49 PM Jeroen Vermeulen wrote: > > OK, I've updated the PR with a benchmark (in the main directory). > > On this benchmark I'm seeing about a 24% reduction in "user" CPU time, and a > 8% reduction in "system" CPU time. (Almost no reduction in wall-clock time.) I can

Re: meson vs make: missing/inconsistent ENV

2023-02-27 Thread Andrew Dunstan
On 2023-02-27 Mo 07:33, Andrew Dunstan wrote: On 2023-02-27 Mo 06:17, Dagfinn Ilmari Mannsåker wrote: Justin Pryzby writes: On Sun, Feb 26, 2023 at 03:21:04PM -0800, Andres Freund wrote: Is there any consideration of promoting these or other warnings to fatal? You mean the perl

Re: Stale references to guc.c in comments/tests

2023-02-27 Thread Daniel Gustafsson
> On 24 Feb 2023, at 16:19, Tom Lane wrote: > > Daniel Gustafsson writes: >> I happened to notice that there were a few references to guc.c regarding >> variables, which with the recent refactoring in 0a20ff54f have become stale. >> Attached is a trivial patch to instead point to guc_tables.c.

Re: Allow logical replication to copy tables in binary format

2023-02-27 Thread Bharath Rupireddy
On Tue, Feb 21, 2023 at 7:18 PM Bharath Rupireddy wrote: > > On Mon, Feb 20, 2023 at 5:17 PM Melih Mutlu wrote: > > > > Thanks for letting me know. > > Attached the fixed version of the patch. > > Thanks. I have few comments on v9 patch: > > 1. > +/* Do not allow binary =

Adding argument names to aggregate functions

2023-02-27 Thread Dagfinn Ilmari Mannsåker
Hi hackers, I'm sure I'm not the only one who can never remember which way around the value and delimiter arguments go for string_agg() and has to look it up in the manual every time. To make it more convenient, here's a patch that adds proargnames to its pg_proc entries so that it can be seen

[PoC] Add CANONICAL option to xmlserialize

2023-02-27 Thread Jim Jones
Hi, In order to compare pairs of XML documents for equivalence it is necessary to convert them first to their canonical form, as described at W3C Canonical XML 1.1.[1] This spec basically defines a standard physical representation of xml documents that have more then one possible

Re: buildfarm + meson

2023-02-27 Thread Juan José Santamaría Flecha
On Fri, Feb 24, 2023 at 2:22 PM Andrew Dunstan wrote: > > On drongo, this test isn't failing, and I think the reason is that it runs > "make NO_LOCALE=1 check" so it never gets a database with win1252 encoding. > > I'm going to try adding a win1252 test to drongo's locales. > What seems to be

Add error functions: erf() and erfc()

2023-02-27 Thread Dean Rasheed
Now that we have random_normal(), it seems like it would be useful to add the error functions erf() and erfc(), which I think are potentially useful to the people who will find random_normal() useful, and possibly others. An immediate use for erf() is that it allows us to do a Kolmogorov-Smirnov

Re: meson vs make: missing/inconsistent ENV

2023-02-27 Thread Andrew Dunstan
On 2023-02-27 Mo 06:17, Dagfinn Ilmari Mannsåker wrote: Justin Pryzby writes: On Sun, Feb 26, 2023 at 03:21:04PM -0800, Andres Freund wrote: Is there any consideration of promoting these or other warnings to fatal? You mean the perl warnings? Yes - it'd be nice if the warnings caused an

Re: meson vs make: missing/inconsistent ENV

2023-02-27 Thread Dagfinn Ilmari Mannsåker
Dagfinn Ilmari Mannsåker writes: > Justin Pryzby writes: > >> On Sun, Feb 26, 2023 at 03:21:04PM -0800, Andres Freund wrote: >>> > Is there any consideration of promoting these or other warnings to >>> > fatal? >>> >>> You mean the perl warnings? >> >> Yes - it'd be nice if the warnings caused

Re: how does postgresql handle LOB/CLOB/BLOB column data that dies before the query ends

2023-02-27 Thread Noel Grandin
On Sat, 25 Feb 2023 at 19:06, Tom Lane wrote: > That could be a piece of the puzzle, yeah. > > Thank you very much, this conversion has been a great help. Regards, Noel Grandin

Re: WIN32 pg_import_system_collations

2023-02-27 Thread Andrew Dunstan
On 2023-02-26 Su 16:02, Andrew Dunstan wrote: On 2023-01-03 Tu 08:48, Peter Eisentraut wrote: On 09.12.22 13:48, Juan José Santamaría Flecha wrote: On Thu, Dec 1, 2022 at 8:46 AM Peter Eisentraut > wrote:     What is the status of this now?  I

Re: meson vs make: missing/inconsistent ENV

2023-02-27 Thread Dagfinn Ilmari Mannsåker
Justin Pryzby writes: > On Sun, Feb 26, 2023 at 03:21:04PM -0800, Andres Freund wrote: >> > Is there any consideration of promoting these or other warnings to >> > fatal? >> >> You mean the perl warnings? > > Yes - it'd be nice if the warnings caused an obvious failure to allow > addressing the

Re: SQL/JSON revisited

2023-02-27 Thread Amit Langote
On Mon, Feb 27, 2023 at 4:45 PM Amit Langote wrote: > On Tue, Feb 21, 2023 at 2:25 AM Andres Freund wrote: > > Evaluating N expressions for a json table isn't a good approach, both memory > > and CPU efficiency wise. > > Are you referring to JsonTableInitOpaque() initializing all these >

Re: Allow logical replication to copy tables in binary format

2023-02-27 Thread Bharath Rupireddy
On Fri, Feb 24, 2023 at 8:32 AM Peter Smith wrote: > > Here is my summary of this thread so far, plus some other thoughts. Thanks. > 1. Initial Goal > -- > > Currently, the CREATE SUBSCRIPTION ... WITH(binary=true) mode does > data replication in binary mode, but tablesync COPY

Re: pg_upgrade and logical replication

2023-02-27 Thread Amit Kapila
On Sun, Feb 26, 2023 at 8:35 AM Julien Rouhaud wrote: > > On Sat, Feb 25, 2023 at 11:24:17AM +0530, Amit Kapila wrote: > > > > > > The new command is of the form > > > > > > ALTER SUBSCRIPTION name ADD TABLE (relid = X, state = 'Y', lsn = 'Z/Z') > > > > > > with the lsn part being optional. > > >

RE: Rework LogicalOutputPluginWriterUpdateProgress

2023-02-27 Thread wangw.f...@fujitsu.com
On Thur, Feb 23, 2023 at 18:41 PM Kuroda, Hayato/�\田 隼人 wrote: > Dear Wang, > > Thank you for making the patch. IIUC your patch basically can achieve that > output plugin > does not have to call UpdateProgress. Thanks for your review and comments. > I think the basic approach is as follows,

  1   2   >