RE: Failed transaction statistics to measure the logical replication progress

2021-12-01 Thread osumi.takami...@fujitsu.com
On Friday, November 19, 2021 11:11 PM Masahiko Sawada wrote: > Besides that, I’m not sure how useful commit_bytes, abort_bytes, and > error_bytes are. I originally thought these statistics track the size of > received > data, i.g., how much data is transferred from the publisher and processed on

Re: [PATCH] improve the pg_upgrade error message

2021-12-01 Thread Jeevan Ladhe
Hi Daniel, Was wondering if we had any barriers to getting this committed. I believe it will be good to have this change and also it will be more in line with other check functions also. Regards, Jeevan On Thu, Oct 21, 2021 at 3:51 PM Daniel Gustafsson wrote: > > On 14 Jul 2021, at 07:27, Sura

Re: [PATCH] improve the pg_upgrade error message

2021-12-01 Thread Daniel Gustafsson
> On 1 Dec 2021, at 10:59, Jeevan Ladhe wrote: > Was wondering if we had any barriers to getting this committed. No barrier other than available time to, I will try to get to it shortly. -- Daniel Gustafsson https://vmware.com/

Re: [PATCH] Don't block HOT update by BRIN index

2021-12-01 Thread Josef Šimánek
út 30. 11. 2021 v 20:11 odesílatel Tomas Vondra napsal: > > OK, > > I've polished the last version of the patch a bit (added a regression > test with update of attribute in index predicate and docs about the new > flag into indexam.sgml) and pushed. Thanks a lot for taking over this, improving an

Re: [PATCH] Partial foreign key updates in referential integrity triggers

2021-12-01 Thread Peter Eisentraut
On 23.11.21 05:44, Paul Martinez wrote: Updated patch attached. Thanks for taking a look so quickly! This patch looks pretty much okay to me. As I wrote in another message in this thread, I'm having some doubts about the proper use case. So I'm going to push this commit fest entry to the ne

Re: Add option --drop-cascade for pg_dump/restore

2021-12-01 Thread Daniel Gustafsson
> On 3 Nov 2021, at 20:03, Tom Lane wrote: > > Wu Haotian writes: >> here's the rebased patch. > > Looks like it needs rebasing again, probably as a result of our recent > renaming of our Perl test modules. As this patch hasn't been updated, I'm marking this entry Returned with Feedback. Plea

should we document an example to set multiple libraries in shared_preload_libraries?

2021-12-01 Thread Bharath Rupireddy
Hi, It seems like users can try different ways to set multiple values for shared_preload_libraries GUC even after reading the documentation [1]), something like: ALTER SYSTEM SET shared_preload_libraries TO auth_delay,pg_stat_statements,sepgsql; --> correct ALTER SYSTEM SET shared_preload_librarie

Re: More time spending with "delete pending"

2021-12-01 Thread Daniel Gustafsson
> On 13 Jul 2021, at 20:00, Alexander Lakhin wrote: > > Hello Michael, > 12.07.2021 08:52, Michael Paquier wrote: >> On Mon, Jul 12, 2021 at 02:09:41PM +0900, Michael Paquier wrote: >> >>> And fairywren, that uses MinGW, is unhappy: >>> >>> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?n

Re: Replication protocol doc fix

2021-12-01 Thread Daniel Gustafsson
> On 3 Nov 2021, at 12:14, Daniel Gustafsson wrote: > > The commitfest CI times out on all platforms and never finishes when running > make check with this patch, so unless the patch is dropped due to concerns > already raised then that seems like a good thing to fix. As the thread has stalled,

Re: SQL/JSON: functions

2021-12-01 Thread Himanshu Upadhyaya
Hi Andrew, The latest version (v59) is not applying on head. Could you please help to rebase? Thanks, Himanshu On Thu, Sep 16, 2021 at 8:23 PM Andrew Dunstan wrote: > > On 9/14/21 8:55 AM, Andrew Dunstan wrote: > > On 9/2/21 2:50 PM, Andrew Dunstan wrote: > >> On 5/18/21 3:22 PM, Andrew Dunsta

Re: Data is copied twice when specifying both child and parent table in publication

2021-12-01 Thread Amit Kapila
On Mon, Nov 29, 2021 at 2:21 PM houzj.f...@fujitsu.com wrote: > > On Thursday, November 11, 2021 2:53 PM houzj.f...@fujitsu.com wrote: > > Attach the fix patch. > > 0001 fix data double publish(first issue in this thread) > > In another thread[1], Amit L suggested that it'd be nice to add a testca

Re: GUC flags

