RE: Modify the document of Logical Replication configuration settings

2023-01-18 Thread Takamichi Osumi (Fujitsu)
On Wednesday, January 18, 2023 4:11 PM Michael Paquier wrote: > On Wed, Jan 18, 2023 at 07:00:43AM +, Takamichi Osumi (Fujitsu) wrote: > > The attached patch includes below two changes for the description of > > Logical Replication "Configuration Settings". > > > > 1. Add one brief descriptio

Re: Improve GetConfigOptionValues function

2023-01-18 Thread Bharath Rupireddy
On Wed, Jan 18, 2023 at 1:24 PM Nitin Jadhav wrote: > > Attaching the patch. > > On Wed, Jan 18, 2023 at 1:21 PM Nitin Jadhav > wrote: > > > > Hi, > > > > GetConfigOptionValues function extracts the config parameters for the > > given variable irrespective of whether it results in noshow or not.

Re: New strategies for freezing, advancing relfrozenxid early

2023-01-18 Thread Dilip Kumar
On Tue, Jan 17, 2023 at 10:05 AM Peter Geoghegan wrote: > > 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 n

RE: Logical replication timeout problem

2023-01-18 Thread wangw.f...@fujitsu.com
On Wed, Jan 18, 2023 at 13:29 PM Amit Kapila wrote: > On Tue, Jan 17, 2023 at 6:41 PM Ashutosh Bapat > wrote: > > > > On Tue, Jan 17, 2023 at 3:34 PM Amit Kapila wrote: > > > > > > > > > > I am a bit worried about the indirections that the wrappers and hooks > > > > create. Output plugins call O

Re: minor bug

2023-01-18 Thread Laurenz Albe
On Tue, 2023-01-17 at 10:32 -0500, Tom Lane wrote: > Laurenz Albe writes: > > On Mon, 2023-01-16 at 19:59 +0100, Torsten Förtsch wrote: > > > So, the timestamp displayed in the log message is certainly wrong. > > > If recovery stops at a WAL record that has no timestamp, you get this > > bogus re

Re: Inconsistency in vacuum behavior

2023-01-18 Thread Nikita Malakhov
Hi hackers! Alexander found a very good issue. Please check the solution above. Any objections? It's a production case, please review, any thoughts and objections are welcome. On Mon, Jan 16, 2023 at 8:15 PM Alexander Pyhalov wrote: > Nikita Malakhov писал 2023-01-16 20:12: > > Hi, > > > > Curr

Re: Modify the document of Logical Replication configuration settings

2023-01-18 Thread Bharath Rupireddy
On Wed, Jan 18, 2023 at 12:31 PM Takamichi Osumi (Fujitsu) wrote: > > Hi, hackers > > The attached patch includes below two changes for the description of > Logical Replication "Configuration Settings". > > 1. Add one brief description about wal_sender_timeout. >I made it similar to one other

SHARED locks barging behaviour

2023-01-18 Thread Arul Ajmani
I'm trying to better understand the following barging behaviour with SHARED locks. *Setup:* postgres=# create table t(a INT); CREATE TABLE postgres=# INSERT INTO t VALUES(1); INSERT 0 1 Then, performing the following operations in 3 different sessions, in order, we observe: Session 1 Session 2

Issue with psql's create_help.pl under perlcritic

2023-01-18 Thread Michael Paquier
Hi all, A recent system update of a Debian SID host has begun to show me this issue: ./src/bin/psql/create_help.pl: Bareword dir handle opened at line 47, column 1. See pages 202,204 of PBP. ([InputOutput::ProhibitBarewordDirHandles] Severity: 5) This issue gets fixed here as of the attached. Co

Re: document the need to analyze partitioned tables

2023-01-18 Thread Laurenz Albe
On Tue, 2023-01-17 at 16:16 -0500, Bruce Momjian wrote: > On Tue, Jan 17, 2023 at 03:00:50PM -0600, Justin Pryzby wrote: > > Maybe (all?) the clarification the docs need is to say: > > "Partitioned tables are not *themselves* processed by autovacuum." > > Yes, I think the lack of autovacuum needs

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

2023-01-18 Thread Jelte Fennema
> 0004 looks fine as well, be it for the tests (I am hesitating to tweak > things a bit here actually for the role names), the code or the docs, Anything I can do to help with this? Or will you do that yourself?

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

2023-01-18 Thread Richard Guo
On Tue, Jan 17, 2023 at 3:05 PM Tom Lane wrote: > Richard Guo writes: > > BTW, I wonder if we should have checked CoercionForm before > > fix_upper_expr_mutator steps into CoerceViaIO->arg to adjust the expr > > there. > > I will just quote what it says in primnodes.h: > > * NB: equal() ignores

