JSON constructors and window functions

2022-04-01 Thread Jaime Casanova
I got a crash running the below query on the regression database: """ select pg_catalog.json_object_agg_unique(10, cast(ref_0.level2_no as int4)) over (partition by ref_0.parent_no order by ref_0.level2_no) from public.transition_table_level2

Re: A test for replay of regression tests

2022-04-01 Thread Tom Lane
Thomas Munro writes: > cfbot found another source of nondeterminism in the regression tests, > due to the smaller shared_buffers used in this TAP test: This failure seems related but not identical: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=myna=2022-04-02%2004%3A00%3A26

Re: wrong fds used for refilenodes after pg_upgrade relfilenode changes Reply-To:

2022-04-01 Thread Thomas Munro
On Sat, Apr 2, 2022 at 10:03 AM Thomas Munro wrote: > Another idea would be to call a new function DropPendingWritebacks(), > and also tell all the SMgrRelation objects to close all their internal > state (ie the fds + per-segment objects) but not free the main > SMgrRelationData object, and for

Re: Skipping logical replication transactions on subscriber side

2022-04-01 Thread Amit Kapila
On Sat, Apr 2, 2022 at 7:29 AM Noah Misch wrote: > > On Sat, Apr 02, 2022 at 06:49:20AM +0530, Amit Kapila wrote: > > After applying datum_to_lsn_skiplsn_1.patch, I get another failure. Logs > attached. > The failure is for the same reason. I noticed that even when skip lsn value should be 0/0,

Re: Rewriting the test of pg_upgrade as a TAP test - take three - remastered set

2022-04-01 Thread Michael Paquier
On Fri, Apr 01, 2022 at 08:34:34AM -0500, Justin Pryzby wrote: > If you do that, should also remove upgradecheck from .cirrus.yaml, which > currently runs the upgradecheck target. Indeed. It makes no sense to keep that. I have removed this part and applied the patch, after one extra run through

Re: PostgreSQL shutdown modes

2022-04-01 Thread Michael Paquier
On Fri, Apr 01, 2022 at 01:22:05PM -0400, Robert Haas wrote: > I attach herewith a modest patch to rename these shutdown modes to > more accurately correspond to their actual characteristics. > > Date: Fri, 1 Apr 2022 12:50:05 -0400 I love the idea. Just in time, before the feature freeze

Re: Skipping logical replication transactions on subscriber side

2022-04-01 Thread Noah Misch
On Sat, Apr 02, 2022 at 06:49:20AM +0530, Amit Kapila wrote: > On Sat, Apr 2, 2022 at 5:41 AM Noah Misch wrote: > > > > On Fri, Apr 01, 2022 at 09:25:52PM +0900, Masahiko Sawada wrote: > > > > On Fri, Apr 1, 2022 at 4:44 PM Noah Misch wrote: > > > > > src/test/subscription/t/029_on_error.pl has

Re: Skipping logical replication transactions on subscriber side

2022-04-01 Thread Amit Kapila
On Sat, Apr 2, 2022 at 5:41 AM Noah Misch wrote: > > On Fri, Apr 01, 2022 at 09:25:52PM +0900, Masahiko Sawada wrote: > > > On Fri, Apr 1, 2022 at 4:44 PM Noah Misch wrote: > > > > src/test/subscription/t/029_on_error.pl has been failing reliably on > > > > the five > > > > AIX buildfarm

Re: logical decoding and replication of sequences

2022-04-01 Thread Tomas Vondra
On 4/1/22 17:02, Tomas Vondra wrote: > > > On 3/28/22 07:29, Amit Kapila wrote: >> ... >> >> While thinking about this, I think I see a problem with the >> non-transactional handling of sequences. It seems that we will skip >> sending non-transactional sequence change if it occurs before the >>

Re: Fix overflow in DecodeInterval

2022-04-01 Thread Tom Lane
Joseph Koshakow writes: > * The existing code for rounding had a lot of int to double > casting and vice versa. I *think* that doubles are able to completely > represent the range of ints. However doubles are not able to represent > the full range of int64. After making the change I started

Re: pg_walinspect - a new extension to get raw WAL data and WAL stats

2022-04-01 Thread Andres Freund
Hi, On 2022-04-01 16:35:38 -0700, Jeff Davis wrote: > * I don't think we need the stats at all. We can run GROUP BY queries > on the results of pg_get_wal_records_info(). It's well over an order of magnitude slower. And I don't see how that can be avoided. That makes it practically useless. See

Re: pg_walinspect - a new extension to get raw WAL data and WAL stats

2022-04-01 Thread Jeff Davis
On Sat, 2022-03-26 at 10:31 +0530, Bharath Rupireddy wrote: > Attaching v16 patch-set, only change in v16-0002-pg_walinspect.patch, > others remain the same. I looked more closely at this patch. * It seems that pg_get_wal_record() is not returning the correct raw data for the record. I tested

Re: Higher level questions around shared memory stats

2022-04-01 Thread Andres Freund
Hi, On 2022-03-29 12:17:27 -0700, Andres Freund wrote: > Separate from the minutia in [1] I'd like to discuss a few questions of more > general interest. I'll post another question or two later. 5) What does track_counts = off mean? I just was trying to go through the shared memory stats patch

Re: [Proposal] vacuumdb --schema only

2022-04-01 Thread Nathan Bossart
On Fri, Apr 01, 2022 at 10:01:28AM -0500, Justin Pryzby wrote: > On Wed, Mar 30, 2022 at 02:22:58PM -0700, Nathan Bossart wrote: >> I'm personally -1 for the --exclude-schema option. I don't see any >> existing "exclude" options in vacuumdb, and the uses for such an option >> seem rather limited.

use has_privs_of_role() for pg_hba.conf

2022-04-01 Thread Nathan Bossart
Hi hackers, 6198420 ensured that has_privs_of_role() is used for predefined roles, which means that the role inheritance hierarchy is checked instead of mere role membership. However, inheritance is still not respected for pg_hba.conf. Specifically, "samerole", "samegroup", and "+" still use

Re: wrong fds used for refilenodes after pg_upgrade relfilenode changes Reply-To:

2022-04-01 Thread Thomas Munro
On Sat, Apr 2, 2022 at 2:52 AM Robert Haas wrote: > On Fri, Apr 1, 2022 at 2:04 AM Thomas Munro wrote: > > The v1-0003 patch introduced smgropen_cond() to avoid the problem of > > IssuePendingWritebacks(), which does desynchronised smgropen() calls > > and could open files after the barrier but

merge documentation fix

2022-04-01 Thread Euler Taveira
Hi, While inspecting the MERGE documentation, I noticed that there is an extra semicolon in one of the examples that shouldn't be there. diff --git a/doc/src/sgml/ref/merge.sgml b/doc/src/sgml/ref/merge.sgml index c547122c9b..ac1c0a83dd 100644 --- a/doc/src/sgml/ref/merge.sgml +++

Re: [PATCH] Add extra statistics to explain for Nested Loop

2022-04-01 Thread Ekaterina Sokolova
Hi, hackers. Thank you for your attention to this topic. Julien Rouhaud wrote: +static void show_loop_info(Instrumentation *instrument, bool isworker, + ExplainState *es); I think this should be done as a separate refactoring commit. Sure. I divided the patch. Now

Re: Can we automatically add elapsed times to tap test log?

2022-04-01 Thread Andrew Dunstan
On 4/1/22 15:16, Andrew Dunstan wrote: > On 4/1/22 13:44, Nathan Bossart wrote: >> On Fri, Apr 01, 2022 at 10:21:50AM -0700, Andres Freund wrote: >>> right now I am looking at a test added in the shmstats patch that's slow on >>> CI, on windows only. Unfortunately the regress_log_* output is

Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements

2022-04-01 Thread Andres Freund
Hi, On 2022-04-01 22:47:02 +0300, Andrei Zubkov wrote: > + entry = (pgssEntry *) hash_search(pgss_hash, , HASH_FIND, > NULL); > + > + if (entry) { > + /* Found */ > + if (minmax_only) { > + /* When

Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements

2022-04-01 Thread Andrei Zubkov
Hi, Thank you, Greg On Fri, 2022-04-01 at 11:38 -0400, Greg Stark wrote: > [13:19:51.544] pg_stat_statements.c: In function ‘entry_reset’: > [13:19:51.544] pg_stat_statements.c:2598:32: error: > ‘minmax_stats_reset’ may be used uninitialized in this function > [-Werror=maybe-uninitialized] >

Re: Can we automatically add elapsed times to tap test log?

2022-04-01 Thread Andres Freund
Hi, On 2022-04-01 10:21:50 -0700, Andres Freund wrote: > right now I am looking at a test added in the shmstats patch that's slow on > CI, on windows only. Unfortunately the regress_log_* output is useless as-is > to figure out where things hang. This turns out to be a problem somewhere in the

Re: Can we automatically add elapsed times to tap test log?

2022-04-01 Thread Andrew Dunstan
On 4/1/22 13:44, Nathan Bossart wrote: > On Fri, Apr 01, 2022 at 10:21:50AM -0700, Andres Freund wrote: >> right now I am looking at a test added in the shmstats patch that's slow on >> CI, on windows only. Unfortunately the regress_log_* output is useless as-is >> to figure out where things

Re: should vacuum's first heap pass be read-only?

2022-04-01 Thread Peter Geoghegan
On Fri, Apr 1, 2022 at 11:39 AM Robert Haas wrote: > So I'm completely confused here. If we always start a vacuum with > lazy_scan_heap(), as you said you wanted, then we will not save any > heap scanning. The term "start a VACUUM" becomes ambiguous with the conveyor belt. What I was addressed

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2022-04-01 Thread Robert Haas
On Fri, Apr 1, 2022 at 12:22 AM Kyotaro Horiguchi wrote: > By the way, may I ask how do we fix this? The existing recovery code > already generates just-to-be-delete files in a real directory in > pg_tblspc sometimes, and elsewise skip applying WAL records on > nonexistent heap pages. It is the

Re: should vacuum's first heap pass be read-only?

2022-04-01 Thread Robert Haas
On Fri, Apr 1, 2022 at 2:27 PM Peter Geoghegan wrote: > I'm not following. It seems like you're saying that the ability to > vacuum indexes on their own schedule (based on their own needs) is not > sufficiently compelling. I think it's very compelling, with enough > indexes (and maybe not very

Re: PostgreSQL shutdown modes

2022-04-01 Thread Justin Pryzby
Isn't this missing support in pg_dumb ?

Re: should vacuum's first heap pass be read-only?

2022-04-01 Thread Peter Geoghegan
On Fri, Apr 1, 2022 at 11:04 AM Robert Haas wrote: > I guess you're right, and it's actually a little bit better than that, > because even if the data does fit into shared memory, we'll have to > pass fewer TIDs to the worker to be removed from the heap, which might > save a few CPU cycles. But I

Re: should vacuum's first heap pass be read-only?

2022-04-01 Thread Robert Haas
On Fri, Apr 1, 2022 at 12:08 AM Dilip Kumar wrote: > After thinking more about this I see there is some value of > remembering the dead tids in the conveyor belt. Basically, the point > is if there are multiple indexes and we do the index vacuum for some > of the indexes and skip for others.

Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations

2022-04-01 Thread Peter Geoghegan
On Thu, Mar 31, 2022 at 11:19 AM Peter Geoghegan wrote: > The assert is "Assert(diff > 0)", and not "Assert(diff >= 0)". Attached is v15. I plan to commit the first two patches (the most substantial two patches by far) in the next couple of days, barring objections. v15 removes this

Re: Can we automatically add elapsed times to tap test log?

2022-04-01 Thread Nathan Bossart
On Fri, Apr 01, 2022 at 10:21:50AM -0700, Andres Freund wrote: > right now I am looking at a test added in the shmstats patch that's slow on > CI, on windows only. Unfortunately the regress_log_* output is useless as-is > to figure out where things hang. > > I've hit this several times before. Of

Re: unlogged sequences

2022-04-01 Thread Robert Haas
On Fri, Apr 1, 2022 at 12:31 PM Peter Eisentraut wrote: > > An "internal" dependency means that the internal object shouldn't really > > be operated on directly. (In some cases it's allowed for convenience.) > > So I think in that case the sequence must follow the table's persistence > > in all

PostgreSQL shutdown modes

2022-04-01 Thread Robert Haas
Hi, I think it's pretty evident that the names we've chosen for the various PostgreSQL shutdown modes are pretty terrible, and maybe we should try to do something about that. There is nothing "smart" about a smart shutdown. The usual result of attempting a smart shutdown is that the server never

Can we automatically add elapsed times to tap test log?

2022-04-01 Thread Andres Freund
Hi, right now I am looking at a test added in the shmstats patch that's slow on CI, on windows only. Unfortunately the regress_log_* output is useless as-is to figure out where things hang. I've hit this several times before. Of course it's not too hard to hack up something printing elapsed

Re: GSoC: pgmoneta: Write-Ahead Log (WAL) infrastructure (2022)

2022-04-01 Thread Jesper Pedersen
Hi Jinlang, On 4/1/22 12:39, Jinlang Wang wrote: To whom it may concern: Here is my proposal (https://docs.google.com/document/d/1KKKDU6iP0GOkAMSdGRyxFJRgW964JFVROnpKkbzWyNw/edit?usp=sharing )

GSoC: pgmoneta: Write-Ahead Log (WAL) infrastructure (2022)

2022-04-01 Thread Jinlang Wang
To whom it may concern: Here is my proposal (https://docs.google.com/document/d/1KKKDU6iP0GOkAMSdGRyxFJRgW964JFVROnpKkbzWyNw/edit?usp=sharing ) for GSoC. Please check! Thanks, Jinlang Wang

Re: unlogged sequences

2022-04-01 Thread David G. Johnston
On Fri, Apr 1, 2022 at 9:31 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 01.04.22 18:22, Peter Eisentraut wrote: > > > > On 01.04.22 00:43, Tomas Vondra wrote: > >> Hmm, so what about doing a little bit different thing: > >> > >> 1) owned sequences inherit persistence of

Re: unlogged sequences

2022-04-01 Thread David G. Johnston
On Fri, Apr 1, 2022 at 9:22 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > > On 01.04.22 00:43, Tomas Vondra wrote: > > Hmm, so what about doing a little bit different thing: > > > > 1) owned sequences inherit persistence of the table by default > > > > 2) allow ALTER SEQUENCE

Re: unlogged sequences

2022-04-01 Thread Peter Eisentraut
On 01.04.22 18:22, Peter Eisentraut wrote: On 01.04.22 00:43, Tomas Vondra wrote: Hmm, so what about doing a little bit different thing: 1) owned sequences inherit persistence of the table by default 2) allow ALTER SEQUENCE to change persistence for all sequences (no restriction for owned

Re: unlogged sequences

2022-04-01 Thread Peter Eisentraut
On 01.04.22 00:43, Tomas Vondra wrote: Hmm, so what about doing a little bit different thing: 1) owned sequences inherit persistence of the table by default 2) allow ALTER SEQUENCE to change persistence for all sequences (no restriction for owned sequences) 3) ALTER TABLE ... SET [UN]LOGGED

Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements

2022-04-01 Thread Julien Rouhaud
Hi, On Fri, Apr 01, 2022 at 11:38:52AM -0400, Greg Stark wrote: > FYI this has a compiler warning showing up on the cfbot: > > [13:19:51.544] pg_stat_statements.c: In function ‘entry_reset’: > [13:19:51.544] pg_stat_statements.c:2598:32: error: > ‘minmax_stats_reset’ may be used uninitialized in

Re: Add non-blocking version of PQcancel

2022-04-01 Thread Jelte Fennema
Attached is the latest version of this patch, which I think is now in a state in which it could be merged. The changes are: 1. Don't do host and address discovery for cancel connections. It now reuses raddr and whichhost from the original connection. This makes sure the cancel always goes

Re: Restructure ALTER TABLE notes to clarify table rewrites and verification scans

2022-04-01 Thread Matthias van de Meent
On Fri, 1 Apr 2022 at 16:10, James Coleman wrote: > > On Thu, Mar 31, 2022 at 10:58 AM Matthias van de Meent > wrote: > > > > On Tue, 29 Mar 2022 at 16:20, James Coleman wrote: > > > > > > Over in the "Document atthasmissing default optimization avoids > > > verification table scan" thread

Re: Temporary tables versus wraparound... again

2022-04-01 Thread Greg Stark
On Thu, 31 Mar 2022 at 16:05, Greg Stark wrote: > > I haven't wrapped my head around multixacts yet. It's complicated by > this same codepath being used for truncates of regular tables that > were created in the same transaction. So my best idea so far is to actually special-case the temp table

Patches with failing tests in Commitfest

2022-04-01 Thread Greg Stark
So far I've been moving patches with failing tests to Waiting on Author but there are a number with "minor" failures or failures which look unrelated to the patch. There are 20 patches with at least one failing test in Ready for Comitter (2) and Needs Review (18). Here's a summary of the reasons

Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements

2022-04-01 Thread Greg Stark
FYI this has a compiler warning showing up on the cfbot: [13:19:51.544] pg_stat_statements.c: In function ‘entry_reset’: [13:19:51.544] pg_stat_statements.c:2598:32: error: ‘minmax_stats_reset’ may be used uninitialized in this function [-Werror=maybe-uninitialized] [13:19:51.544] 2598 |

Re: Removing unneeded self joins

2022-04-01 Thread Greg Stark
Sigh. And now there's a patch conflict in a regression test expected output: sysviews.out Please rebase. Incidentally, make sure to check the expected output is actually correct. It's easy to "fix" an expected output to accidentally just memorialize an incorrect output. Btw, it's the last week

Re: [PATCH] Accept IP addresses in server certificate SANs

2022-04-01 Thread Jacob Champion
On Fri, 2022-04-01 at 16:07 +0200, Peter Eisentraut wrote: > I have committed this. > > I have removed the inet header refactoring that you had. That wasn't > necessary, since pg_inet_net_ntop() can use the normal AF_INET* > constants. The PGSQL_AF_INET* constants are only for the internal >

Re: Per-table storage parameters for TableAM/IndexAM extensions

2022-04-01 Thread Greg Stark
This patch still has code warnings on the cfbot and I don't think they're platform-specific: [00:28:28.236] gram.y: In function ‘base_yyparse’: [00:28:28.236] gram.y:2851:58: error: passing argument 2 of ‘makeDefElemExtended’ from incompatible pointer type [-Werror=incompatible-pointer-types]

Re: [PATCH] src/interfaces/libpq/Makefile: fix pkg-config without openssl

2022-04-01 Thread Peter Eisentraut
On 31.03.22 18:37, Fabrice Fontaine wrote: Do not add openssl dependencies to libpq pkg-config file if openssl is disabled to avoid the following build failure with libdbi-drivers raised since commit beff361bc1edc24ee5f8b2073a1e5e4c92ea66eb: configure: error: Package requirements (libpq) were

Re: Preventing indirection for IndexPageGetOpaque for known-size page special areas

2022-04-01 Thread Matthias van de Meent
On Fri, 1 Apr 2022 at 10:50, Matthias van de Meent wrote: > > On Fri, 1 Apr 2022 at 07:38, Michael Paquier wrote: > > > > On Thu, Mar 31, 2022 at 12:09:35PM +0200, Matthias van de Meent wrote: > > > PageInit MAXALIGNs the size of the special area that it receives as an > > > argument; so any

Re: Implementing Incremental View Maintenance

2022-04-01 Thread Greg Stark
This patch has bitrotted due to some other patch affecting trigger.c. Could you post a rebase? This is the last week of the CF before feature freeze so time is of the essence.

Re: Add LZ4 compression in pg_dump

2022-04-01 Thread gkokolatos
On Thursday, March 31st, 2022 at 4:34 AM, Michael Paquier wrote: > On Wed, Mar 30, 2022 at 03:32:55PM +, gkokola...@pm.me wrote: > > On Wednesday, March 30th, 2022 at 7:54 AM, Michael Paquier > > mich...@paquier.xyz wrote: > > Okay. 0002 looks fine as-is, and I don't mind the extra fatal()

Re: head fails to build on SLES 12 (wal_compression=zstd)

2022-04-01 Thread Tom Lane
I wrote: > That seems like the appropriate answer to me. I verified that we > build cleanly and pass check-world against 1.4.0, and later I'm > going to set up BF member longfin to use that. Done ... > In short, I think we should push Justin's version-check patch, > and also fix the SGML docs

Re: logical decoding and replication of sequences

2022-04-01 Thread Tomas Vondra
On 3/28/22 07:29, Amit Kapila wrote: > ... > > While thinking about this, I think I see a problem with the > non-transactional handling of sequences. It seems that we will skip > sending non-transactional sequence change if it occurs before the > decoding has reached a consistent point but the

Re: [Proposal] vacuumdb --schema only

2022-04-01 Thread Justin Pryzby
On Wed, Mar 30, 2022 at 02:22:58PM -0700, Nathan Bossart wrote: > I'm personally -1 for the --exclude-schema option. I don't see any > existing "exclude" options in vacuumdb, and the uses for such an option > seem rather limited. If we can point to specific use-cases for this > option, I might

Re: CREATEROLE and role ownership hierarchies

2022-04-01 Thread Robert Haas
On Fri, Apr 1, 2022 at 10:46 AM Greg Stark wrote: > The cfbot is testing the last patch posted to this thread which is the > remove-self-own patch which was already committed. I gather that > there's still (at least one) patch under discussion. > > Could I suggest reposting the last version of

Re: Collecting statistics about contents of JSONB columns

2022-04-01 Thread Greg Stark
This patch has bitrotted, presumably after the other JSON patchset was applied. It looks like it's failing in the json header file so it may be as simple as additional functions added on nearby lines. Please rebase. Reminder, it's the last week of the commitfest so time is of the essence

Re: CREATEROLE and role ownership hierarchies

2022-04-01 Thread Greg Stark
The cfbot is testing the last patch posted to this thread which is the remove-self-own patch which was already committed. I gather that there's still (at least one) patch under discussion. Could I suggest reposting the last version of the main patch, perhaps rebasing it. That way the cfbot would

Re: Proposal: allow database-specific role memberships

2022-04-01 Thread Greg Stark
Patch doesn't apply again... [image: 1jfj7m.jpg]

Re: Use "WAL segment" instead of "log segment" consistently in user-facing messages

2022-04-01 Thread Nathan Bossart
On Fri, Apr 01, 2022 at 10:31:10AM +0900, Kyotaro Horiguchi wrote: > you should at least save the contents of the cluster's > pg_wal > - subdirectory, as it might contain logs which > + subdirectory, as it might contain WAL files which > were not archived before the system

Re: Restructure ALTER TABLE notes to clarify table rewrites and verification scans

2022-04-01 Thread James Coleman
On Thu, Mar 31, 2022 at 10:58 AM Matthias van de Meent wrote: > > On Tue, 29 Mar 2022 at 16:20, James Coleman wrote: > > > > Over in the "Document atthasmissing default optimization avoids > > verification table scan" thread David Johnston (who I've cc'd) > > suggested that my goals might be

Re: psql - add SHOW_ALL_RESULTS option

2022-04-01 Thread Peter Eisentraut
On 01.04.22 07:46, Fabien COELHO wrote: Attached a rebase. Again, after the SendQuery refactoring extraction. I'm doing this locally, so don't feel obliged to send more of these. ;-) I've started committing this now, in pieces.

Re: [PATCH] Accept IP addresses in server certificate SANs

2022-04-01 Thread Peter Eisentraut
On 31.03.22 20:15, Jacob Champion wrote: On Thu, 2022-03-31 at 16:32 +0200, Peter Eisentraut wrote: Why add a (failry complicated) pg_inet_pton() when a perfectly reasonable inet_pton() exists? I think it was mostly just that inet_aton() and pg_inet_net_ntop() both had ports, and I figured I

Re: [PATCH] src/interfaces/libpq/Makefile: fix pkg-config without openssl

2022-04-01 Thread Tom Lane
Daniel Gustafsson writes: >> On 31 Mar 2022, at 18:37, Fabrice Fontaine >> wrote: >> +ifeq ($(with_ssl),openssl) >> PKG_CONFIG_REQUIRES_PRIVATE = libssl libcrypto >> +endif > That seems reasonable, is there any reason why the referenced commit didn't do > that? Looks like a clear oversight to

Re: Reword docs of feature "Remove temporary files after backend crash"

2022-04-01 Thread Robert Haas
On Fri, Apr 1, 2022 at 9:42 AM Daniel Gustafsson wrote: > I think "useless" is a bit too strong and subjective given that it's > describing > an unknown situation out of the ordinary. How about "outdated" or "redundant" > (or something else entirely which is even better)? It's the existing

Re: wrong fds used for refilenodes after pg_upgrade relfilenode changes Reply-To:

2022-04-01 Thread Robert Haas
On Fri, Apr 1, 2022 at 2:04 AM Thomas Munro wrote: > The v1-0003 patch introduced smgropen_cond() to avoid the problem of > IssuePendingWritebacks(), which does desynchronised smgropen() calls > and could open files after the barrier but just before they are > unlinked. Makes sense, but... > >

Re: Reword docs of feature "Remove temporary files after backend crash"

2022-04-01 Thread Daniel Gustafsson
> On 12 Oct 2021, at 08:40, Bharath Rupireddy > wrote: > Here's a v2 patch that I could come up with. Please review it further. +debugging, for example. Repeated crashes may however result in +accumulation of useless files. This parameter can only be set in the I think

Re: [PATCH] src/interfaces/libpq/Makefile: fix pkg-config without openssl

2022-04-01 Thread Daniel Gustafsson
> On 31 Mar 2022, at 18:37, Fabrice Fontaine wrote: > +ifeq ($(with_ssl),openssl) > PKG_CONFIG_REQUIRES_PRIVATE = libssl libcrypto > +endif That seems reasonable, is there any reason why the referenced commit didn't do that? -- Daniel Gustafsson https://vmware.com/

Re: Rewriting the test of pg_upgrade as a TAP test - take three - remastered set

2022-04-01 Thread Justin Pryzby
On Fri, Apr 01, 2022 at 08:53:10PM +0900, Michael Paquier wrote: > On Fri, Apr 01, 2022 at 03:01:38PM +0900, Michael Paquier wrote: > > On Thu, Mar 31, 2022 at 10:51:59PM -0500, Justin Pryzby wrote: > >> Is diff -q defined somewhere ? I can't find it in postgres sources nor in > >> sources for bf

[PATCH] src/interfaces/libpq/Makefile: fix pkg-config without openssl

2022-04-01 Thread Fabrice Fontaine
Do not add openssl dependencies to libpq pkg-config file if openssl is disabled to avoid the following build failure with libdbi-drivers raised since commit beff361bc1edc24ee5f8b2073a1e5e4c92ea66eb: configure: error: Package requirements (libpq) were not met: Package 'libssl', required by

Re: Use generation context to speed up tuplesorts

2022-04-01 Thread Justin Pryzby
On Fri, Apr 01, 2022 at 10:00:08PM +1300, David Rowley wrote: > 0002: > This modifies the tuplesort API so that instead of having a > randomAccess bool flag, Per cirrus, this missed updating one line for dtrace. On Fri, Apr 01, 2022 at 10:00:08PM +1300, David Rowley wrote: > I feel this is a

Re: Correct docs re: rewriting indexes when table rewrite is skipped

2022-04-01 Thread James Coleman
On Fri, Apr 1, 2022 at 8:58 AM Robert Haas wrote: > > On Thu, Mar 31, 2022 at 4:19 PM James Coleman wrote: > > On Thu, Mar 31, 2022 at 3:25 PM Robert Haas wrote: > > > On Thu, Mar 31, 2022 at 10:51 AM James Coleman wrote: > > > > Updated. > > > > > > This version looks fine to me. If nobody

Re: Correct docs re: rewriting indexes when table rewrite is skipped

2022-04-01 Thread Robert Haas
On Thu, Mar 31, 2022 at 4:19 PM James Coleman wrote: > On Thu, Mar 31, 2022 at 3:25 PM Robert Haas wrote: > > On Thu, Mar 31, 2022 at 10:51 AM James Coleman wrote: > > > Updated. > > > > This version looks fine to me. If nobody objects I will commit it and > > credit myself as a co-author. > >

Re: Is monotonous xid8 is a right way to do?

2022-04-01 Thread Pavel Borisov
> > A different and more important issue (IMO) is that the xlog record > header currently only supports 32-bit xids -- long-running > transactions can reasonably see a xid4 wraparound in their lifetime. You're completely right. This is a first of making xid's 64-bit proposed [1] i.e, making SLRU

Re: Is monotonous xid8 is a right way to do?

2022-04-01 Thread Matthias van de Meent
On Fri, 1 Apr 2022 at 14:13, Pavel Borisov wrote: > > Hi hackers! > > Now we have two data types xid and xid8. The first one (xid) makes a numeric > ring, and xid8 are monotonous. > > As per [1] "Unlike xid values, xid8 values increase strictly monotonically > and cannot be reused in the

Re: Is monotonous xid8 is a right way to do?

2022-04-01 Thread Dagfinn Ilmari Mannsåker
Dagfinn Ilmari Mannsåker writes: > Even if a cluster was consuming a million XIDs per second, it would take > over half a million years to wrap around the 64bit range. Is that really > something we should worry about? > > ilmari@[local]:5432 ~=# select 2::numeric^64/10^9/3600/24/365; Oops, that

Re: Is monotonous xid8 is a right way to do?

2022-04-01 Thread Maxim Orlov
Hi! In my view, FullTransactionId type was implemented without considering 64 bit wraparound. Which seems to be unlikely to happen. Then on that basis xid8 type was created. Details of that particular implementation infiltrated into documentation and became sort of normal. In my opinion,

Re: Is monotonous xid8 is a right way to do?

2022-04-01 Thread Dagfinn Ilmari Mannsåker
Pavel Borisov writes: > Hi hackers! > > Now we have two data types xid and xid8. The first one (xid) makes a > numeric ring, and xid8 are monotonous. > > As per [1] "Unlike xid values, xid8 values increase strictly monotonically > and cannot be reused in the lifetime of a database cluster." > >

Re: Skipping logical replication transactions on subscriber side

2022-04-01 Thread Masahiko Sawada
On Fri, Apr 1, 2022 at 5:10 PM Masahiko Sawada wrote: > > On Fri, Apr 1, 2022 at 4:44 PM Noah Misch wrote: > > > > On Tue, Mar 29, 2022 at 10:43:00AM +0530, Amit Kapila wrote: > > > On Mon, Mar 21, 2022 at 5:51 PM Euler Taveira wrote: > > > > On Mon, Mar 21, 2022, at 12:25 AM, Amit Kapila

Is monotonous xid8 is a right way to do?

2022-04-01 Thread Pavel Borisov
Hi hackers! Now we have two data types xid and xid8. The first one (xid) makes a numeric ring, and xid8 are monotonous. As per [1] "Unlike xid values, xid8 values increase strictly monotonically and cannot be reused in the lifetime of a database cluster." As a consequence of [1] xid8 can have

Re: Rewriting the test of pg_upgrade as a TAP test - take three - remastered set

2022-04-01 Thread Michael Paquier
On Fri, Apr 01, 2022 at 03:01:38PM +0900, Michael Paquier wrote: > On Thu, Mar 31, 2022 at 10:51:59PM -0500, Justin Pryzby wrote: >> Is diff -q defined somewhere ? I can't find it in postgres sources nor in >> sources for bf client. > > 322becb has added such a call, at the end of

Re: pg_rewind copies

2022-04-01 Thread Daniel Gustafsson
> On 1 Apr 2022, at 12:46, Heikki Linnakangas wrote: >> +if (len >= sizeof(dstpath)) >> +pg_fatal("filepath buffer too small"); /* shouldn't happen */ > > Makes sense. I would remove the "shouldn't happen"; it's not very hard to > make it happen, you just need a very long

Re: pg_rewind copies

2022-04-01 Thread Heikki Linnakangas
On 01/04/2022 12:00, Daniel Gustafsson wrote: I took another look at this patch, and I think it's ready to go in, it clearly fixes a bug that isn't too hard to hit in production settings. To ensure we don't break this I've added a testcase which pipes the pg_rewind --verbose output to a file

Re: Use generation context to speed up tuplesorts

2022-04-01 Thread David Rowley
On Wed, 23 Mar 2022 at 04:08, David Rowley wrote: > If nobody has any objections to the 0001 patch then I'd like to move > ahead with it in the next few days. For the 0002 patch, I'm currently > feeling like we shouldn't be using the Generation context for bounded > sorts. The only way I can

Re: pg_rewind copies

2022-04-01 Thread Daniel Gustafsson
I took another look at this patch, and I think it's ready to go in, it clearly fixes a bug that isn't too hard to hit in production settings. To ensure we don't break this I've added a testcase which pipes the pg_rewind --verbose output to a file it's asked to copy, which then guarantees that the

Re: Unit tests for SLRU

2022-04-01 Thread Pavel Borisov
пт, 1 апр. 2022 г. в 07:47, Noah Misch : > On Thu, Mar 31, 2022 at 05:30:41PM +0300, Aleksander Alekseev wrote: > > I used src/test/modules/test_* modules as an example. > > > If time permits, please take a quick look at the patch and let me know > > if I'm moving the right direction. There will

Re: Preventing indirection for IndexPageGetOpaque for known-size page special areas

2022-04-01 Thread Matthias van de Meent
On Fri, 1 Apr 2022 at 07:38, Michael Paquier wrote: > > On Thu, Mar 31, 2022 at 12:09:35PM +0200, Matthias van de Meent wrote: > > PageInit MAXALIGNs the size of the special area that it receives as an > > argument; so any changes to the page header that would misalign the > > value would be

Re: generic plans and "initial" pruning

2022-04-01 Thread Amit Langote
On Fri, Apr 1, 2022 at 5:20 PM David Rowley wrote: > On Fri, 1 Apr 2022 at 19:58, Amit Langote wrote: > > Yes, the ExecLockRelsInfo node in the current patch, that first gets > > added to the QueryDesc and subsequently to the EState of the query, > > serves as that stashing place. Not sure if

Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403)

2022-04-01 Thread Kyotaro Horiguchi
At Wed, 30 Mar 2022 17:58:24 +0900 (JST), Kyotaro Horiguchi wrote in > At Wed, 30 Mar 2022 11:46:13 +0900 (JST), Kyotaro Horiguchi > wrote in > > But, in the first place the *fix* has been found to be wrong. I'm > > going to search for the right fix.. > > FETCH uses the snapshot at

Re: Tablesync early exit

2022-04-01 Thread Peter Smith
On Wed, Mar 16, 2022 at 4:07 PM Amit Kapila wrote: > > On Mon, Aug 30, 2021 at 8:50 AM Peter Smith wrote: > > > > Patch v2 is the same; it only needed re-basing to the latest HEAD. > > > > Why do you think it is correct to exit before trying to receive any > message? I think the STATE_CATCHUP

Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2022-04-01 Thread Dilip Kumar
On Thu, Mar 31, 2022 at 9:52 PM Andres Freund wrote: > > + "ALTER DATABASE testdb SET TABLESPACE regress_ts2"); > > +ok($result == 0, 'move database to tablespace 2'); > > This just tests the command doesn't fail, but not whether it actually did > something useful. Seem we should at least

Re: generic plans and "initial" pruning

2022-04-01 Thread David Rowley
On Fri, 1 Apr 2022 at 19:58, Amit Langote wrote: > Yes, the ExecLockRelsInfo node in the current patch, that first gets > added to the QueryDesc and subsequently to the EState of the query, > serves as that stashing place. Not sure if you've looked at > ExecLockRelInfo in detail in your review

Re: [WIP] ALTER COLUMN IF EXISTS

2022-04-01 Thread Daniel Gustafsson
> On 1 Apr 2022, at 02:30, Tom Lane wrote: > "David G. Johnston" writes: >> At present the project seems to largely consider the IF EXISTS/IF NOT >> EXISTS features to have been largely a mistake and while removing it is not >> going to happen the desire to change or extend it is not strong. >

Re: Skipping logical replication transactions on subscriber side

2022-04-01 Thread Masahiko Sawada
On Fri, Apr 1, 2022 at 4:44 PM Noah Misch wrote: > > On Tue, Mar 29, 2022 at 10:43:00AM +0530, Amit Kapila wrote: > > On Mon, Mar 21, 2022 at 5:51 PM Euler Taveira wrote: > > > On Mon, Mar 21, 2022, at 12:25 AM, Amit Kapila wrote: > > > I have fixed all the above comments as per your suggestion

Re: Skipping logical replication transactions on subscriber side

2022-04-01 Thread Noah Misch
On Tue, Mar 29, 2022 at 10:43:00AM +0530, Amit Kapila wrote: > On Mon, Mar 21, 2022 at 5:51 PM Euler Taveira wrote: > > On Mon, Mar 21, 2022, at 12:25 AM, Amit Kapila wrote: > > I have fixed all the above comments as per your suggestion in the > > attached. Do let me know if something is missed?

Re: On login trigger: take three

2022-04-01 Thread a . sokolov
Daniel Gustafsson писал 2022-03-30 16:48: On 30 Mar 2022, at 13:21, Ivan Panchenko wrote: Maybe side-effects is a bit too general? Emitting a log message, rejecting a login, setting some GUCs, etc are all side-effects too. Something like this: I've reworded the docs close to what you

Re: Handle infinite recursion in logical replication setup

2022-04-01 Thread vignesh C
On Thu, Mar 31, 2022 at 2:52 PM Amit Kapila wrote: > > On Thu, Mar 31, 2022 at 9:14 AM Amit Kapila wrote: > > > > On Wed, Mar 30, 2022 at 7:40 PM Ashutosh Bapat > > wrote: > > > > > > > > The changes for the same are available int the v5 patch available at > > > > [1]. > > > > [1] - > > > >

Re: Handle infinite recursion in logical replication setup

2022-04-01 Thread vignesh C
On Wed, Mar 30, 2022 at 7:22 PM Ashutosh Bapat wrote: > > Hi Vignesh, > Some review comments on 0001 > > On Wed, Mar 16, 2022 at 11:17 AM vignesh C wrote: > > > > > The changes for the same are available int the v5 patch available at [1]. > > [1] - > >

Re: generic plans and "initial" pruning

2022-04-01 Thread Amit Langote
On Fri, Apr 1, 2022 at 12:45 PM Tom Lane wrote: > Amit Langote writes: > > On Fri, Apr 1, 2022 at 10:32 AM David Rowley wrote: > >> 1. You've changed the signature of various functions by adding > >> ExecLockRelsInfo *execlockrelsinfo. I'm wondering why you didn't just > >> put the

  1   2   >