2021-12-01 Thread Michael Paquier
On Wed, Dec 01, 2021 at 01:59:05AM -0600, Justin Pryzby wrote: > On Tue, Nov 30, 2021 at 03:36:45PM +0900, Michael Paquier wrote: >> -gettext_noop("Waits N seconds on connection startup >> before authentication."), >> +gettext_noop("Sets the amount of second

Re: Commitfest 2021-11 Patch Triage - Part 1

2021-12-01 Thread Marcos Pegoraro
> > I think the reason why we can't update a materialized view directly is > because > it is basically a "view" and it should not contains any data irrelevant to > its > definition and underlying tables. If we would have a feature to update a > materialized view direcly, maybe, it should behave as

RE: Optionally automatically disable logical replication subscriptions on error

2021-12-01 Thread osumi.takami...@fujitsu.com
On Wednesday, December 1, 2021 3:02 PM vignesh C wrote: > On Tue, Nov 30, 2021 at 5:34 PM osumi.takami...@fujitsu.com > wrote: > > > > On Tuesday, November 30, 2021 1:10 PM Greg Nancarrow > wrote: > > > On Sat, Nov 27, 2021 at 1:36 AM osumi.takami...@fujitsu.com > > > wrote: > > > > > > > > Thi

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

2021-12-01 Thread Dilip Kumar
On Wed, Dec 1, 2021 at 12:07 PM Greg Nancarrow wrote: > > On Thu, Nov 25, 2021 at 10:17 PM Dilip Kumar wrote: > > > > Thanks for the review and many valuable comments, I have fixed all of > > them except this comment (/* If we got a cancel signal during the copy > > of the data, quit */) because

Re: should we document an example to set multiple libraries in shared_preload_libraries?

2021-12-01 Thread Justin Pryzby
On Wed, Dec 01, 2021 at 04:20:52PM +0530, Bharath Rupireddy wrote: > It seems like users can try different ways to set multiple values for > shared_preload_libraries GUC even after reading the documentation > [1]), something like: ... > ALTER SYSTEM SET shared_preload_libraries = > "auth_delay,pg_

Re: should we document an example to set multiple libraries in shared_preload_libraries?

2021-12-01 Thread Tom Lane
Justin Pryzby writes: > +1 to document it, but it seems like the worse problem is allowing the admin > to > write a configuration which causes the server to fail to start, without having > issued a warning. > I think you could fix that with a GUC check hook to emit a warning. > I'm not sure what

Re: Optionally automatically disable logical replication subscriptions on error

2021-12-01 Thread Amit Kapila
On Wed, Dec 1, 2021 at 5:55 PM osumi.takami...@fujitsu.com wrote: > > On Wednesday, December 1, 2021 3:02 PM vignesh C wrote: > > On Tue, Nov 30, 2021 at 5:34 PM osumi.takami...@fujitsu.com > > wrote: > > > 3) Can add a line in the commit message saying "Bump catalog version." > > as the patch i

Re: Update stale code comment in CheckpointerMain()

2021-12-01 Thread Daniel Gustafsson
> On 1 Dec 2021, at 07:19, Amul Sul wrote: > > On Tue, Nov 30, 2021 at 3:09 PM Daniel Gustafsson wrote: >> >>> On 30 Nov 2021, at 08:00, Amul Sul wrote: >> >>> The attached patch updates the code comment which is no longer true >>> after commit # 4a92a1c3d1c361ffb031ed05bf65b801241d7cdd >> >

Re: Non-superuser subscription owners

2021-12-01 Thread Amit Kapila
On Wed, Dec 1, 2021 at 2:12 AM Jeff Davis wrote: > > On Tue, 2021-11-30 at 17:25 +0530, Amit Kapila wrote: > > I think it would be better to do it before we allow subscription > > owners to be non-superusers. > > There are a couple other things to consider before allowing non- > superusers to crea

Re: should we document an example to set multiple libraries in shared_preload_libraries?

2021-12-01 Thread Bharath Rupireddy
On Wed, Dec 1, 2021 at 6:45 PM Tom Lane wrote: > > Justin Pryzby writes: > > +1 to document it, but it seems like the worse problem is allowing the > > admin to > > write a configuration which causes the server to fail to start, without > > having > > issued a warning. > > > I think you could f

Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?

2021-12-01 Thread Bharath Rupireddy
Hi, The active_pid of ReplicationSlot structure, which tells whether a replication slot is active or inactive, isn't persisted to the disk i.e has no entry in ReplicationSlotPersistentData structure. Isn't it better if we add that info to ReplicationSlotPersistentData structure and persist to the

Re: stat() vs ERROR_DELETE_PENDING, round N + 1

2021-12-01 Thread Daniel Gustafsson
> On 3 Nov 2021, at 12:02, Daniel Gustafsson wrote: > > This patch doesn't compile on Windows according to Appveyor, seemingly because > of a syntax error in the new win32ntdll.h file, but the MSVC logs are hard on > the eye so it might be unrelated. As the thread has stalled with a patch that d

Re: [PATCH] Partial foreign key updates in referential integrity triggers

2021-12-01 Thread Matthias van de Meent
On Wed, 1 Dec 2021 at 11:33, Peter Eisentraut wrote: > > On 23.11.21 05:44, Paul Martinez wrote: > > Updated patch attached. Thanks for taking a look so quickly! > > This patch looks pretty much okay to me. As I wrote in another message > in this thread, I'm having some doubts about the proper us

Re: Reserve prefixes for loaded libraries proposal

2021-12-01 Thread Peter Eisentraut
On 07.10.21 14:03, Florin Irion wrote: I adjusted a bit the code and configured my mail client to send patch attachments appropiately(hopefully). :) So here is my second version. Committed. I made two notable changes: I renamed the function, since it looked like EmitWarningsOnPlaceholders()