Re: Todo: Teach planner to evaluate multiple windows in the optimal order

2023-01-18 Thread David Rowley
On Tue, 10 Jan 2023 at 06:15, Ankit Kumar Pandey wrote: > > > > On 09/01/23 17:53, David Rowley wrote: > > I gave some thought to whether doing foreach_delete_current() is safe > > within a foreach_reverse() loop. I didn't try it, but I couldn't see > > any reason why not. It is pretty late here

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

2023-01-18 Thread David Rowley
On Wed, 18 Jan 2023 at 22:37, Richard Guo wrote: > I'm still confused that when the same scenario happens with ORDER BY in > an aggregate function, like in query 1, the result is different in that > we would get an unsorted output. > > I wonder if we should avoid this inconsistent behavior. It ce

RE: Update comments in multixact.c

2023-01-18 Thread shiy.f...@fujitsu.com
On Wed, Jan 18, 2023 6:04 AM Peter Geoghegan wrote: > > On Tue, Jan 17, 2023 at 1:33 AM shiy.f...@fujitsu.com > wrote: > > I noticed that commit 5212d447fa updated some comments in multixact.c > because > > SLRU truncation for multixacts is performed during VACUUM, instead of > > checkpoint. Sho

Re: Helper functions for wait_for_catchup() in Cluster.pm

2023-01-18 Thread Alvaro Herrera
On 2023-Jan-18, Drouvot, Bertrand wrote: > The current calls are done that way: > > wait_for_replay_catchup called: > - 8 times with write LSN as an argument > - 1 time with insert LSN as an argument > - 16 times with flush LSN as an argument > So it looks like that providing a node as a second

Re: [EXTERNAL] Re: Support load balancing in libpq

2023-01-18 Thread Jelte Fennema
As far as I can tell this is ready for committer feedback now btw. I'd really like to get this into PG16. > It hadn't been my intention to block the patch on it, sorry. Just > registering a preference. No problem. I hadn't looked into the shared PRNG solution closely enough to determine if I thou

Re: Minimal logical decoding on standbys

