Inconsistency in vacuum behavior

2023-01-16 Thread Alexander Pyhalov
Hi. We've run regress isolation tests on partitioned tables and found interesting VACUUM behavior. I'm not sure, if it's intended. In the following example, partitioned tables and regular tables behave differently: CREATE TABLE vacuum_tab (a int) PARTITION BY HASH (a); CREATE TABLE vacuum_t

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

2023-01-16 Thread Masahiko Sawada
On Mon, Jan 16, 2023 at 2:02 PM John Naylor wrote: > > On Thu, Jan 12, 2023 at 9:51 PM Masahiko Sawada wrote: > > > > On Thu, Jan 12, 2023 at 5:21 PM John Naylor > > wrote: > > > > > > Okay, I'll squash the previous patch and work on cleaning up the > > > internals. I'll keep the external APIs

Improve LATERAL join case in test memoize.sql

2023-01-16 Thread Richard Guo
I happened to notice we have the case in memoize.sql that tests for memoize node with LATERAL joins, which is -- Try with LATERAL joins SELECT explain_memoize(' SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1, LATERAL (SELECT t2.unique1 FROM tenk1 t2 WHERE t1.twenty = t2.unique1) t2 WHERE t1.unique1

Re: Ability to reference other extensions by schema in extension scripts

2023-01-16 Thread Sandro Santilli
On Thu, Dec 15, 2022 at 08:04:22AM -0500, Regina Obe wrote: > > On Tue, Nov 22, 2022 at 11:24:19PM -0500, Regina Obe wrote: > > > > > If an extension is required by another extension and that required > > > extension schema is referenced in the extension scripts using the > > > @extschema:extensio

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

2023-01-16 Thread John Naylor
On Mon, Jan 16, 2023 at 3:18 PM Masahiko Sawada wrote: > > On Mon, Jan 16, 2023 at 2:02 PM John Naylor > wrote: > > > Thanks! cfbot complaints about some warnings but these are expected > (due to unused delete routines etc). But one reported error[1] might > be relevant with 0002 patch? > [05:4

macOS versioned sysroot

2023-01-16 Thread Peter Eisentraut
src/tools/darwin_sysroot (previously in src/template/darwin) contains this: # [...] Using a version-specific sysroot seems # desirable, so if the path is a non-version-specific symlink, expand # it. On my system, the non-version-specific symlink is /Applications/Xcode.app/Contents/Developer/Pla

Re: Add BufFileRead variants with short read and EOF detection

2023-01-16 Thread Peter Eisentraut
On 14.01.23 07:01, Amit Kapila wrote: On Thu, Jan 12, 2023 at 2:44 PM Peter Eisentraut wrote: On 10.01.23 07:20, Amit Kapila wrote: Yeah, we can do that but not sure if it is worth doing any of those because there are already other places that don't use the exact context. Ok, updated patche

Re: cutting down the TODO list thread

2023-01-16 Thread John Naylor
I wrote: > We could also revise the developer FAQ: > - remove phrase "Outstanding features are detailed in Todo." > - add suggestion to to check the Todo or Not_worth_doing pages to see if the desired feature is undesirable or problematic > - rephrase "Working in isolation is not advisable because

Re: Polyphase merge is obsolete

2023-01-16 Thread Peter Eisentraut
On 21.11.22 10:29, Peter Eisentraut wrote: On 21.11.22 00:57, Heikki Linnakangas wrote: On 19/11/2022 13:00, Peter Eisentraut wrote: On 18.10.21 14:15, Heikki Linnakangas wrote: On 05/10/2021 20:24, John Naylor wrote: I've had a chance to review and test out the v5 patches. Thanks! I fixed

[PATCH] Clarify the behavior of the system when approaching XID wraparound

2023-01-16 Thread Aleksander Alekseev
Hi hackers, While playing with 64-bit XIDs [1] my attention was drawn by the following statement in the docs [2]: """ If these warnings are ignored, the system will shut down and refuse to start any new transactions once there are fewer than three million transactions left until wraparound. """

Re: [EXTERNAL] Re: [PATCH] Support using "all" for the db user in pg_ident.conf

2023-01-16 Thread Jelte Fennema
> Still, I am having a few second thoughts about 0003 after thinking > about it over the weekend. Except if I am missing something, there > are no issues with 0004 if we keep the current behavior of always > replacing \1 even if pg-user is quoted? I would certainly add a new > test case either wa

Re: Refactor recordExtObjInitPriv()

2023-01-16 Thread Peter Eisentraut
On 12.01.23 18:40, Nathan Bossart wrote: On Thu, Jan 12, 2023 at 12:20:50PM -0500, Tom Lane wrote: Peter Eisentraut writes: On 12.01.23 01:04, Nathan Bossart wrote: -classoid == AggregateRelationId || I noticed that AggregateRelationId isn't listed in the ObjectPropert

RE: Exit walsender before confirming remote flush in logical replication

2023-01-16 Thread Hayato Kuroda (Fujitsu)
Dear Horiguchi-san, Amit, > At Fri, 13 Jan 2023 16:41:08 +0530, Amit Kapila > wrote in > > Okay, but what happens in the case of physical replication when > > synchronous_commit = remote_apply? In that case, won't it ensure that > > apply has also happened? If so, then shouldn't the time delay fe

RE: Exit walsender before confirming remote flush in logical replication

2023-01-16 Thread Hayato Kuroda (Fujitsu)
Dear Horiguchi-san, > If I'm grabbing the discussion here correctly, in my memory, it is > because: physical replication needs all records that have written on > primary are written on standby for switchover to succeed. It is > annoying that normal shutdown occasionally leads to switchover > failu

Re: pgsql: Doc: add XML ID attributes to and tags.

2023-01-16 Thread Peter Eisentraut
On 12.01.23 00:05, Tom Lane wrote: That reminds me that I was going to suggest fixing the few existing variances from the "use '-' not '_'" policy: $ grep 'id="[a-zA-Z0-9-]*_' *sgml ref/*sgml config.sgml: should be fixed libpq.sgml: libpq.sgml: libpq.sgml: libpq.

Re: Allow tailoring of ICU locales with custom rules

2023-01-16 Thread Peter Eisentraut
On 11.01.23 03:50, vignesh C wrote: On Thu, 5 Jan 2023 at 20:45, Peter Eisentraut wrote: Patch needed a rebase; no functionality changes. The patch does not apply on top of HEAD as in [1], please post a rebased patch: Updated patch attached.From 8744abe8e56e25b8d76d1201c4fa40af273a09de Mon

Re: Small miscellaneus fixes (Part II)

2023-01-16 Thread Ranier Vilela
Em seg., 16 de jan. de 2023 às 03:28, John Naylor < john.nay...@enterprisedb.com> escreveu: > > I wrote: > > ...but arguably the earlier check is close enough that it's silly to > assert in the "else" branch, and I'd be okay with just nuking those lines. > Another thing that caught my attention is

Re: Using AF_UNIX sockets always for tests on Windows

2023-01-16 Thread Juan José Santamaría Flecha
Hello, On Fri, Dec 2, 2022 at 1:03 AM Thomas Munro wrote: > > 1. Teach mkdtemp() to make a non-world-accessible directory. This is > required to be able to make a socket that other processes can't > connect to, to match the paranoia level used on Unix. This was > written just by reading docum

Re: Rethinking the implementation of ts_headline()

2023-01-16 Thread Alvaro Herrera
On 2022-Nov-25, Tom Lane wrote: > After further contemplation of bug #17691 [1], I've concluded that > what I did in commit c9b0c678d was largely misguided. For one > thing, the new hlCover() algorithm no longer finds shortest-possible > cover strings: if your query is "x & y" and the text is lik

Record queryid when auto_explain.log_verbose is on

2023-01-16 Thread torikoshia
Hi, As far as I read the manual below, auto_explain.log_verbose should record logs equivalent to VERBOSE option of EXPLAIN. -- https://www.postgresql.org/docs/devel/auto-explain.html auto_explain.log_verbose controls whether verbose details are printed when an execution plan is logged; it's

Re: [PATCH] Clarify the behavior of the system when approaching XID wraparound

2023-01-16 Thread Aleksander Alekseev
Hi hackers, > The proposed patchset changes the documentation and the error messages > accordingly, making them less misleading. 0001 corrects the > documentation but doesn't touch the code. 0002 and 0003 correct the > messages shown when approaching xidWrapLimit and xidWarnLimit > accordingly. A

Re: PL/Python: Fix return in the middle of PG_TRY() block.

2023-01-16 Thread Xing Guo
Hi, I revised my patch, added the missing one that Nathan mentioned. Are there any unsafe codes in pltcl.c? The return statement is in the PG_CATCH() block, I think the exception stack has been recovered in PG_CATCH block so the return statement in PG_CATCH block should be ok? ``` PG_TRY(); { UT

Re: Record queryid when auto_explain.log_verbose is on

2023-01-16 Thread Julien Rouhaud
Hi, On Mon, Jan 16, 2023 at 09:36:59PM +0900, torikoshia wrote: > > As far as I read the manual below, auto_explain.log_verbose should record > logs equivalent to VERBOSE option of EXPLAIN. Ah good catch, that's clearly an oversight! > Attached patch makes auto_explain also print query identifie

Re: Make EXPLAIN generate a generic plan for a parameterized query

2023-01-16 Thread Jim Jones
Hi Laurenz, I'm testing your patch and the GENERIC_PLAN parameter seems to work just OK .. db=# CREATE TABLE t (col numeric); CREATE TABLE db=# CREATE INDEX t_col_idx ON t (col); CREATE INDEX db=# INSERT INTO t SELECT random() FROM generate_series(1,10) ; INSERT 0 10 db=# EXPLAIN (GENE

Re: Inconsistency in vacuum behavior

2023-01-16 Thread Nikita Malakhov
Hi! I've checked this expand_vacuum_rel() and made a quick fix for this.Here's the result of the test: postgres@postgres=# set role regress_vacuum_conflict; SET Time: 0.369 ms postgres@postgres=> vacuum vacuum_tab; WARNING: permission denied to vacuum "vacuum_tab", skipping it WARNING: permissi

Re: Generating code for query jumbling through gen_node_support.pl

2023-01-16 Thread Peter Eisentraut
On 13.01.23 08:54, Michael Paquier wrote: Using a "jumble_ignore" flag is equally invasive to using an "jumble_include" flag for each field, I am afraid, as the number of fields in the nodes included in jumbles is pretty equivalent to the number of fields ignored. I tend to prefer the approach o

Re: Inconsistency in vacuum behavior

2023-01-16 Thread Nikita Malakhov
Hi! Here's the patch that fixes this case, please check it out. The patch adds vacuum_is_permitted_for_relation() check before adding partition relation to the vacuum list, and if permission is denied the relation is not added, so it is not passed to vacuum_rel() and there are no try to acquire th

Re: Adding CommandID to heap xlog records

2023-01-16 Thread vignesh C
On Thu, 3 Nov 2022 at 15:06, Ian Lawrence Barwick wrote: > > 2022年9月30日(金) 1:04 Matthias van de Meent : > > > > On Wed, 28 Sept 2022 at 19:40, Bruce Momjian wrote: > > > > > > On Thu, Sep 22, 2022 at 11:12:32PM +0200, Matthias van de Meent wrote: > > > > On Thu, 8 Sept 2022 at 23:24, Tom Lane wr

Re: Allow parallel plan for referential integrity checks?

2023-01-16 Thread vignesh C
On Mon, 12 Dec 2022 at 22:06, Frédéric Yhuel wrote: > > > > On 12/11/22 06:29, Ian Lawrence Barwick wrote: > > 2022年7月26日(火) 20:58 Frédéric Yhuel : > >> > >> > >> > >> On 4/14/22 14:25, Frédéric Yhuel wrote: > >>> > >>> > >>> On 3/19/22 01:57, Imseih (AWS), Sami wrote: > I looked at your patc

Re: [PATCH] Completed unaccent dictionary with many missing characters

2023-01-16 Thread vignesh C
On Fri, 4 Nov 2022 at 04:59, Ian Lawrence Barwick wrote: > > 2022年7月13日(水) 19:13 Przemysław Sztoch : > > > > Dear Michael P., > > > > 3. The matter is not that simple. When I change priorities (ie > > Latin-ASCII.xml is less important than Unicode decomposition), > > then "U + 33D7" changes not t

Re: [PATCH] Fix alter subscription concurrency errors

2023-01-16 Thread vignesh C
On Wed, 12 Oct 2022 at 10:48, Michael Paquier wrote: > > On Fri, Sep 09, 2022 at 06:37:07PM +0200, Alvaro Herrera wrote: > > Would it work to use get_object_address() instead? That would save > > having to write a lookup-and-lock function with a retry loop for each > > object type. > > Jeite, thi

Re: [PATCH] Add <> support to sepgsql_restorecon

2023-01-16 Thread Ted Toth
On Sun, Jan 15, 2023 at 1:11 PM Joe Conway wrote: > On 11/21/22 17:35, Joe Conway wrote: > > On 11/21/22 15:57, Ted Toth wrote: > >> In SELinux file context files you can specify <> for a file > >> meaning you don't want restorecon to relabel it. <> is > >> especially useful in an SELinux MLS env

Re: [PATCH] Add <> support to sepgsql_restorecon

2023-01-16 Thread Joe Conway
On 1/16/23 09:55, Ted Toth wrote: On Sun, Jan 15, 2023 at 1:11 PM Joe Conway > wrote: On 11/21/22 17:35, Joe Conway wrote: > On 11/21/22 15:57, Ted Toth wrote: >> In SELinux file context files you can specify <> for a file >> meaning you don't wan

Re: macOS versioned sysroot

2023-01-16 Thread Tom Lane
Peter Eisentraut writes: > src/tools/darwin_sysroot (previously in src/template/darwin) contains this: > # [...] Using a version-specific sysroot seems > # desirable, so if the path is a non-version-specific symlink, expand > # it. > This code has been whacked around quite a bit, so it's hard to

Re: pgsql: Add new GUC createrole_self_grant.

2023-01-16 Thread Robert Haas
On Sat, Jan 14, 2023 at 8:12 PM David G. Johnston wrote: > OK, given all of that, I suggest reworking the first paragraph of security > definer functions safely to something like the following: > > (Replace: Because a SECURITY DEFINER function is executed with the privileges > of the user that o

Re: PL/Python: Fix return in the middle of PG_TRY() block.

2023-01-16 Thread Tom Lane
Xing Guo writes: > Are there any unsafe codes in pltcl.c? The return statement is in the > PG_CATCH() block, I think the exception stack has been recovered in > PG_CATCH block so the return statement in PG_CATCH block should be ok? Yes, the stack has already been unwound at the start of a PG_CATC

Re: pgsql: Add new GUC createrole_self_grant.

2023-01-16 Thread David G. Johnston
On Monday, January 16, 2023, Robert Haas wrote: > > > I don't really think there's too much wrong with what I wrote in the > patch as proposed, and I would like to get it committed and move on > without getting drawn into a wide-ranging discussion of every way in > which we might be able to improv

Re: allowing for control over SET ROLE

2023-01-16 Thread Robert Haas
On Fri, Jan 13, 2023 at 2:17 AM Noah Misch wrote: > Since the text is superfluous but not wrong, I won't insist. OK, committed as I had it, then. To me, the text isn't superfluous, because otherwise the connection to what has been said in the previous sentence seems tenuous, which impacts unders

Re: pgsql: Add new GUC createrole_self_grant.

2023-01-16 Thread Robert Haas
On Mon, Jan 16, 2023 at 10:33 AM David G. Johnston wrote: > I’m moving on as well. Go with what you have. I have my personal > understanding clarified at this point. If the docs need more work people > will ask questions to help guide such work. Yeah, I hope so. It's becoming increasingly c

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-16 Thread Robert Haas
On Fri, Jan 13, 2023 at 9:09 PM Andres Freund wrote: > > > If I understand the patch correctly, we now have the following age based > > > thresholds for av: > > > > > > - force-enable autovacuum: > > > oldest_datfrozenxid + autovacuum_freeze_max_age < nextXid > > > - autovacuum based on age: > >

Re: Logical replication timeout problem

2023-01-16 Thread Ashutosh Bapat
On Mon, Jan 9, 2023 at 4:08 PM wangw.f...@fujitsu.com wrote: > > On Fri, Jan 6, 2023 at 15:06 PM Ashutosh Bapat > wrote: > > I'm not sure if we need to add global variables or member variables for a > cumulative count that is only used here. How would you feel if I add some > comments when decla

Re: Rethinking the implementation of ts_headline()

2023-01-16 Thread Tom Lane
Alvaro Herrera writes: > I came across #17556 which contains a different test for this, and I'm > not sure that this patch changes things completely for the better. Thanks for looking at my patch. However ... > That is, once past the 5000 words of distance, it fails to find a good > cover, but

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

2023-01-16 Thread Tomas Vondra
Hi Amit, Thanks for the patch, the changes seem reasonable to me and it does fix the issue in the sequence decoding patch. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: Logical replication timeout problem

2023-01-16 Thread Ashutosh Bapat
On Wed, Jan 11, 2023 at 4:11 PM wangw.f...@fujitsu.com wrote: > > On Mon, Jan 9, 2023 at 13:04 PM Amit Kapila wrote: > > > > Thanks for your comments. > > > One more thing, I think it would be better to expose a new callback > > API via reorder buffer as suggested previously [2] similar to other

Re: Inconsistency in vacuum behavior

2023-01-16 Thread Alexander Pyhalov
Nikita Malakhov писал 2023-01-16 17:26: Hi! Here's the patch that fixes this case, please check it out. The patch adds vacuum_is_permitted_for_relation() check before adding partition relation to the vacuum list, and if permission is denied the relation is not added, so it is not passed to vacuu

Re: Make EXPLAIN generate a generic plan for a parameterized query

2023-01-16 Thread Tom Lane
Jim Jones writes: > However, when GENERIC_PLAN is used combined with BUFFERS, the 'Buffers' > node is shown the first time the query executed in a session: > psql (16devel) > Type "help" for help. > postgres=# \c db > You are now connected to database "db" as user "postgres". > db=# EXPLAIN (BU

Re: Inconsistency in vacuum behavior

2023-01-16 Thread Nikita Malakhov
Hi, Currently there is no error in this case, so additional thrown error would require a new test. Besides, throwing an error here does not make sense - it is just a check for a vacuum permission, I think the right way is to just skip a relation that is not suitable for vacuum. Any thoughts or obj

Re: doc: add missing "id" attributes to extension packaging page

2023-01-16 Thread Karl O. Pinc
On Sun, 15 Jan 2023 18:01:50 -0600 "Karl O. Pinc" wrote: > Regards XSLT: > > I believe the XSLT needs work. > I believe that overriding the XSLT by copying the original and making > modifications is the "wrong way" (TM). I think that the right way is > to declare a xsl:default-mode somewhere i

Re: Inconsistency in vacuum behavior

2023-01-16 Thread Alexander Pyhalov
Nikita Malakhov писал 2023-01-16 20:12: Hi, Currently there is no error in this case, so additional thrown error would require a new test. Besides, throwing an error here does not make sense - it is just a check for a vacuum permission, I think the right way is to just skip a relation that is no

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-16 Thread Andres Freund
Hi, On 2023-01-02 14:28:20 +0100, David Geier wrote: > I also somewhat improved the accuracy of the cycles to milli- and > microseconds conversion functions by having two more multipliers with higher > precision. For microseconds we could also keep the computation integer-only. > I'm wondering wha

Re: New strategies for freezing, advancing relfrozenxid early

2023-01-16 Thread Peter Geoghegan
On Sun, Jan 15, 2023 at 9:13 PM Dilip Kumar wrote: > I have looked into the patch set, I think 0001 looks good to me about > 0002 I have a few questions, 0003 I haven't yet looked at Thanks for taking a look. > I think '(nextXID - cutoffs->relfrozenxid) / freeze_table_age' should > be the actual

Re: Record queryid when auto_explain.log_verbose is on

2023-01-16 Thread Justin Pryzby
On Mon, Jan 16, 2023 at 09:36:59PM +0900, torikoshia wrote: > Attached patch makes auto_explain also print query identifiers. This was asked during the initial patch; does your patch address the issues here ? https://www.postgresql.org/message-id/20200308142644.vlihk7djpwqjkp7w%40nol -- Justin

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-01-16 Thread Andrew Dunstan
On 2023-01-15 Su 18:37, Tom Lane wrote: > Andrew Dunstan writes: >> Those replacement lines are very difficult to read. I think use of >> extended regexes and some multi-part replacements would help. I'll have >> a go at that tomorrow. > Yeah, after I wrote that code I remembered about \Q ... \E,

almost-super-user problems that we haven't fixed yet

2023-01-16 Thread Robert Haas
Due to cf5eb37c5ee0cc54c80d95c1695d7fca1f7c68cb, e5b8a4c098ad6add39626a14475148872cd687e0, and prior commits touching related code, it should now be possible to consider handing out CREATEROLE as a reasonable alternative to handing out SUPERUSER. Prior to cf5eb37c5ee0cc54c80d95c1695d7fca1f7c68cb, g

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-01-16 Thread Tom Lane
Andrew Dunstan writes: > OK, here's my version. It tests clean against all of crake's dump files > back to 9.2. > To some extent it's a matter of taste, but I hate very long regex lines > - it makes it very hard to see what's actually changing, so I broke up > most of those. I don't mind breaking

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-16 Thread Tomas Vondra
Hi, there's minor bitrot in the Mkvcbuild.pm change, making cfbot unhappy. As for the patch, I don't have much comments. I'm wondering if it'd be useful to indicate which timing source was actually used for EXPLAIN ANALYZE, say something like: Planning time: 0.197 ms Execution time: 0.225 ms

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-16 Thread Pavel Stehule
po 16. 1. 2023 v 21:34 odesílatel Tomas Vondra < tomas.von...@enterprisedb.com> napsal: > Hi, > > there's minor bitrot in the Mkvcbuild.pm change, making cfbot unhappy. > > As for the patch, I don't have much comments. I'm wondering if it'd be > useful to indicate which timing source was actually

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-01-16 Thread Andrew Dunstan
On 2023-01-16 Mo 14:34, Tom Lane wrote: > Andrew Dunstan writes: >> OK, here's my version. It tests clean against all of crake's dump files >> back to 9.2. >> To some extent it's a matter of taste, but I hate very long regex lines >> - it makes it very hard to see what's actually changing, so I

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-01-16 Thread Tom Lane
Andrew Dunstan writes: > On 2023-01-16 Mo 14:34, Tom Lane wrote: >> I don't think that's any easier to read, and it risks masking >> diffs that we'd wish to know about. > OK, I'll make another pass and tighten things up. Don't sweat it, I'm just working the bugs out of a new version. I'll have s

"Measuring timing overhead" in docs seems misleading

2023-01-16 Thread Andres Freund
Hi, I was trying to extract a commitable piece out of [1]. To be able to judge changes in timing overhead more accurately, I thought it'd be sensible to update pg_test_timing to report nanoseconds instead of microseconds. Which lead to trying to update pg_test_timing's docs [2]. The "Measuring Ex

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

2023-01-16 Thread Maciek Sakrejda
On Fri, Jan 13, 2023 at 10:38 AM Melanie Plageman wrote: > > Attached is v47. I missed a couple of versions, but I think the docs are clearer now. I'm torn on losing some of the detail, but overall I do think it's a good trade-off. Moving some details out to after the table does keep the bulk of

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

2023-01-16 Thread Peter Smith
On Mon, Jan 16, 2023 at 5:41 PM Amit Kapila wrote: > > On Mon, Jan 16, 2023 at 10:24 AM Peter Smith wrote: > > > > 2. > > > > /* > > + * Return the pid of the leader apply worker if the given pid is the pid > > of a > > + * parallel apply worker, otherwise return InvalidPid. > > + */ > > +pid_t

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-01-16 Thread Tom Lane
OK, here's a v4: * It works with 002_pg_upgrade.pl now. The only substantive change I had to make for that was to define the $old_version arguments as being always PostgreSQL::Version objects not strings, because otherwise I got complaints like Argument "HEAD" isn't numeric in numeric comparison

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-16 Thread Peter Geoghegan
On Fri, Jan 13, 2023 at 9:55 PM Andres Freund wrote: > I think part of our difference around a high autovacuum_freeze_max_age are due > to things you're trying to address here - if no-auto-cancel is a separate > threshold from autovacuum_freeze_max_age, it's less problematic to set > autovacuum_fr

Re: BF animal malleefowl reported an failure in 001_password.pl

2023-01-16 Thread Thomas Munro
On Sun, Jan 15, 2023 at 12:35 AM Thomas Munro wrote: > Here's a sketch of the first idea. To hit the problem case, the signal needs to arrive in between the latch->is_set check and the epoll_wait() call, and the handler needs to take a while to get started. (If it arrives before the latch->is_se

Re: almost-super-user problems that we haven't fixed yet

2023-01-16 Thread Nathan Bossart
On Mon, Jan 16, 2023 at 02:29:56PM -0500, Robert Haas wrote: > 4. You can reserve a small number of connections for the superuser > with superuser_reserved_connections, but there's no way to do a > similar thing for any other user. As mentioned above, a CREATEROLE > user could set connection limits

Re: recovery modules

2023-01-16 Thread Nathan Bossart
On Mon, Jan 16, 2023 at 04:36:01PM +0900, Michael Paquier wrote: > Once this issue was fixed, nothing else stood out, so applied this > part. Thanks! I've attached a rebased version of the rest of the patch set. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From c2e6eb1251b4774

Re: Refactor recordExtObjInitPriv()

2023-01-16 Thread Nathan Bossart
On Mon, Jan 16, 2023 at 12:01:47PM +0100, Peter Eisentraut wrote: > I have updated the patch as you suggested and split out the aggregate issue > into a separate patch for clarity. LGTM -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-01-16 Thread Tom Lane
I wrote: > I think we're about ready to go, except for cutting down > AdjustUpgrade.pm to make versions to put in the back branches. Hmmm ... so upon trying to test in the back branches, I soon discovered that PostgreSQL/Version.pm isn't there before v15. I don't see a good reason why we couldn't

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2023-01-16 Thread Dean Rasheed
On Wed, 11 Jan 2023 at 05:24, David Rowley wrote: > > I'm wondering if 1349d279 should have just never opted to presort > Aggrefs which have volatile functions so that the existing behaviour > of unordered output is given always and nobody is fooled into thinking > this works correctly only to be

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-01-16 Thread Andrew Dunstan
On 2023-01-16 Mo 18:11, Tom Lane wrote: > I wrote: >> I think we're about ready to go, except for cutting down >> AdjustUpgrade.pm to make versions to put in the back branches. > Hmmm ... so upon trying to test in the back branches, I soon > discovered that PostgreSQL/Version.pm isn't there befor

Re: doc: add missing "id" attributes to extension packaging page

2023-01-16 Thread Karl O. Pinc
On Mon, 16 Jan 2023 11:14:35 -0600 "Karl O. Pinc" wrote: > On Sun, 15 Jan 2023 18:01:50 -0600 > "Karl O. Pinc" wrote: > > > Regards XSLT: > > > > I believe the XSLT needs work. > In XSLT 1.0 there is no xml:default-mode. So I _think_ what you do > then is modify the built-in template rules

Re: New strategies for freezing, advancing relfrozenxid early

2023-01-16 Thread Peter Geoghegan
On Mon, Jan 16, 2023 at 10:10 AM Peter Geoghegan wrote: > Attached is v16, which incorporates some of Matthias' feedback. 0001 (the freezing strategies patch) is now committable IMV. Or at least will be once I polish the docs a bit more. I plan on committing 0001 some time next week, barring any

Re: almost-super-user problems that we haven't fixed yet

2023-01-16 Thread Robert Haas
On Mon, Jan 16, 2023 at 5:37 PM Nathan Bossart wrote: > On Mon, Jan 16, 2023 at 02:29:56PM -0500, Robert Haas wrote: > > 4. You can reserve a small number of connections for the superuser > > with superuser_reserved_connections, but there's no way to do a > > similar thing for any other user. As m

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

2023-01-16 Thread houzj.f...@fujitsu.com
On Tuesday, January 17, 2023 5:43 AM Peter Smith wrote: > > On Mon, Jan 16, 2023 at 5:41 PM Amit Kapila > wrote: > > > > On Mon, Jan 16, 2023 at 10:24 AM Peter Smith > wrote: > > > > > > 2. > > > > > > /* > > > + * Return the pid of the leader apply worker if the given pid is > > > +the pid of

Re: New strategies for freezing, advancing relfrozenxid early

2023-01-16 Thread Peter Geoghegan
On Mon, Jan 16, 2023 at 10:00 AM Peter Geoghegan wrote: > Now we treat the scanning and freezing strategies as two independent > choices. Of course they're not independent in any practical sense, but > I think it's slightly simpler and more elegant that way -- it makes > the GUC vacuum_freeze_stra

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-01-16 Thread Tom Lane
I've pushed the per-branch AdjustUpgrade.pm files and tested by performing a fresh round of buildfarm runs with the patched TestUpgradeXversion.pm file. I think we're in good shape with this project. I dunno if we want to stretch buildfarm owners' patience with yet another BF client release right

typo in the subscription command tests

2023-01-16 Thread Takamichi Osumi (Fujitsu)
Hi, While working on some logical replication patch, I've find a typo on HEAD. Attached the modification patch for this. Best Regards, Takamichi Osumi v1-0001-Fix-a-typo-in-subscription-command-tests.patch Description: v1-0001-Fix-a-typo-in-subscription-command-tests.patch

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

2023-01-16 Thread Masahiko Sawada
On Mon, Jan 16, 2023 at 3:19 PM Amit Kapila wrote: > > On Sun, Jan 15, 2023 at 10:39 PM Tomas Vondra > wrote: > > > > I think there's a bug in how get_transaction_apply_action() interacts > > with handle_streamed_transaction() to decide whether the transaction is > > streamed or not. Originally,

Re: Show various offset arrays for heap WAL records

2023-01-16 Thread Peter Geoghegan
On Wed, Jan 11, 2023 at 3:11 PM Peter Geoghegan wrote: > On Wed, Jan 11, 2023 at 3:00 PM Andres Freund wrote: > > What are your thoughts about the place for the helper functions? You're ok > > with rmgrdesc_utils.[ch]? > > Yeah, that seems okay. BTW, while playing around with this patch today, I

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

2023-01-16 Thread Amit Kapila
On Tue, Jan 17, 2023 at 8:35 AM Masahiko Sawada wrote: > > On Mon, Jan 16, 2023 at 3:19 PM Amit Kapila wrote: > > > > Okay, I have added the comments in get_transaction_apply_action() and > > updated the comments to refer to the enum TransApplyAction where all > > the actions are explained. > > T

Re: typo in the subscription command tests

2023-01-16 Thread Amit Kapila
On Tue, Jan 17, 2023 at 8:30 AM Takamichi Osumi (Fujitsu) wrote: > > While working on some logical replication patch, > I've find a typo on HEAD. > Attached the modification patch for this. > LGTM. -- With Regards, Amit Kapila.

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

2023-01-16 Thread Peter Smith
On Tue, Jan 17, 2023 at 1:21 PM houzj.f...@fujitsu.com wrote: > > On Tuesday, January 17, 2023 5:43 AM Peter Smith > wrote: > > > > On Mon, Jan 16, 2023 at 5:41 PM Amit Kapila > > wrote: > > > > > > On Mon, Jan 16, 2023 at 10:24 AM Peter Smith > > wrote: > > > > > > > > 2. > > > > > > > > /*

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-01-16 Thread Michael Paquier
On Mon, Jan 16, 2023 at 04:48:28PM -0500, Tom Lane wrote: > I'm slightly tempted to back-patch 002_pg_upgrade.pl so that there > is an in-tree way to verify back-branch AdjustUpgrade.pm files. > On the other hand, it's hard to believe that testing that in > HEAD won't be sufficient; I doubt the bac

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

2023-01-16 Thread houzj.f...@fujitsu.com
On Tuesday, January 17, 2023 11:32 AM Peter Smith wrote: > > On Tue, Jan 17, 2023 at 1:21 PM houzj.f...@fujitsu.com > wrote: > > > > On Tuesday, January 17, 2023 5:43 AM Peter Smith > wrote: > > > > > > On Mon, Jan 16, 2023 at 5:41 PM Amit Kapila > > > > > > wrote: > > > > > > > > On Mon, Jan

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2023-01-16 Thread David Rowley
On Tue, 17 Jan 2023 at 13:16, Dean Rasheed wrote: > > On Wed, 11 Jan 2023 at 05:24, David Rowley wrote: > > > > I'm wondering if 1349d279 should have just never opted to presort > > Aggrefs which have volatile functions so that the existing behaviour > > of unordered output is given always and no

Re: Generating code for query jumbling through gen_node_support.pl

2023-01-16 Thread Michael Paquier
On Mon, Jan 16, 2023 at 03:13:35PM +0100, Peter Eisentraut wrote: > On 13.01.23 08:54, Michael Paquier wrote: >> Using a "jumble_ignore" flag is equally invasive to using an >> "jumble_include" flag for each field, I am afraid, as the number of >> fields in the nodes included in jumbles is pretty e

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

2023-01-16 Thread Peter Smith
On Tue, Jan 17, 2023 at 2:37 PM houzj.f...@fujitsu.com wrote: > > On Tuesday, January 17, 2023 11:32 AM Peter Smith > wrote: > > > > On Tue, Jan 17, 2023 at 1:21 PM houzj.f...@fujitsu.com > > wrote: > > > > > > On Tuesday, January 17, 2023 5:43 AM Peter Smith > > wrote: > > > > > > > > On Mon,

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-16 Thread Peter Geoghegan
On Mon, Jan 16, 2023 at 8:25 AM Robert Haas wrote: > I really dislike formulas like Min(freeze_max_age * 2, 1 billion). > That looks completely magical from a user perspective. Some users > aren't going to understand autovacuum behavior at all. Some will, and > will be able to compare age(relfroze

Re: New strategies for freezing, advancing relfrozenxid early

2023-01-16 Thread Dilip Kumar
On Mon, Jan 16, 2023 at 11:31 PM Peter Geoghegan wrote: > > > I think '(nextXID - cutoffs->relfrozenxid) / freeze_table_age' should > > be the actual fraction right? What is the point of adding 0.5 to the > > divisor? If there is a logical reason, maybe we can explain in the > > comments. > > It

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

2023-01-16 Thread shveta malik
On Tue, Jan 17, 2023 at 9:07 AM houzj.f...@fujitsu.com wrote: > > On Tuesday, January 17, 2023 11:32 AM Peter Smith > wrote: > > > > On Tue, Jan 17, 2023 at 1:21 PM houzj.f...@fujitsu.com > > wrote: > > > > > > On Tuesday, January 17, 2023 5:43 AM Peter Smith > > wrote: > > > > > > > > On Mon,

Re: New strategies for freezing, advancing relfrozenxid early

2023-01-16 Thread Peter Geoghegan
On Mon, Jan 16, 2023 at 8:13 PM Dilip Kumar wrote: > I think that it makes sense to keep 'vacuum_freeze_strategy_threshold' > strictly for freezing. But the point is that the eager scanning > strategy is driven by table freezing needs of the table (tableagefrac) > that make sense, but if we have

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

2023-01-16 Thread Amit Kapila
On Tue, Jan 17, 2023 at 8:59 AM Amit Kapila wrote: > > On Tue, Jan 17, 2023 at 8:35 AM Masahiko Sawada wrote: > > > > On Mon, Jan 16, 2023 at 3:19 PM Amit Kapila wrote: > > > > > > Okay, I have added the comments in get_transaction_apply_action() and > > > updated the comments to refer to the en

RE: Ability to reference other extensions by schema in extension scripts

2023-01-16 Thread Regina Obe
> > On Thu, Dec 15, 2022 at 08:04:22AM -0500, Regina Obe wrote: > > > On Tue, Nov 22, 2022 at 11:24:19PM -0500, Regina Obe wrote: > > > > > > > If an extension is required by another extension and that required > > > > extension schema is referenced in the extension scripts using the > > > > @exts

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

2023-01-16 Thread Masahiko Sawada
On Tue, Jan 17, 2023 at 1:55 PM Amit Kapila wrote: > > On Tue, Jan 17, 2023 at 8:59 AM Amit Kapila wrote: > > > > On Tue, Jan 17, 2023 at 8:35 AM Masahiko Sawada > > wrote: > > > > > > On Mon, Jan 16, 2023 at 3:19 PM Amit Kapila > > > wrote: > > > > > > > > Okay, I have added the comments in

Re: [EXTERNAL] Re: [PATCH] Support using "all" for the db user in pg_ident.conf

2023-01-16 Thread Michael Paquier
On Mon, Jan 16, 2023 at 11:53:57AM +0100, Jelte Fennema wrote: >> Perhaps it would be simpler to use copy_auth_token() in this code path >> and always free the resulting token? > > I initially tried that when working on the patch, but copy_auth_token > (surprisingly) doesn't copy the regex field i

Re: recovery modules

2023-01-16 Thread Michael Paquier
On Mon, Jan 16, 2023 at 02:40:40PM -0800, Nathan Bossart wrote: > On Mon, Jan 16, 2023 at 04:36:01PM +0900, Michael Paquier wrote: > > Once this issue was fixed, nothing else stood out, so applied this > > part. > > Thanks! I've attached a rebased version of the rest of the patch set. When it co

Re: doc: add missing "id" attributes to extension packaging page

2023-01-16 Thread Brar Piening
On 17.01.2023 at 02:05, Karl O. Pinc wrote: Or maybe the right way is to set a mode at the very top, the first apply-templates call, and not mess with the built-in templates at all. (You'd write your own "postgres-mode" templates the same way, to "wrap" and call the default templates.) Think of

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

2023-01-16 Thread houzj.f...@fujitsu.com
On Tuesday, January 17, 2023 12:55 PM Amit Kapila wrote: > > On Tue, Jan 17, 2023 at 8:59 AM Amit Kapila wrote: > > > > On Tue, Jan 17, 2023 at 8:35 AM Masahiko Sawada > wrote: > > > > > > On Mon, Jan 16, 2023 at 3:19 PM Amit Kapila > wrote: > > > > > > > > Okay, I have added the comments in

Re: constify arguments of copy_file() and copydir()

2023-01-16 Thread Michael Paquier
On Mon, Jan 16, 2023 at 10:53:40AM +0900, Michael Paquier wrote: > +1. While I don't forget about this thread.. Any objections if I were to apply that? -- Michael signature.asc Description: PGP signature

  1   2   >