Re: SQL/JSON: functions

2021-12-01 Thread Andrew Dunstan
On 12/1/21 06:13, Himanshu Upadhyaya wrote: > Hi Andrew, > > The latest version (v59) is not applying on head. > Could you please help to rebase? > > (Please don't top-post on PostgreSQL lists) The patches apply for me and for the cfbot: . I'm not s

Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd

2021-12-01 Thread Robert Haas
On Tue, Nov 30, 2021 at 7:50 PM Andy Fan wrote: > I think you misunderstand me, I argued with the answer because after I got > the > answer and I rethink my problem, I found my question description is not > accurate > enough, so I improved the question and willing discussion again. My > excep

Re: RecoveryInProgress() has critical side effects

2021-12-01 Thread Robert Haas
On Sat, Nov 20, 2021 at 3:22 PM Heikki Linnakangas wrote: > But here's yet another idea: We could initialize RedoRecPtr and > doPageWrites in InitXLogInsert(). It would seem like a pretty natural > place for it. I considered that, but it seemed like an abstraction violation to me, because that co

Re: Non-decimal integer literals

2021-12-01 Thread Peter Eisentraut
On 25.11.21 16:46, Zhihong Yu wrote: For patch 3, +int64 +pg_strtoint64(const char *s) How about naming the above function pg_scanint64()? pg_strtoint64xx() can be named pg_strtoint64() - this would align with existing function: pg_strtouint64(const char *str, char **endptr, int base) That

Re: Update stale code comment in CheckpointerMain()

2021-12-01 Thread Robert Haas
On Wed, Dec 1, 2021 at 8:24 AM Daniel Gustafsson wrote: > >>> The attached patch updates the code comment which is no longer true > >>> after commit # 4a92a1c3d1c361ffb031ed05bf65b801241d7cdd > >> Agreed, but looking at this shouldn't we also tweak the comment on > >> RecoveryInProgress() as per t

Re: Non-decimal integer literals

2021-12-01 Thread Peter Eisentraut
On 25.11.21 18:51, John Naylor wrote: If we're going to change the comment anyway, "the parser" sounds more natural. Aside from that, 0001 and 0002 can probably be pushed now, if you like. done --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -365,6 +365,10

Re: increase size of pg_commit_ts buffers

2021-12-01 Thread Alvaro Herrera
On 2021-Nov-30, Simon Riggs wrote: > On Fri, 12 Nov 2021 at 17:39, Tomas Vondra > wrote: > > > So +1 to just get this committed, as it is. > > This is a real issue affecting Postgres users. Please commit this soon. Uh ouch, I had forgotten that this patch was mine (blush). Thanks for the ping

Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file

2021-12-01 Thread David Steele
On 11/30/21 19:54, Michael Paquier wrote: On Tue, Nov 30, 2021 at 05:58:15PM -0500, David Steele wrote: I did figure out how to keep the safe part of exclusive backup (not having to maintain a connection) while removing the dangerous part (writing backup_label into PGDATA), but it was a substant

Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file

2021-12-01 Thread Andrew Dunstan
On 11/30/21 17:26, Tom Lane wrote: > "Bossart, Nathan" writes: >> It looks like the exclusive way has been marked deprecated in all >> supported versions along with a note that it will eventually be >> removed. If it's not going to be removed out of fear of breaking >> backward compatibility, I

Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?

2021-12-01 Thread Alvaro Herrera
On 2021-Dec-01, Bharath Rupireddy wrote: > The active_pid of ReplicationSlot structure, which tells whether a > replication slot is active or inactive, isn't persisted to the disk > i.e has no entry in ReplicationSlotPersistentData structure. Isn't it > better if we add that info to ReplicationSlo

Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file

2021-12-01 Thread David Steele
On 11/30/21 18:31, Bossart, Nathan wrote: On 11/30/21, 2:58 PM, "David Steele" wrote: I did figure out how to keep the safe part of exclusive backup (not having to maintain a connection) while removing the dangerous part (writing backup_label into PGDATA), but it was a substantial amount of wor

Re: RecoveryInProgress() has critical side effects

2021-12-01 Thread Alvaro Herrera
There are a couple typos. "uninitalized," in one place. Also, +* If this is either a bootstrap process nor a standalone backend, start Is "either .. nor" correct? It looks very wrong to me. I think you meant "either .. or". Overall, this patch seems mostly about documenting some unde

Re: Correct handling of blank/commented lines in PSQL interactive-mode history

2021-12-01 Thread Tom Lane
Alvaro Herrera writes: > On 2021-Nov-29, Tom Lane wrote: >> After some further hackery, here's a set of patches that I think >> might be acceptable. They're actually fairly independent, although >> they touch different aspects of the same behavior. > I tried the collection and I find the overall

Re: Reserve prefixes for loaded libraries proposal

2021-12-01 Thread Florin Irion
> > Committed. > > I made two notable changes: I renamed the function, since it looked > like EmitWarningsOnPlaceholders() but was doing something not analogous. Also, you had in your function > > strncmp(varName, var->name, varLen) > > probably copied from EmitWarningsOnPlaceholders(), bu

Re: Proposal: allow database-specific role memberships

2021-12-01 Thread Kenaniah Cerny
Thank you for the advice! Attached is a rebased version of the patch that omits catversion.h in order to avoid conflicts. On Wed, Nov 17, 2021 at 6:17 AM Daniel Gustafsson wrote: > > On 28 Oct 2021, at 21:39, Kenaniah Cerny wrote: > > > Thank you Asif. A rebased patch is attached. > > This pat

Fix inappropriate uses of PG_GETARG_UINT32()

2021-12-01 Thread Peter Eisentraut
I noticed that the chr() function uses PG_GETARG_UINT32() to get its argument, even though the argument is a (signed) int. So you get some slightly silly behavior like this: => select chr(-333); ERROR: 54000: requested character too large for encoding: -333 The attached patch fixes this by a

Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file

2021-12-01 Thread Bossart, Nathan
On 12/1/21, 8:27 AM, "David Steele" wrote: > On 11/30/21 18:31, Bossart, Nathan wrote: >> Do you think it's still worth trying to make it safe, or do you think >> we should just remove exclusive mode completely? > > My preference would be to remove it completely, but I haven't gotten a > lot of tr

Re: Lots of memory allocated when reassigning Large Objects

2021-12-01 Thread Tom Lane
Justin Pryzby writes: > @Guillaume: Even if memory use with the patch isn't constant, I imagine it's > enough to have avoided OOM. I think it's good enough in HEAD. In the back branches, the sinval queue growth is bad enough that there's still an issue. Still, this is a useful improvement, so I

Re: Non-superuser subscription owners

2021-12-01 Thread Mark Dilger
> On Dec 1, 2021, at 5:36 AM, Amit Kapila wrote: > > On Wed, Dec 1, 2021 at 2:12 AM Jeff Davis wrote: >> >> On Tue, 2021-11-30 at 17:25 +0530, Amit Kapila wrote: >>> I think it would be better to do it before we allow subscription >>> owners to be non-superusers. >> >> There are a couple ot

Re: SKIP LOCKED assert triggered

2021-12-01 Thread Bossart, Nathan
On 11/12/21, 8:56 AM, "Simon Riggs" wrote: > The combination of these two statements in a transaction hits an > Assert in heapam.c at line 4770 on REL_14_STABLE I've been unable to reproduce this. Do you have any tips for how to do so? Does there need to be some sort of concurrent workload? Na

Re: SKIP LOCKED assert triggered

2021-12-01 Thread Simon Riggs
On Wed, 1 Dec 2021 at 14:33, Bossart, Nathan wrote: > > On 11/12/21, 8:56 AM, "Simon Riggs" wrote: > > The combination of these two statements in a transaction hits an > > Assert in heapam.c at line 4770 on REL_14_STABLE > > I've been unable to reproduce this. Do you have any tips for how to > d

O(n) tasks cause lengthy startups and checkpoints

2021-12-01 Thread Bossart, Nathan
Hi hackers, Thanks to 61752af, SyncDataDirectory() can make use of syncfs() to avoid individually syncing all database files after a crash. However, as noted earlier this year [0], there are still a number of O(n) tasks that affect startup and checkpointing that I'd like to improve. Below, I've a

Re: Column Filtering in Logical Replication

2021-12-01 Thread Alvaro Herrera
Hi I took the latest posted patch, rebased on current sources, fixed the conflicts, and pgindented. No further changes. Here's the result. All tests are passing for me. Some review comments that were posted have not been addressed yet; I'll look into that soon. -- Álvaro Herrera Post

Re: Lots of memory allocated when reassigning Large Objects

2021-12-01 Thread Guillaume Lelarge
Le mer. 1 déc. 2021 à 19:48, Tom Lane a écrit : > Justin Pryzby writes: > > @Guillaume: Even if memory use with the patch isn't constant, I imagine > it's > > enough to have avoided OOM. > > I think it's good enough in HEAD. In the back branches, the sinval > queue growth is bad enough that the

Re: Column Filtering in Logical Replication

2021-12-01 Thread Alvaro Herrera
Oh, I just noticed that for some reason the test file was lost in the rebase, so those tests I thought I was running ... I wasn't. And of course if I put it back, it fails. More later. -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/ "Crear es tan difícil como se

Re: row filtering for logical replication

2021-12-01 Thread Peter Smith
On Thu, Sep 23, 2021 at 10:33 PM Tomas Vondra wrote: > > 2) create_publication.sgml says: > > A NULL value causes the expression to evaluate > to false; avoid using columns without not-null constraints in the > WHERE clause. > > That's not quite correct, I think - doesn't the expressio