2023-01-18 Thread Drouvot, Bertrand
Hi, On 1/6/23 4:40 AM, Andres Freund wrote: Hi, 0004: @@ -3037,6 +3037,43 @@ $SIG{TERM} = $SIG{INT} = sub { =pod +=item $node->create_logical_slot_on_standby(self, master, slot_name, dbname) + +Create logical replication slot on given standby + +=cut + +sub create_logical_slot_on_standby +

Re: [DOCS] Stats views and functions not in order?

2023-01-18 Thread Peter Eisentraut
On 11.01.23 07:11, Peter Smith wrote: v9-0003 --> v10-0001 I'm not sure if anything is pending for v9-0003, if there is something pending, please post an updated patch for the same. Thanks for the reminder. PSA v10. So this patch changes some sections describing system views to refentry's.

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

2023-01-18 Thread Dean Rasheed
On Wed, 18 Jan 2023 at 09:49, David Rowley wrote: > > On Wed, 18 Jan 2023 at 22:37, Richard Guo wrote: > > I'm still confused that when the same scenario happens with ORDER BY in > > an aggregate function, like in query 1, the result is different in that > > we would get an unsorted output. > > >

Re: heapgettup refactoring

2023-01-18 Thread Peter Eisentraut
On 10.01.23 21:31, Melanie Plageman wrote: On Thu, Jan 5, 2023 at 8:52 AM Peter Eisentraut wrote: Ok, let's look through these patches starting from the top then. v4-0001-Add-no-movement-scan-helper.patch This makes sense overall; there is clearly some duplicate code that can be unified. It

Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit

2023-01-18 Thread Etsuro Fujita
Hi Vignesh, On Wed, Jan 4, 2023 at 9:19 PM vignesh C wrote: > On Tue, 1 Nov 2022 at 15:54, Etsuro Fujita wrote: > > Attached is a rebased version of the patch. > > The patch does not apply on top of HEAD as in [1], please post a rebased > patch: I rebased the patch. Attached is an updated pat

Re: Rethinking the implementation of ts_headline()

2023-01-18 Thread Alvaro Herrera
I tried this other test, based on looking at the new regression tests you added, SELECT ts_headline('english', ' Day after day, day after day, We stuck, nor breath nor motion, As idle as a painted Ship Upon a painted Ocean. Water, water, every where And all the boards did shrink; Water, wate

Re: Question about initial logical decoding snapshot

2023-01-18 Thread shveta malik
Hello, I was curious as to why we need 3rd running_xact and wanted to learn more about it, so I have made a few changes to come up with a patch which builds the snapshot in 2 running_xacts. The motive is to run the tests to see the failures/issues with this approach to understand the need of readi

Re: Support logical replication of DDLs

2023-01-18 Thread Amit Kapila
On Sat, Jan 7, 2023 at 8:58 PM Zheng Li wrote: > > I added documentation and changed user interface design in the > attached v60 patch set. > The patch set addressed comments from Peter in [1]. > > The motivation for the user interface change is that we want to manage > DDL replication feature in

Re: Logical replication timeout problem

2023-01-18 Thread Ashutosh Bapat
On Wed, Jan 18, 2023 at 1:49 PM wangw.f...@fujitsu.com wrote: > > On Wed, Jan 18, 2023 at 13:29 PM Amit Kapila wrote: > > On Tue, Jan 17, 2023 at 6:41 PM Ashutosh Bapat > > wrote: > > > > > > On Tue, Jan 17, 2023 at 3:34 PM Amit Kapila > > > wrote: > > > > > > > > > > > > > I am a bit worried

Re: Logical replication timeout problem

2023-01-18 Thread Amit Kapila
On Wed, Jan 18, 2023 at 5:37 PM Ashutosh Bapat wrote: > > On Wed, Jan 18, 2023 at 1:49 PM wangw.f...@fujitsu.com > wrote: > > > > On Wed, Jan 18, 2023 at 13:29 PM Amit Kapila > > wrote: > > > On Tue, Jan 17, 2023 at 6:41 PM Ashutosh Bapat > > > wrote: > > > > > > > > On Tue, Jan 17, 2023 at 3:

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

2023-01-18 Thread Xing Guo
On Mon, Jan 16, 2023 at 11:29 PM Tom Lane wrote: > 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

Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences

2023-01-18 Thread Alvaro Herrera
On 2023-Jan-02, Karl O. Pinc wrote: > Hi, > > Attached is a patch: contrib_v1.patch > > It modifies Appendix F, the contrib directory. > > It adds brief text into the titles shown in the > table of contents so it's easier to tell what > each module does. It also suffixes [trusted] or [obsolete

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

2023-01-18 Thread Andrew Dunstan
On 2023-01-17 Tu 11:30, Tom Lane wrote: > Andrew Dunstan writes: >> FYI crake has just passed the test with flying colours. > Cool. I await the Windows machines' results with interest. fairwren and drongo are clean except for fairywren upgrading 9.6 to 11. This appears to be a longstanding is

Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences

2023-01-18 Thread Alvaro Herrera
Not related to this patch: it's very annoying that in the PDF output, each section in the appendix doesn't start on a blank page -- which means that the doc page for many modules starts in the middle of a page were the previous one ends. This is very ugly. And then you get to dblink, which contai

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-18 Thread David Geier
On 1/16/23 21:39, Pavel Stehule wrote: po 16. 1. 2023 v 21:34 odesílatel Tomas Vondra 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 so

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-18 Thread David Geier
On 1/16/23 18:37, Andres Freund wrote: Hi, On 2023-01-02 14:28:20 +0100, David Geier wrote: I'm doubtful this is worth the complexity it incurs. By the time we convert out of the instr_time format, the times shouldn't be small enough that the accuracy is affected much. I don't feel strong about

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-18 Thread David Geier
Hi, @Andres: will you take care of these changes and provide me with an updated patch set so I can rebase the RDTSC changes? Otherwise, I can also apply Tom suggestions to your patch set and send out the complete patch set. -- David Geier (ServiceNow)

Re: Issue with psql's create_help.pl under perlcritic

2023-01-18 Thread Andrew Dunstan
On 2023-01-18 We 03:50, Michael Paquier wrote: > Hi all, > > A recent system update of a Debian SID host has begun to show me this > issue: > ./src/bin/psql/create_help.pl: Bareword dir handle opened at line 47, > column 1. See pages 202,204 of PBP. > ([InputOutput::ProhibitBarewordDirHandles] S

Re: Add LZ4 compression in pg_dump

2023-01-18 Thread Tomas Vondra
Hi, On 1/16/23 16:14, gkokola...@pm.me wrote: > Hi, > > I admit I am completely at lost as to what is expected from me anymore. > :-( I understand it's frustrating not to know why a patch is not moving forward. Particularly when is seems fairly straightforward ... Let me briefly explain my pe

Re: ANY_VALUE aggregate

2023-01-18 Thread Peter Eisentraut
On 05.12.22 21:18, Vik Fearing wrote: On 12/5/22 15:57, Vik Fearing wrote: The SQL:2023 Standard defines a new aggregate named ANY_VALUE.  It returns an implementation-dependent (i.e. non-deterministic) value from the rows in its group. PFA an implementation of this aggregate. Here is v2 of

Re: [DOCS] Stats views and functions not in order?

2023-01-18 Thread David G. Johnston
On Wed, Jan 18, 2023 at 3:36 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 11.01.23 07:11, Peter Smith wrote: > > v9-0003 --> v10-0001 > > > >> I'm not sure if anything is pending for v9-0003, if there is something > >> pending, please post an updated patch for the same. > >

Re: Progress report of CREATE INDEX for nested partitioned tables

2023-01-18 Thread Justin Pryzby
TBH, I think the best approach is what I did in: 0001-report-top-parent-progress-for-CREATE-INDEX.txt That's a minimal patch, ideal for backpatching. ..which defines/clarifies that the progress reporting is only for *direct* children. That avoids the need to change any data structures, and it's

Re: Remove source code display from \df+?

2023-01-18 Thread Isaac Morland
On Wed, 18 Jan 2023 at 00:00, Pavel Stehule wrote: > > út 17. 1. 2023 v 20:29 odesílatel Isaac Morland > napsal: > >> >> I welcome comments and feedback. Now to try to find something manageable >> to review. >> > > looks well > > you miss update psql documentation > > https://www.postgresql.org/

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

2023-01-18 Thread Tom Lane
Andrew Dunstan writes: > fairwren and drongo are clean except for fairywren upgrading 9.6 to 11. > This appears to be a longstanding issue that the fuzz processing was > causing us to ignore. See for example >

Re: [DOCS] Stats views and functions not in order?

2023-01-18 Thread Tom Lane
"David G. Johnston" writes: > ... I was going for the html effect > of having these views chunked into their own pages, any other changes being > non-detrimental. But is that a result we want? It will for example break any bookmarks that people might have for these documentation entries. It wi

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

2023-01-18 Thread Tom Lane
Dean Rasheed writes: > I think the behaviour of an ORDER BY in the query can also be pretty > surprising. Indeed. The fundamental question is this: in > SELECT ARRAY[random(), random(), random()] > FROM generate_series(1, 3) > ORDER BY random(); are those four occurrences of random() supposed

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

2023-01-18 Thread Masahiko Sawada
On Tue, Jan 17, 2023 at 8:06 PM John Naylor wrote: > > On Mon, Jan 16, 2023 at 3:18 PM Masahiko Sawada wrote: > > > > On Mon, Jan 16, 2023 at 2:02 PM John Naylor > > wrote: > > Attached is an update that mostly has the modest goal of getting CI green > again. v19-0003 has squashed the entire ra

Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences

2023-01-18 Thread Karl O. Pinc
On Wed, 18 Jan 2023 13:30:45 +0100 Alvaro Herrera wrote: > Not related to this patch: it's very annoying that in the PDF output, > each section in the appendix doesn't start on a blank page -- which > means that the doc page for many modules starts in the middle of a > page were the previous one

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-18 Thread Robert Haas
On Tue, Jan 17, 2023 at 5:56 PM Peter Geoghegan wrote: > > Why do you think that? > > For the reasons I gave about statistics, random sampling, the central > limit theorem. All that stuff. This matches the experience of Andres. > And is obviously the only explanation behind the reliance on > antiw

Re: [DOCS] Stats views and functions not in order?

2023-01-18 Thread David G. Johnston
On Wed, Jan 18, 2023 at 8:38 AM Tom Lane wrote: > "David G. Johnston" writes: > > ... I was going for the html effect > > of having these views chunked into their own pages, any other changes > being > > non-detrimental. > > But is that a result we want? It will for example break any bookmarks

Re: ANY_VALUE aggregate

2023-01-18 Thread Tom Lane
Peter Eisentraut writes: > On 05.12.22 21:18, Vik Fearing wrote: >> On 12/5/22 15:57, Vik Fearing wrote: >>> The SQL:2023 Standard defines a new aggregate named ANY_VALUE.  It >>> returns an implementation-dependent (i.e. non-deterministic) value >>> from the rows in its group. > Since the tran

Re: ANY_VALUE aggregate

2023-01-18 Thread Vik Fearing
On 1/18/23 16:55, Tom Lane wrote: Peter Eisentraut writes: On 05.12.22 21:18, Vik Fearing wrote: On 12/5/22 15:57, Vik Fearing wrote: The SQL:2023 Standard defines a new aggregate named ANY_VALUE.  It returns an implementation-dependent (i.e. non-deterministic) value from the rows in its grou

Re: Improve GetConfigOptionValues function

2023-01-18 Thread Tom Lane
Nitin Jadhav writes: > GetConfigOptionValues function extracts the config parameters for the > given variable irrespective of whether it results in noshow or not. > But the parent function show_all_settings ignores the values parameter > if it results in noshow. It's unnecessary to fetch all the v

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

2023-01-18 Thread Robert Haas
On Tue, Jan 17, 2023 at 7:15 PM Nathan Bossart wrote: > Great. Here is a first attempt at the patch. In general, looks good. I think this will often call HaveNFreeProcs twice, though, and that would be better to avoid, e.g. if (!am_superuser && !am_walsender && (SuperuserReservedBackends + Rese

Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements

2023-01-18 Thread Tomas Vondra
Hi, I took a quick look at this patch, to see if there's something we want/can get into v16. The last version was submitted about 9 months ago, and it doesn't apply cleanly anymore, but the bitrot is fairly minor. Not sure there's still interest, though. As for the patch, I wonder if it's unneces

Re: Improve GetConfigOptionValues function

2023-01-18 Thread Bharath Rupireddy
On Wed, Jan 18, 2023 at 9:44 PM Tom Lane wrote: > > Possibly a better answer is to refactor into separate functions, > along the lines of > > static bool > ConfigOptionIsShowable(struct config_generic *conf) > > static void > GetConfigOptionValues(struct config_generic *conf, const char **values)

Re: ANY_VALUE aggregate

2023-01-18 Thread Vik Fearing
On 1/18/23 16:06, Peter Eisentraut wrote: On 05.12.22 21:18, Vik Fearing wrote: On 12/5/22 15:57, Vik Fearing wrote: The SQL:2023 Standard defines a new aggregate named ANY_VALUE.  It returns an implementation-dependent (i.e. non-deterministic) value from the rows in its group. PFA an implem

CREATEROLE users vs. role properties

2023-01-18 Thread Robert Haas
On Mon, Jan 16, 2023 at 2:29 PM Robert Haas wrote: > 1. It's still possible for a CREATEROLE user to hand out role > attributes that they don't possess. The new prohibitions in > cf5eb37c5ee0cc54c80d95c1695d7fca1f7c68cb prevent a CREATEROLE user > from handing out membership in a role on which the

Re: Implement missing join selectivity estimation for range types

2023-01-18 Thread Tomas Vondra
Hello Mahmoud, Thanks for the patch and sorry for not taking a look earlier. On 6/30/22 16:31, Mahmoud Sakr wrote: > Hi, > Given a query: > SELECT * FROM t1, t2 WHERE t1.r << t2.r > where t1.r, t2.r are of range type, > currently PostgreSQL will estimate a constant selectivity for the << > predi

Re: Todo: Teach planner to evaluate multiple windows in the optimal order

2023-01-18 Thread Ankit Kumar Pandey
On 18/01/23 15:12, David Rowley wrote: I also thought I'd better test that foreach_delete_current() works with foreach_reverse(). I can confirm that it *does not* work correctly. I guess maybe you only tested the fact that it deleted the current item and not that the subsequent loop correct

Re: Removing redundant grouping columns

2023-01-18 Thread Tom Lane
David Rowley writes: > No objections from me. Pushed, thanks for looking at it. regards, tom lane

Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences

2023-01-18 Thread Alvaro Herrera
On 2023-Jan-18, Karl O. Pinc wrote: > On Wed, 18 Jan 2023 13:30:45 +0100 > Alvaro Herrera wrote: > > > Not related to this patch: it's very annoying that in the PDF output, > > each section in the appendix doesn't start on a blank page -- which > > means that the doc page for many modules starts

Re: document the need to analyze partitioned tables

2023-01-18 Thread Justin Pryzby
On Wed, Jan 18, 2023 at 10:15:18AM +0100, Laurenz Albe wrote: > On Tue, 2023-01-17 at 16:16 -0500, Bruce Momjian wrote: > > On Tue, Jan 17, 2023 at 03:00:50PM -0600, Justin Pryzby wrote: > > > Maybe (all?) the clarification the docs need is to say: > > > "Partitioned tables are not *themselves* pro

Re: Implement missing join selectivity estimation for range types

2023-01-18 Thread Tomas Vondra
Also, calc_hist_selectivity_contains in multirangetypes_selfuncs.c needs a proper comment, not just "this is a copy from rangetypes". However, it seems the two functions are exactly the same. Would the functions diverge in the future? If not, maybe there should be just a single shared function? r

Re: document the need to analyze partitioned tables

2023-01-18 Thread Bruce Momjian
On Wed, Jan 18, 2023 at 11:49:19AM -0600, Justin Pryzby wrote: > On Wed, Jan 18, 2023 at 10:15:18AM +0100, Laurenz Albe wrote: > > On Tue, 2023-01-17 at 16:16 -0500, Bruce Momjian wrote: > > > On Tue, Jan 17, 2023 at 03:00:50PM -0600, Justin Pryzby wrote: > > > > Maybe (all?) the clarification the

Re: [PATCH] Const'ify the arguments of ilist.c/ilist.h functions

2023-01-18 Thread Andres Freund
Hi, On 2023-01-12 08:34:25 +0100, Peter Eisentraut wrote: > On 07.01.23 08:21, Peter Eisentraut wrote: > > On 23.11.22 14:57, Aleksander Alekseev wrote: > > > Hi Andres, > > > > > > Thanks for the review! > > > > > > > I don't think it is correct for any of these to add const. The > > > > only r

Re: [PATCH] Add <> support to sepgsql_restorecon

2023-01-18 Thread Joe Conway
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: not tested Spec compliant: not tested Documentation:not tested This needs regression test support for the feature and some minimal document

Re: [PATCH] Const'ify the arguments of ilist.c/ilist.h functions

2023-01-18 Thread Andres Freund
Hi, On 2023-01-18 10:22:14 -0800, Andres Freund wrote: > On 2023-01-12 08:34:25 +0100, Peter Eisentraut wrote: > > On 07.01.23 08:21, Peter Eisentraut wrote: > > > This patch version looks correct to me.  It is almost the same as the > > > one that Andres had posted in his thread, except that your

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-18 Thread Peter Geoghegan
. On Wed, Jan 18, 2023 at 7:54 AM Robert Haas wrote: > > It just fits: the dead tuples approach can sometimes be so > > completely wrong that even an alternative triggering condition based > > on something that is virtually unrelated to the thing we actually care > > about can do much better in p

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

2023-01-18 Thread Nathan Bossart
On Wed, Jan 18, 2023 at 11:28:57AM -0500, Robert Haas wrote: > In general, looks good. I think this will often call HaveNFreeProcs > twice, though, and that would be better to avoid, e.g. I should have thought of this. This is fixed in v2. > In the common case where we hit neither limit, this on

Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences

2023-01-18 Thread Karl O. Pinc
On Wed, 18 Jan 2023 13:25:57 +0100 Alvaro Herrera wrote: > On 2023-Jan-02, Karl O. Pinc wrote: > > Attached is a patch: contrib_v1.patch > > > > It modifies Appendix F, the contrib directory. > > > > It adds brief text into the titles shown in the > > table of contents so it's easier to tell w

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-18 Thread Robert Haas
On Wed, Jan 18, 2023 at 1:31 PM Peter Geoghegan wrote: > pgstat_report_analyze() will totally override the > tabentry->dead_tuples information that drives autovacuum.c, based on > an estimate derived from a random sample -- which seems to me to be an > approach that just doesn't have any sound the

Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements

2023-01-18 Thread Andrei Zubkov
Hi Tomas, On Wed, 2023-01-18 at 17:29 +0100, Tomas Vondra wrote: > I took a quick look at this patch, to see if there's something we > want/can get into v16. The last version was submitted about 9 months > ago, and it doesn't apply cleanly anymore, but the bitrot is fairly > minor. Not sure there'

Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences

2023-01-18 Thread Karl O. Pinc
On Wed, 18 Jan 2023 18:34:47 +0100 Alvaro Herrera wrote: > On 2023-Jan-18, Karl O. Pinc wrote: > > > On Wed, 18 Jan 2023 13:30:45 +0100 > > Alvaro Herrera wrote: > > > > > Not related to this patch: it's very annoying that in the PDF > > > output, each section in the appendix doesn't start o

Re: Parallelize correlated subqueries that execute within each worker

2023-01-18 Thread Tomas Vondra
Hi, This patch hasn't been updated since September, and it got broken by 4a29eabd1d91c5484426bc5836e0a7143b064f5a which the incremental sort stuff a little bit. But the breakage was rather limited, so I took a stab at fixing it - attached is the result, hopefully correct. I also added a couple mi

Re: document the need to analyze partitioned tables

2023-01-18 Thread Laurenz Albe
On Wed, 2023-01-18 at 11:49 -0600, Justin Pryzby wrote: > I tweaked this a bit to end up with: > > > -    Partitioned tables are not processed by autovacuum.  Statistics > > -    should be collected by running a manual ANALYZE > > when it is > > +    The leaf partitions of a partitioned table are

Re: Implement missing join selectivity estimation for range types

2023-01-18 Thread Mahmoud Sakr
Hi Tomas, Thanks for picking up the patch and for the interesting discussions that you bring ! > Interesting. Are there any particular differences compared to how we > estimate for example range clauses on regular columns? The theory is the same for scalar types. Yet, the statistics that are curre

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

2023-01-18 Thread Tom Lane
One more thing before we move on from this topic. I'd been testing modified versions of the AdjustUpgrade.pm logic by building from a --from-source source tree, which seemed way easier than dealing with a private git repo. As it stands, TestUpgradeXversion.pm refuses to run under $from_source, bu

Re: Non-superuser subscription owners

2023-01-18 Thread Robert Haas
On Sat, Jan 8, 2022 at 2:38 AM Jeff Davis wrote: > Committed. I was just noticing that what was committed here didn't actually fix the problem implied by the subject line. That is, non-superuser still can't own subscriptions. To put that another way, there's no way for the superuser to delegate t

Small omission in type_sanity.sql

2023-01-18 Thread Melanie Plageman
Hi, I was playing around with splitting up the tablespace test in regress so that I could use the tablespaces it creates in another test and happened to notice that the pg_class validity checks in type_sanity.sql are incomplete. It seems that 8b08f7d4820fd did not update the pg_class tests in typ

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

2023-01-18 Thread Robert Haas
On Wed, Jan 18, 2023 at 2:00 PM Nathan Bossart wrote: > On Wed, Jan 18, 2023 at 11:28:57AM -0500, Robert Haas wrote: > > In general, looks good. I think this will often call HaveNFreeProcs > > twice, though, and that would be better to avoid, e.g. > > I should have thought of this. This is fixed

Re: minor bug

2023-01-18 Thread Tom Lane
Laurenz Albe writes: > On Tue, 2023-01-17 at 10:32 -0500, Tom Lane wrote: >> I seem to recall that the original idea was to report the timestamp >> of the commit/abort record we are stopping at. Maybe my memory is >> faulty, but I think that'd be significantly more useful than the >> current beha

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-18 Thread Peter Geoghegan
On Wed, Jan 18, 2023 at 11:02 AM Robert Haas wrote: > On Wed, Jan 18, 2023 at 1:31 PM Peter Geoghegan wrote: > > pgstat_report_analyze() will totally override the > > tabentry->dead_tuples information that drives autovacuum.c, based on > > an estimate derived from a random sample -- which seems t

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-18 Thread Andres Freund
Hi, On 2023-01-17 12:08:01 -0800, Peter Geoghegan wrote: > > I think that's not the fault of relfrozenxid as a trigger, but that we > > simply > > don't keep enough other stats. We should imo at least keep track of: > > If you assume that there is chronic undercounting of dead tuples > (which I

Re: Non-superuser subscription owners

2023-01-18 Thread Mark Dilger
> On Jan 18, 2023, at 11:38 AM, Robert Haas wrote: > > I was just noticing that what was committed here didn't actually fix > the problem implied by the subject line. That is, non-superuser still > can't own subscriptions. Not so. They can. See src/test/subscription/027_nosuperuser.pl > To

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-18 Thread Robert Haas
On Wed, Jan 18, 2023 at 3:15 PM Peter Geoghegan wrote: > Suppose that we notice that its new > estimate for live_tuples approximately matches what the stats > subsystem already thought about live_tuples, while dead_tuples is far > far lower. We shouldn't be so credulous as to believe the new > dea

Re: Non-superuser subscription owners

2023-01-18 Thread Robert Haas
On Wed, Jan 18, 2023 at 3:26 PM Mark Dilger wrote: > Prior to the patch, if a superuser created a subscription, then later was > demoted to non-superuser, the subscription apply workers still applied the > changes with superuser force. So creating a superuser Alice, letting Alice > create a su

Re: Non-superuser subscription owners

2023-01-18 Thread Mark Dilger
> On Jan 18, 2023, at 12:51 PM, Robert Haas wrote: > > Unless I'm missing something, it seems like this could be a quite small patch. I didn't like the idea of the create/alter subscription commands needing to parse the connection string and think about what it might do, because at some poi

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-18 Thread Peter Geoghegan
On Wed, Jan 18, 2023 at 12:44 PM Robert Haas wrote: > I don't know enough about the specifics of how this works to have an > intelligent opinion about how likely these particular ideas are to > work out. However, I think it's risky to look at estimates and try to > infer whether they are reliable.

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

2023-01-18 Thread Andrew Dunstan
On 2023-01-18 We 14:32, Tom Lane wrote: > One more thing before we move on from this topic. I'd been testing > modified versions of the AdjustUpgrade.pm logic by building from a > --from-source source tree, which seemed way easier than dealing > with a private git repo. As it stands, TestUpgrad

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-18 Thread Andres Freund
Hi, On 2023-01-18 12:15:17 -0800, Peter Geoghegan wrote: > On Wed, Jan 18, 2023 at 11:02 AM Robert Haas wrote: > > On Wed, Jan 18, 2023 at 1:31 PM Peter Geoghegan wrote: > > > pgstat_report_analyze() will totally override the > > > tabentry->dead_tuples information that drives autovacuum.c, base

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-18 Thread Peter Geoghegan
On Wed, Jan 18, 2023 at 1:02 PM Peter Geoghegan wrote: > Some of what I'm proposing arguably amounts to deliberately adding a > bias. But that's not an unreasonable thing in itself. I think of it as > related to the bias-variance tradeoff, which is a concept that comes > up a lot in machine learni

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

2023-01-18 Thread Nathan Bossart
On Wed, Jan 18, 2023 at 02:51:38PM -0500, Robert Haas wrote: > Should (nfree < SuperuserReservedBackends) be using <=, or am I confused? I believe < is correct. At this point, the new backend will have already claimed a proc struct, so if the number of remaining free slots equals the number of re

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

2023-01-18 Thread Tom Lane
Andrew Dunstan writes: > On 2023-01-18 We 14:32, Tom Lane wrote: >> I suppose that the reason for not running under $from_source is to >> avoid corrupting the saved installations with unofficial versions. >> However, couldn't we skip the "save" step and still run the upgrade >> tests against whate

Re: document the need to analyze partitioned tables

2023-01-18 Thread Bruce Momjian
On Wed, Jan 18, 2023 at 10:15:18AM +0100, Laurenz Albe wrote: > On Tue, 2023-01-17 at 16:16 -0500, Bruce Momjian wrote: > > On Tue, Jan 17, 2023 at 03:00:50PM -0600, Justin Pryzby wrote: > > > Maybe (all?) the clarification the docs need is to say: > > > "Partitioned tables are not *themselves* pro

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

2023-01-18 Thread Sandro Santilli
On Mon, Jan 16, 2023 at 11:57:30PM -0500, Regina Obe wrote: > What would be more bullet-proof is having an extra column in pg_extension or > adding an extra array element to pg_extension.extcondition[] that allows you > to say "Hey, don't allow this to be relocatable cause other extensions > depen

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-18 Thread Andres Freund
Hi, On 2023-01-18 13:08:44 -0800, Andres Freund wrote: > One complicating factor is that VACUUM sometimes computes an incrementally > more bogus n_live_tup when it skips pages due to the VM, whereas ANALYZE > computes something sane. I unintentionally encountered one when I was trying > something

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-18 Thread Peter Geoghegan
On Wed, Jan 18, 2023 at 1:08 PM Andres Freund wrote: > I suggested nearby to only have ANALYZE dead_tuples it if there's been no > [auto]vacuum since the stats entry was created. That allows recovering from > stats resets, be it via crashes or explicitly. What do you think? I like that idea. It's

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

2023-01-18 Thread Regina Obe
> On Mon, Jan 16, 2023 at 11:57:30PM -0500, Regina Obe wrote: > > > What would be more bullet-proof is having an extra column in > > pg_extension or adding an extra array element to > > pg_extension.extcondition[] that allows you to say "Hey, don't allow > > this to be relocatable cause other exte

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

2023-01-18 Thread Andrew Dunstan
On 2023-01-18 We 16:14, Tom Lane wrote: > Andrew Dunstan writes: >> On 2023-01-18 We 14:32, Tom Lane wrote: >>> I suppose that the reason for not running under $from_source is to >>> avoid corrupting the saved installations with unofficial versions. >>> However, couldn't we skip the "save" step

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

2023-01-18 Thread Tom Lane
Andrew Dunstan writes: > I think we can do what you want but it's a bit harder than what you've > done. If we're not going to save the current run's product then we need > to run the upgrade test from a different directory (probably directly in > "$buildroot/$this_branch/inst"). Otherwise we'll be

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-18 Thread Andres Freund
Hi, On 2023-01-18 13:42:40 -0800, Andres Freund wrote: > The real point of change appears to be 10->11. > > There's a relevant looking difference in the vac_estimate_reltuples call: > 10: > /* now we can compute the new value for pg_class.reltuples */ > vacrelstats->new_rel_tuples = va

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-18 Thread Peter Geoghegan
On Wed, Jan 18, 2023 at 2:22 PM Andres Freund wrote: > The problem with the change is here: > > /* > * Okay, we've covered the corner cases. The normal calculation is to > * convert the old measurement to a density (tuples per page), then > * estimate the number

  1   2   >