Re: O(n) tasks cause lengthy startups and checkpoints

2021-12-01 Thread SATYANARAYANA NARLAPURAM
+1 to the idea. I don't see a reason why checkpointer has to do all of that. Keeping checkpoint to minimal essential work helps servers recover faster in the event of a crash. RemoveOldXlogFiles is also an O(N) operation that can at least be avoided during the end of recovery (CHECKPOINT_END_OF_RE

Re: row filtering for logical replication

2021-12-01 Thread Peter Smith
On Tue, Nov 23, 2021 at 5:27 PM vignesh C wrote: > > 2) Since the error message is because it publishes delete/update > operations, it should include publish delete/update in the error > message. Can we change the error message: > + if (!bms_is_member(attnum - > FirstLowInvalidHeapA

Re: row filtering for logical replication

2021-12-01 Thread Peter Smith
On Tue, Nov 23, 2021 at 6:59 PM houzj.f...@fujitsu.com wrote: > > On Tues, Nov 23, 2021 2:27 PM vignesh C wrote: > > On Thu, Nov 18, 2021 at 7:04 AM Peter Smith > > wrote: > > > > > > PSA new set of v40* patches. > > > > Few comments: ... > Another comment about v40-0001 patch: > > > +

Re: row filtering for logical replication

2021-12-01 Thread Peter Smith
On Wed, Nov 24, 2021 at 3:37 AM vignesh C wrote: > > On Tue, Nov 23, 2021 at 4:58 PM Ajin Cherian wrote: > > > > Attaching a new patchset v41 which includes changes by both Peter and > > myself. > > Few comments on v41-0002 patch: ... > 2) Tab completion completes with "WHERE (" in case of "alte

Re: row filtering for logical replication

2021-12-01 Thread Peter Smith
On Thu, Nov 25, 2021 at 12:03 AM Amit Kapila wrote: > > On Tue, Nov 23, 2021 at 4:58 PM Ajin Cherian wrote: > > > > Attaching a new patchset v41 which includes changes by both Peter and > > myself. > > > > Patches v40-0005 and v40-0006 have been merged to create patch > > v41-0005 which reduces

Re: row filtering for logical replication

2021-12-01 Thread Peter Smith
On Tue, Nov 30, 2021 at 2:49 PM tanghy.f...@fujitsu.com wrote: > > On Thursday, November 25, 2021 11:22 AM Peter Smith > wrote: > > > > Thanks for all the review comments so far! We are endeavouring to keep > > pace with them. > > > > All feedback is being tracked and we will fix and/or reply to

Re: row filtering for logical replication

2021-12-01 Thread Peter Smith
On Tue, Nov 30, 2021 at 9:34 PM vignesh C wrote: > ... > Thanks for the updated patch, few comments: > 1) Should this be changed to include non IMMUTABLE system functions > are not allowed: > + not-null constraints in the WHERE clause. The > + WHERE clause does not allow functions or user-defi

Re: Fix inappropriate uses of PG_GETARG_UINT32()

2021-12-01 Thread Bossart, Nathan
On 12/1/21, 10:29 AM, "Peter Eisentraut" wrote: > The attached patch fixes this by accepting the argument using > PG_GETARG_INT32(), doing some checks, and then casting it to unsigned > for the rest of the code. > > The patch also fixes another inappropriate use in an example in the > documentati

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

2021-12-01 Thread Melanie Plageman
Thanks for the review! On Wed, Nov 24, 2021 at 8:16 PM Justin Pryzby wrote: > You wrote beentry++ at the start of two loops, but I think that's wrong; it > should be at the end, as in the rest of the file (or as a loop increment). > BackendStatusArray[0] is actually used (even though its backend

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

2021-12-01 Thread Melanie Plageman
v16 (also rebased) attached On Fri, Nov 26, 2021 at 4:16 PM Justin Pryzby wrote: > > On Wed, Nov 24, 2021 at 07:15:59PM -0600, Justin Pryzby wrote: > > There's extraneous blank lines in these functions: > > > > +pgstat_sum_io_path_ops > > +pgstat_report_live_backend_io_path_ops > > +pgstat_recv_r

Re: BUG #17302: gist index prevents insertion of some data

2021-12-01 Thread Alexander Korotkov
On Sun, Nov 28, 2021 at 9:07 PM PG Bug reporting form wrote: > The last statement in the following sequence of queries: > CREATE TABLE point_tbl (f1 point); > CREATE INDEX gpointind ON point_tbl USING gist (f1); > INSERT INTO point_tbl SELECT '(0,0)'::point FROM generate_series(1, 1000) > g; > INS

Re: BUG #17302: gist index prevents insertion of some data

2021-12-01 Thread Tom Lane
Alexander Korotkov writes: > I think losing precision in the gist penalty is generally OK. Thus, > it shouldn't be a problem to round a very small value as zero. Check. > Probably, we could even tolerate overflow in the gist penalty. As long as overflow -> infinity, yeah I think so. Seems lik

Re: Deprecating the term "super-exclusive lock"

2021-12-01 Thread Andres Freund
Hi, On 2021-11-30 16:21:25 -0800, Peter Geoghegan wrote: > In commit 276db875, I made vacuumlazy.c consistently use the term > "cleanup lock", rather than the term "super-exclusive lock". But on > further reflection I should have gone further, and removed the term > "super-exclusive lock" from the

Re: pg_replslotdata - a tool for displaying replication slot information

2021-12-01 Thread Andres Freund
Hi, On 2021-11-30 18:43:23 +, Bossart, Nathan wrote: > On 11/30/21, 6:14 AM, "Peter Eisentraut" > wrote: > > On 23.11.21 06:09, Bharath Rupireddy wrote: > >> The replication slots data is stored in binary format on the disk under > >> the pg_replslot/<> directory which isn't human readable.

Re: O(n) tasks cause lengthy startups and checkpoints

2021-12-01 Thread Andres Freund
Hi, On 2021-12-01 20:24:25 +, Bossart, Nathan wrote: > I realize adding a new maintenance worker might be a bit heavy-handed, > but I think it would be nice to have somewhere to offload tasks that > really shouldn't impact startup and checkpointing. I imagine such a > process would come in ha

Re: Data is copied twice when specifying both child and parent table in publication

2021-12-01 Thread Greg Nancarrow
On Wed, Dec 1, 2021 at 10:15 PM Amit Kapila wrote: > > Thanks, your patch looks good to me. I have slightly changed the > comments and commit message in the attached. > I'd suggest tidying the patch comment a bit: "We publish the child table's data twice for a publication that has both child and

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

2021-12-01 Thread Justin Pryzby
On Wed, Dec 01, 2021 at 05:00:14PM -0500, Melanie Plageman wrote: > > Also: > > src/include/miscadmin.h:#define BACKEND_NUM_TYPES (B_LOGGER + 1) > > > > I think it's wrong to say NUM_TYPES = B_LOGGER + 1 (which would suggest > > using > > lessthan-or-equal instead of lessthan as you are). > > > >

Re: [PATCH] Partial foreign key updates in referential integrity triggers

2021-12-01 Thread Paul Martinez
On Wed, Nov 24, 2021 at 10:59 AM Peter Eisentraut wrote: > > I was looking through this example to see if it could be adapted for the > documentation. > > The way the users table is defined, it appears that "id" is actually > unique and the primary key ought to be just (id). The DELETE command >

Re: O(n) tasks cause lengthy startups and checkpoints

2021-12-01 Thread Bossart, Nathan
On 12/1/21, 2:56 PM, "Andres Freund" wrote: > On 2021-12-01 20:24:25 +, Bossart, Nathan wrote: >> I realize adding a new maintenance worker might be a bit heavy-handed, >> but I think it would be nice to have somewhere to offload tasks that >> really shouldn't impact startup and checkpointing.

RE: pg_get_publication_tables() output duplicate relid

2021-12-01 Thread houzj.f...@fujitsu.com
On Wed, Dec 1, 2021 3:01 PM Amit Kapila wrote: > On Mon, Nov 29, 2021 at 2:37 PM houzj.f...@fujitsu.com > wrote: > > > > On Wed, Nov 24, 2021 4:48 PM Amit Kapila > > > On Mon, Nov 22, 2021 at 12:55 PM Amit Langote > > > > > > wrote: > > > > > > > > On Fri, Nov 19, 2021 at 2:28 PM Amit Kapila >

Re: BUFFERS enabled by default in EXPLAIN (ANALYZE)

2021-12-01 Thread Justin Pryzby
On Mon, Nov 15, 2021 at 01:09:54PM -0600, Justin Pryzby wrote: > Some time ago, I had a few relevant patches: > 1) add explain(REGRESS) which is shorthand for (BUFFERS OFF, TIMING OFF, > COSTS OFF, SUMMARY OFF) > 2) add explain(MACHINE) which elides machine-specific output from explain; >for e

RE: Optionally automatically disable logical replication subscriptions on error

2021-12-01 Thread osumi.takami...@fujitsu.com
On Wednesday, December 1, 2021 10:16 PM Amit Kapila wrote: > On Wed, Dec 1, 2021 at 5:55 PM osumi.takami...@fujitsu.com > wrote: > > > > On Wednesday, December 1, 2021 3:02 PM vignesh C > wrote: > > > On Tue, Nov 30, 2021 at 5:34 PM osumi.takami...@fujitsu.com > > > wrote: > > > > > 3) Can add

Re: pg_upgrade test for binary compatibility of core data types

2021-12-01 Thread Michael Paquier
On Wed, Dec 01, 2021 at 04:19:44PM +0900, Michael Paquier wrote: > I'll get that done down to 10 to maximize its influence, then I'll > move on with the buildfarm code and send a patch to plug this and > reduce the dependencies between core and the buildfarm code. Okay, I have checked this one thi

Re: O(n) tasks cause lengthy startups and checkpoints

2021-12-01 Thread Euler Taveira
On Wed, Dec 1, 2021, at 9:19 PM, Bossart, Nathan wrote: > On 12/1/21, 2:56 PM, "Andres Freund" wrote: > > On 2021-12-01 20:24:25 +, Bossart, Nathan wrote: > >> I realize adding a new maintenance worker might be a bit heavy-handed, > >> but I think it would be nice to have somewhere to offload

Re: Data is copied twice when specifying both child and parent table in publication

2021-12-01 Thread Amit Kapila
On Thu, Dec 2, 2021 at 4:51 AM Greg Nancarrow wrote: > > On Wed, Dec 1, 2021 at 10:15 PM Amit Kapila wrote: > > > > Also, perhaps the following additional comment (or similar) could be > added to the pg_publication_tables documentation in catalogs.sgml: > > For publications of partitioned tables

Re: Optionally automatically disable logical replication subscriptions on error

2021-12-01 Thread Greg Nancarrow
On Thu, Dec 2, 2021 at 12:05 PM osumi.takami...@fujitsu.com wrote: > > Updated the patch to include the notification. > For the catalogs.sgml update, I was thinking that the following wording might sound a bit better: + If true, the subscription will be disabled when a subscription +

Re: O(n) tasks cause lengthy startups and checkpoints

2021-12-01 Thread Bharath Rupireddy
On Thu, Dec 2, 2021 at 1:54 AM Bossart, Nathan wrote: > > Hi hackers, > > Thanks to 61752af, SyncDataDirectory() can make use of syncfs() to > avoid individually syncing all database files after a crash. However, > as noted earlier this year [0], there are still a number of O(n) tasks > that affe

Re: Data is copied twice when specifying both child and parent table in publication

2021-12-01 Thread Greg Nancarrow
On Thu, Dec 2, 2021 at 1:33 PM Amit Kapila wrote: > > > For publications of partitioned tables with publish_via_partition_root > > set to true, the partitioned table itself (rather than the individual > > partitions) is included in the view. > > > > Okay, but I think it is better to add the behavi

Re: pg_replslotdata - a tool for displaying replication slot information

2021-12-01 Thread Bharath Rupireddy
On Thu, Dec 2, 2021 at 4:22 AM Andres Freund wrote: > > Hi, > > On 2021-11-30 18:43:23 +, Bossart, Nathan wrote: > > On 11/30/21, 6:14 AM, "Peter Eisentraut" > > wrote: > > > On 23.11.21 06:09, Bharath Rupireddy wrote: > > >> The replication slots data is stored in binary format on the disk

Re: pg_get_publication_tables() output duplicate relid

2021-12-01 Thread Amit Langote
On Thu, Dec 2, 2021 at 9:44 houzj.f...@fujitsu.com wrote: > On Wed, Dec 1, 2021 3:01 PM Amit Kapila wrote: > > > > On Mon, Nov 22, 2021 at 12:55 PM Amit Langote > > > > wrote: > > > > > On second thought, I agree that de-duplicating partitions from > > > > > this view is an improvement. > > > >

Re: Data is copied twice when specifying both child and parent table in publication

2021-12-01 Thread Amit Langote
On Wed, Dec 1, 2021 at 8:15 PM Amit Kapila wrote: > On Mon, Nov 29, 2021 at 2:21 PM houzj.f...@fujitsu.com > wrote: > > > > On Thursday, November 11, 2021 2:53 PM houzj.f...@fujitsu.com wrote: > > > Attach the fix patch. > > > 0001 fix data double publish(first issue in this thread) > > > > In an

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

2021-12-01 Thread Justin Pryzby
On Wed, Dec 01, 2021 at 04:59:44PM -0500, Melanie Plageman wrote: > Thanks for the review! > > On Wed, Nov 24, 2021 at 8:16 PM Justin Pryzby wrote: > > You wrote beentry++ at the start of two loops, but I think that's wrong; it > > should be at the end, as in the rest of the file (or as a loop in

RE: row filtering for logical replication

2021-12-01 Thread tanghy.f...@fujitsu.com
On Thursday, December 2, 2021 5:21 AM Peter Smith wrote: > > PSA the v44* set of patches. > Thanks for the new patch. Few comments: 1. This is an example in publication doc, but in fact it's not allowed. Should we change this example? +CREATE PUBLICATION active_departments FOR TABLE departme

Re: GUC flags

2021-12-01 Thread Justin Pryzby
> @@ -2142,7 +2142,8 @@ static struct config_int ConfigureNamesInt[] = > {"post_auth_delay", PGC_BACKEND, DEVELOPER_OPTIONS, > - gettext_noop("Waits N seconds on connection startup > after authentication."), > + gettext_noop("Sets the amount of

Re: Can I assume relation would not be invalid during from ExecutorRun to ExecutorEnd

2021-12-01 Thread Andy Fan
> If the relation is open, > the relcache entry can't be destroyed altogether, but it can be > rebuilt: see RelationClearRelation(). Thanks! This is a new amazing knowledge for me! > They are in fact stable in a certain sense - if we have the relation open we hold a reference count on it, and

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

2021-12-01 Thread Justin Pryzby
On Wed, Dec 01, 2021 at 04:59:44PM -0500, Melanie Plageman wrote: > Thanks for the review! > > On Wed, Nov 24, 2021 at 8:16 PM Justin Pryzby wrote: > > You wrote beentry++ at the start of two loops, but I think that's wrong; it > > should be at the end, as in the rest of the file (or as a loop in

Re: Data is copied twice when specifying both child and parent table in publication

2021-12-01 Thread Greg Nancarrow
On Thu, Dec 2, 2021 at 1:48 PM Greg Nancarrow wrote: > > If you updated my original description to say "(instead of just the > individual partitions)", it would imply the same I think. > But I don't mind if you want to explicitly state both cases to make it clear. > For example, something like:

Re: row filtering for logical replication

2021-12-01 Thread Ajin Cherian
On Wed, Dec 1, 2021 at 3:27 AM vignesh C wrote: > > Here we will not be able to do a direct comparison as we store the > transformed where clause in the pg_publication_rel table. We will have > to transform the where clause and then check. I have attached a patch > where we can check the transform

Re: Optionally automatically disable logical replication subscriptions on error

2021-12-01 Thread Amit Kapila
On Thu, Dec 2, 2021 at 6:35 AM osumi.takami...@fujitsu.com wrote: > > On Wednesday, December 1, 2021 10:16 PM Amit Kapila > wrote: > Updated the patch to include the notification. > The patch disables the subscription for non-transient errors. I am not sure if we can easily make the call to dec

Re: Data is copied twice when specifying both child and parent table in publication

2021-12-01 Thread Amit Kapila
On Thu, Dec 2, 2021 at 9:41 AM Greg Nancarrow wrote: > > On Thu, Dec 2, 2021 at 1:48 PM Greg Nancarrow wrote: > > > > If you updated my original description to say "(instead of just the > > individual partitions)", it would imply the same I think. > > But I don't mind if you want to explicitly st

Is ssl_crl_file "SSL server cert revocation list"?

2021-12-01 Thread Kyotaro Horiguchi
As discussed in the thread [1], I find the wording "SSL server certificate revocation list" as misleading or plain wrong. I used to read it as "SSL server certificate (of PostgreSQL client) revocation list" but I find it misleading-ish from fresh eyes. So I'd like to propose a change of the doc as

Re: pg_waldump stucks with options --follow or -f and --stats or -z

2021-12-01 Thread Michael Paquier
On Wed, Dec 01, 2021 at 11:44:02AM +0530, Bharath Rupireddy wrote: > Here's the v6 patch that has the SIGINT handling enabled for non-WIN32 > platforms (note that I haven't specified anything in the > documentation) much like pg_receivewal and pg_recvlogical. I have added a safeguard in XLogDumpDi

Re: More time spending with "delete pending"

2021-12-01 Thread Michael Paquier
On Wed, Dec 01, 2021 at 11:51:58AM +0100, Daniel Gustafsson wrote: > Michael, have you had a chance to look at the updated patch here? I'm moving > this patch entry from Waiting on Author to Needs Review. No, I haven't. Before being touched more, this requires first a bit more of testing infrast

Re: Is ssl_crl_file "SSL server cert revocation list"?

2021-12-01 Thread Kyotaro Horiguchi
At Thu, 02 Dec 2021 13:54:41 +0900 (JST), Kyotaro Horiguchi wrote in > As discussed in the thread [1], I find the wording "SSL server > certificate revocation list" as misleading or plain wrong. FWIW, I'm convinced that that's plain wrong after finding some occurances of "(SSL) client certifica

Re: GUC flags

2021-12-01 Thread Michael Paquier
On Wed, Dec 01, 2021 at 09:34:39PM -0600, Justin Pryzby wrote: >> @@ -2762,7 +2763,8 @@ static struct config_int ConfigureNamesInt[] = >> {"pre_auth_delay", PGC_SIGHUP, DEVELOPER_OPTIONS, >> -gettext_noop("Waits N seconds on connection startup >> before authenticat

Re: GUC flags

2021-12-01 Thread Justin Pryzby
On Thu, Dec 02, 2021 at 02:11:38PM +0900, Michael Paquier wrote: > On Wed, Dec 01, 2021 at 09:34:39PM -0600, Justin Pryzby wrote: > >> @@ -2762,7 +2763,8 @@ static struct config_int ConfigureNamesInt[] = > >>{"pre_auth_delay", PGC_SIGHUP, DEVELOPER_OPTIONS, > >> - gette

Re: pg_get_publication_tables() output duplicate relid

2021-12-01 Thread Amit Kapila
On Thu, Dec 2, 2021 at 8:42 AM Amit Langote wrote: > > On Thu, Dec 2, 2021 at 9:44 houzj.f...@fujitsu.com > wrote: > > On Wed, Dec 1, 2021 3:01 PM Amit Kapila wrote: > > > > > On Mon, Nov 22, 2021 at 12:55 PM Amit Langote > > > > > wrote: > > > > > > On second thought, I agree that de-duplicati

Re: BUG #17302: gist index prevents insertion of some data

2021-12-01 Thread Komяpa
On Thu, Dec 2, 2021 at 1:14 AM Tom Lane wrote: > Alexander Korotkov writes: > > I think losing precision in the gist penalty is generally OK. Thus, > > it shouldn't be a problem to round a very small value as zero. > > Check. > > > Probably, we could even tolerate overflow in the gist penalty.

Re: SQL/JSON: functions

2021-12-01 Thread Himanshu Upadhyaya
On Wed, Dec 1, 2021 at 7:56 PM Andrew Dunstan wrote: > > On 12/1/21 06:13, Himanshu Upadhyaya wrote: > > Hi Andrew, > > > > The latest version (v59) is not applying on head. > > Could you please help to rebase? > > > > > > (Please don't top-post on PostgreSQL lists) > > Sure, I will take care of

  1   2   >