Re: fix warnings in 9.6, 10, 11's contrib when compiling without openssl

2021-11-11 Thread Anton Voloshin
On 11/11/2021 08:14, Michael Paquier wrote: I would suggest to send any improvements for imath directly to upstream, then Postgres would just feed on that when we update it: https://github.com/creachadair/imath I didn't realise imath comes (occasionally) from external repo. Thank you. The

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Robert Haas
On Wed, Nov 10, 2021 at 6:03 PM Tom Lane wrote: > For comparison's sake, glibc have modified their > collation rules significantly (enough for us to hear complaints about > it) at least twice in the past decade. That's considerably *more* > frequent than DST law changes where I live. Yes. It

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Tom Lane
Robert Haas writes: > I'm not really convinced that ICU is better, either. I think it's more > that it isn't used as much. Well, at least ICU has a notion of attaching versions to collations. How mindful they are of bumping the version number when necessary remains to be seen. But the POSIX

Re: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display

2021-11-11 Thread Bossart, Nathan
On 11/11/21, 4:38 AM, "Alvaro Herrera" wrote: > Yeah. If we had some sort of ring buffer in which to store these > messages, the user could examine them through a view; they would still > be accessible in a running server, but they would not be written to the > server log. That's an interesting

Re: Strange error in new 003_cic_2pc.pl test

2021-11-11 Thread Tom Lane
Andrey Borodin writes: >> That error message is remarkably unhelpful, and I think unnecessarily so. >> Why the heck isn't XlogReadTwoPhaseData passing on the error string >> that it just got from XLogReadRecord? > Noah recently proposed the same [0]. But responders like me started to > complain

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Robert Haas
On Thu, Nov 11, 2021 at 11:16 AM Laurenz Albe wrote: > Nobody will want to hear that, but the only really good solution would > be for PostgreSQL to have its own built-in collations. +1. I agree with Tom that it sounds like a lot of work. And to be honest it's work that I don't really feel very

Re:unexpected plan with id = any('{}') condition

2021-11-11 Thread Sergei Kornilov
Hello Thank you for the explanation! > unreadable HTML mess ouch, sorry. "Nobody uses plain text mail, we dropped this thing in the interface” said yandex team. (I know that some members of the Yandex team read mailing lists, could you ping your colleagues?) > but I'm not convinced we want

Re: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display

2021-11-11 Thread Euler Taveira
On Thu, Nov 11, 2021, at 2:50 AM, Bharath Rupireddy wrote: > But for the snprintf(activitymsg, sizeof(activitymsg), "archiving %s", > xlog); we have elog(DEBUG1, "archived write-ahead log file \"%s\"", > xlog); after the archiving command. It is also good to have a similar > debug message before

Re: Improving psql's \password command

2021-11-11 Thread Bossart, Nathan
On 10/29/21, 5:07 PM, "Tom Lane" wrote: > "Bossart, Nathan" writes: >> Well, as of bf6b9e9, "ALTER ROLE nathan PASSWORD ''" is effectively >> the same as "ALTER ROLE nathan PASSWORD NULL". I agree about the >> user-unfriendliness, but maybe simple_prompt() ignoring control-C is >> the

Re: Improving psql's \password command

2021-11-11 Thread Tom Lane
"Bossart, Nathan" writes: > On 10/29/21, 5:07 PM, "Tom Lane" wrote: >> I was afraid somebody would say that. I have looked at it, but AFAICS >> we'd have to duplicate all of sprompt.c and nearly all of pg_get_line.c >> in order to tie it into psql's SIGINT infrastructure, since we wouldn't >>

Re: Strange error in new 003_cic_2pc.pl test

2021-11-11 Thread Andrey Borodin
> tadarida just reported this [1]: > > 2021-11-11 14:40:40.040 CET [29620:388] 023_cic_2pc.pl ERROR: could not read > two-phase state from WAL at 0/1716C68 > > That error message is remarkably unhelpful, and I think unnecessarily so. > Why the heck isn't XlogReadTwoPhaseData passing on the

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Tom Lane
Laurenz Albe writes: > On Thu, 2021-11-11 at 09:52 -0500, Tom Lane wrote: >> Yup.  If we had reliable ways to detect changes in this sort of >> environment-supplied data, maybe we could do something about it >> (a la the work that's been happening on attaching collation versions >> to indexes). 

Re: Clean up build warnings of plperl with clang-12+

2021-11-11 Thread Tom Lane
Michael Paquier writes: > Backpatched this one as of 9ff47ea. That should allow the addition of > -Werror on dangomushi. I see you tried to do that by adding -Werror to CPPFLAGS. That doesn't work because it breaks configure's tests. (I wonder if meson is any smarter than autoconf about

Re: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display

2021-11-11 Thread Bossart, Nathan
On 11/10/21, 9:51 PM, "Bharath Rupireddy" wrote: > But for the snprintf(activitymsg, sizeof(activitymsg), "archiving %s", > xlog); we have elog(DEBUG1, "archived write-ahead log file \"%s\"", > xlog); after the archiving command. It is also good to have a similar > debug message before archive

Re: .ready and .done files considered harmful

2021-11-11 Thread Bossart, Nathan
On 10/19/21, 7:53 AM, "Bossart, Nathan" wrote: > On 10/19/21, 5:59 AM, "Robert Haas" wrote: >> Nathan, I just realized we never closed the loop on this. Do you have >> any thoughts? > > IMO the patch is in decent shape. Happy to address any feedback you > might have on the latest patch [0].

RecoveryInProgress() has critical side effects

2021-11-11 Thread Robert Haas
Hi, I have noticed that $SUBJECT, and I think it's bad, and I'd like to propose some patches to fix it. 0001 is hopefully uncontroversial, but 0002 might need some discussion as I'm not quite sure what approach to take. The reason why RecoveryInProgress() has critical side effects is that it

Re: Logical replication timeout problem

2021-11-11 Thread Fabrice Chapuis
Hello, Our lab is ready now. Amit, I compile Postgres 10.18 with your patch.Tang, I used your script to configure logical replication between 2 databases and to generate 10 million entries in an unreplicated foo table. On a standalone instance no error message appears in log. I activate the

Re: unexpected plan with id = any('{}') condition

2021-11-11 Thread Tom Lane
Sergei Kornilov writes: >> unreadable HTML mess > ouch, sorry. "Nobody uses plain text mail, we dropped this thing in the > interface” said yandex team. I'll confess to being a troglodyte, but it's unreadable in the archives too [1], so there was some misconfiguration somewhere.

Re: Interrupts vs signals

2021-11-11 Thread Robert Haas
On Thu, Nov 11, 2021 at 12:27 AM Thomas Munro wrote: > > Depending on how you implement them, one difference could be whether / when > > "slow" system calls (recv, poll, etc) are interrupted. > > Hopefully by now all such waits are implemented with latch.c facilities? Do read(), write(), etc.

Strange error in new 003_cic_2pc.pl test

2021-11-11 Thread Tom Lane
tadarida just reported this [1]: 2021-11-11 14:40:40.040 CET [29620:388] 023_cic_2pc.pl ERROR: could not read two-phase state from WAL at 0/1716C68 That error message is remarkably unhelpful, and I think unnecessarily so. Why the heck isn't XlogReadTwoPhaseData passing on the error string that

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Laurenz Albe
On Thu, 2021-11-11 at 09:52 -0500, Tom Lane wrote: > Robert Haas writes: > > I'm not really convinced that ICU is better, either. I think it's more > > that it isn't used as much. > > Well, at least ICU has a notion of attaching versions to collations. > How mindful they are of bumping the

Re: unexpected plan with id = any('{}') condition

2021-11-11 Thread Tom Lane
Sergei Kornilov writes: > [ unreadable HTML mess ] For the archives, the test case here looks like create table test (id int not null, status text); insert into test select i, 'foo' from generate_series(1,100) i; update test set status = 'bar' where id <= 10; create index test_id on test

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Tom Lane
Robert Haas writes: > I agree with Tom that it sounds like a lot of work. And to be honest > it's work that I don't really feel very excited about. Even if you were excited about it, would maintaining such data be a good use of project resources? It's not like we lack other things we ought to

Re: 2021-11-11 release announcement draft

2021-11-11 Thread Jonathan S. Katz
On 11/10/21 10:47 PM, Noah Misch wrote: On Wed, Nov 10, 2021 at 02:07:43PM -0500, Jonathan S. Katz wrote: On 11/9/21 10:39 PM, Noah Misch wrote: On Tue, Nov 09, 2021 at 11:25:37AM -0500, Jonathan S. Katz wrote: Attached please find a draft of the release announcement for 2021-11-11. Please

Re: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display

2021-11-11 Thread Bruce Momjian
On Thu, Nov 11, 2021 at 03:18:16PM +, Bossart, Nathan wrote: > On 11/11/21, 4:38 AM, "Alvaro Herrera" wrote: > > Yeah. If we had some sort of ring buffer in which to store these > > messages, the user could examine them through a view; they would still > > be accessible in a running server,

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Daniel Westermann (DWE)
>Laurenz Albe writes: >> On Thu, 2021-11-11 at 09:52 -0500, Tom Lane wrote: >>> Yup.  If we had reliable ways to detect changes in this sort of >>> environment-supplied data, maybe we could do something about it >>> (a la the work that's been happening on attaching collation versions >>> to

Re: Interrupts vs signals

2021-11-11 Thread Thomas Munro
On Fri, Nov 12, 2021 at 9:24 AM Robert Haas wrote: > On Thu, Nov 11, 2021 at 2:50 PM Andres Freund wrote: > > They can count, but only when used for network sockets or pipes ("slow > > devices" or whatever the posix language is). Disk IO doesn't count as that. > > So > > I don't think it'd be a

Re: .ready and .done files considered harmful

2021-11-11 Thread Bossart, Nathan
On 11/11/21, 12:23 PM, "Robert Haas" wrote: > On Thu, Nov 11, 2021 at 2:49 PM Robert Haas wrote: >> Somehow I didn't see your October 19th response previously. The >> threading in gmail seems to have gotten broken, which may have >> contributed. > > And actually I also missed the September 27th

Re: simplifying foreign key/RI checks

2021-11-11 Thread Alvaro Herrera
On 2021-Nov-11, Tom Lane wrote: > It appears to me that commit 71f4c8c6f (DETACH PARTITION CONCURRENTLY) > broke the semantics here, because now things work differently with a > partitioned PK table than with a plain table, thanks to not bothering > to distinguish questions of how to handle

Re: Clean up build warnings of plperl with clang-12+

2021-11-11 Thread Andrew Dunstan
On 11/11/21 13:18, Tom Lane wrote: > Michael Paquier writes: >> Backpatched this one as of 9ff47ea. That should allow the addition of >> -Werror on dangomushi. > I see you tried to do that by adding -Werror to CPPFLAGS. That doesn't > work because it breaks configure's tests. (I wonder if

Re: Test::More version

2021-11-11 Thread Tom Lane
Alvaro Herrera writes: > On 2021-Nov-11, Andrew Dunstan wrote: >> Perhaps we could add a line to one of the TAP tests that would spit out >> the version on the log? > Maybe have it spit out the version of *all* the modules we require > (which aren't all that many), not just Test::More? Yeah ...

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Thomas Munro
On Fri, Nov 12, 2021 at 12:09 PM Robert Haas wrote: > On Thu, Nov 11, 2021 at 5:04 PM Isaac Morland wrote: > > Wouldn't an existing index only have characters that were already part of > > the collation? Attempting to use one not covered by the collation I would > > have expected to cause an

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Robert Haas
On Thu, Nov 11, 2021 at 1:38 PM Tom Lane wrote: > Even if you were excited about it, would maintaining such data be > a good use of project resources? It's not like we lack other things > we ought to be doing. I agree that the lack of reliable versioning > info is a problem, but I can't see

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Tom Lane
"Daniel Westermann (DWE)" writes: > On Thu, 2021-11-11 at 09:52 -0500, Tom Lane wrote: >> tzdb has an additional problem, which is that not updating is not an >> option: if you're affected by a DST law change, you want that update, >> and you frequently need it yesterday.  We're definitely not

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Tom Lane
Robert Haas writes: > ... but we want > collation definitions that *actually don't change*. Um ... how would that work? Unicode is a moving target. Even without their continual addition of stuff, I'm not convinced that social rules about how to sort are engraved on stone tablets. The need for

JIT doing duplicative optimization?

2021-11-11 Thread Alvaro Herrera
Hello Recently I noticed extremely suspicious behavior from queries under JIT. A query (details for which sadly I cannot disclose) had an EXPLAIN looking like this: JIT: Functions: 743 Options: Inlining true, Optimization true, Expressions true, Deforming true Timing: Generation 47.013

Re: .ready and .done files considered harmful

2021-11-11 Thread Robert Haas
On Thu, Nov 11, 2021 at 2:49 PM Robert Haas wrote: > Somehow I didn't see your October 19th response previously. The > threading in gmail seems to have gotten broken, which may have > contributed. And actually I also missed the September 27th email where you sent v3. Oops. Committed now. --

Re: Test::More version

2021-11-11 Thread Alvaro Herrera
On 2021-Nov-11, Andrew Dunstan wrote: > But I'd really like it if we could shift the goalposts a bit and require > 0.96. subtests would be really nice to have available. Agreed, subtests would be nice. > Perhaps we could add a line to one of the TAP tests that would spit out > the version on

Re: Clean up build warnings of plperl with clang-12+

2021-11-11 Thread Tom Lane
Andrew Dunstan writes: > Wouldn't it be better in any case just to add the clang fix for building > plperl rather than globally? That'd be considerably messier wouldn't it? (And I wonder if the meson system will be able to do it at all.) If you feel motivated to make that happen, go for it,

Re: Clean up build warnings of plperl with clang-12+

2021-11-11 Thread Michael Paquier
On Thu, Nov 11, 2021 at 01:18:32PM -0500, Tom Lane wrote: > I see you tried to do that by adding -Werror to CPPFLAGS. That doesn't > work because it breaks configure's tests. (I wonder if meson is any > smarter than autoconf about that.) The way I do it on my own > animals is like Nya.

Re: simplifying foreign key/RI checks

2021-11-11 Thread Tom Lane
Amit Langote writes: > Rebased patches attached. I've spent some more time digging into the snapshot-management angle. I think you are right that the crosscheck_snapshot isn't really an issue because the executor pays no attention to it for SELECT, but that doesn't mean that there's no problem,

Re: [PATCH] postgres_fdw: suppress explicit casts in text:text comparisons (was: column option to override foreign types)

2021-11-11 Thread Tom Lane
"Dian M Fay" writes: > I've split the suppression for RelabelTypes with implicit cast check > into a second patch over the core v7 change. As far as testing goes, \dC > lists implicit casts, but most of those I've tried seem to wind up > deparsing as Vars. I've been able to manifest RelabelTypes

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Robert Haas
On Thu, Nov 11, 2021 at 3:45 PM Isaac Morland wrote: > There is however one kind of change at least that I think can be made safely: > adding a new character in between existing characters. That shouldn't affect > any existing indexes. Only if you can guarantee that said character is not

Re: On login trigger: take three

2021-11-11 Thread Greg Nancarrow
On Thu, Nov 11, 2021 at 8:56 PM Daniel Gustafsson wrote: > > +This flag is used to avoid extra lookups on the pg_event_trigger > table during each backend startup. > This should be pg_event_trigger. Sorry, missed that > one at that last read-through. > Thanks, noted. > > -

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Robert Haas
On Thu, Nov 11, 2021 at 5:04 PM Isaac Morland wrote: > Wouldn't an existing index only have characters that were already part of the > collation? Attempting to use one not covered by the collation I would have > expected to cause an error at insert time. But definitely I agree I wouldn't >

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Robert Haas
On Thu, Nov 11, 2021 at 2:23 PM Tom Lane wrote: > Robert Haas writes: > > ... but we want > > collation definitions that *actually don't change*. > > Um ... how would that work? Unicode is a moving target. Even without > their continual addition of stuff, I'm not convinced that social rules >

Commitfest 2021-11 Patch Triage - Part 3

2021-11-11 Thread Daniel Gustafsson
Welcome to the third installment of the CF 2021-11 patch triage, looking at the patches which have been in four CF's and parts of the ones with three CF's. As per usual I might very well have misunderstood something (or many things), but there seem to be a fair few ones which should be closeable

Re: Interrupts vs signals

2021-11-11 Thread Andres Freund
Hi, On 2021-11-11 09:06:01 -0500, Robert Haas wrote: > On Thu, Nov 11, 2021 at 12:27 AM Thomas Munro wrote: > > > Depending on how you implement them, one difference could be whether / > > > when > > > "slow" system calls (recv, poll, etc) are interrupted. > > > > Hopefully by now all such

Re: remove spurious CREATE INDEX CONCURRENTLY wait

2021-11-11 Thread Andres Freund
On 2021-11-11 09:38:07 -0300, Alvaro Herrera wrote: > > I just noticed that this commit (dcfff74fb16) didn't revert the change of > > lock > > level in ReplicationSlotRelease(). Was that intentional? > > Hmm, no, that seems to have been a mistake. I'll restore it. Thanks

Re: .ready and .done files considered harmful

2021-11-11 Thread Robert Haas
On Thu, Nov 11, 2021 at 10:37 AM Bossart, Nathan wrote: > On 10/19/21, 7:53 AM, "Bossart, Nathan" wrote: > > On 10/19/21, 5:59 AM, "Robert Haas" wrote: > >> Nathan, I just realized we never closed the loop on this. Do you have > >> any thoughts? > > > > IMO the patch is in decent shape. Happy

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Isaac Morland
On Thu, 11 Nov 2021 at 14:42, Robert Haas wrote: > diacritical marks. I know I've seen collation changes on Macs that > changed the order in which en_US.UTF8 strings sorted. But it wasn't > that the rules about English sorting have actually changed. It was > that somebody somewhere decided that

Re: .ready and .done files considered harmful

2021-11-11 Thread Robert Haas
On Thu, Nov 11, 2021 at 3:58 PM Bossart, Nathan wrote: > Thanks! I figured it was something like that. Sorry if I caused the > thread breakage. I think it was actually that the thread went over 100 emails ... which usually causes Google to break it, but I don't know why it broke it into three

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Isaac Morland
On Thu, 11 Nov 2021 at 16:08, Robert Haas wrote: > On Thu, Nov 11, 2021 at 3:45 PM Isaac Morland > wrote: > > There is however one kind of change at least that I think can be made > safely: adding a new character in between existing characters. That > shouldn't affect any existing indexes. > >

Test::More version

2021-11-11 Thread Andrew Dunstan
perldoc Test::More says: Key feature milestones include: subtests Subtests were released in Test::More 0.94, which came with Perl 5.12.0. Subtests did not implicitly call "done_testing()" until 0.96; the first Perl with that fix was Perl

Re: Interrupts vs signals

2021-11-11 Thread Robert Haas
On Thu, Nov 11, 2021 at 2:50 PM Andres Freund wrote: > They can count, but only when used for network sockets or pipes ("slow > devices" or whatever the posix language is). Disk IO doesn't count as that. So > I don't think it'd be a huge issue. Somehow the idea that the network is a slow device

Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread Euler Taveira
On Thu, Nov 11, 2021, at 9:01 AM, houzj.f...@fujitsu.com wrote: > Also attach the patches for back branch and remove some unnecessary > changes from pgindent. I reviewed your patch and I think the fix could be simplified by if (OidIsValid(indexOid)) CacheInvalidateRelcache(rel); If indexOid is

Re: simplifying foreign key/RI checks

2021-11-11 Thread Amit Langote
On Fri, Nov 12, 2021 at 8:19 AM Tom Lane wrote: > Amit Langote writes: > > Rebased patches attached. > > I've spent some more time digging into the snapshot-management angle. Thanks for looking at this. > I think you are right that the crosscheck_snapshot isn't really an > issue because the

RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread houzj.f...@fujitsu.com
On Friday, November 12, 2021 10:46 AM I wrote: > On Friday, November 12, 2021 8:15 AM Euler Taveira > wrote: > > I reviewed your patch and I think the fix could be simplified by > > > > if (OidIsValid(indexOid)) > > CacheInvalidateRelcache(rel); > > > > If indexOid is valid it is a REPLICA

Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread Amit Kapila
On Fri, Nov 12, 2021 at 10:50 AM Amit Kapila wrote: > > On Fri, Nov 12, 2021 at 10:27 AM houzj.f...@fujitsu.com > wrote: > > > > On Friday, November 12, 2021 10:46 AM I wrote: > > > On Friday, November 12, 2021 8:15 AM Euler Taveira > > > wrote: > > > > I reviewed your patch and I think the fix

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

2021-11-11 Thread Kyotaro Horiguchi
At Thu, 11 Nov 2021 11:13:52 +0900 (JST), Kyotaro Horiguchi wrote in > At Wed, 10 Nov 2021 09:14:30 -0300, Alvaro Herrera > wrote in > > Can you use PostgreSQL::Test::Utils::tempdir_short() for those > > tablespaces? > > Thanks for the suggestion! > > It works for a live cluster. But

RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread houzj.f...@fujitsu.com
On Friday, November 12, 2021 8:15 AM Euler Taveira wrote: > I reviewed your patch and I think the fix could be simplified by > > if (OidIsValid(indexOid)) > CacheInvalidateRelcache(rel); > > If indexOid is valid it is a REPLICA IDENTITY INDEX. A few lines above there > is > a check for a valid

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

2021-11-11 Thread Amit Kapila
On Thu, Nov 11, 2021 at 1:44 PM Greg Nancarrow wrote: > > On Thu, Nov 11, 2021 at 5:52 PM houzj.f...@fujitsu.com > wrote: > > > > When looking into how to fix the second issue, I have a question: > > > > After changing publish_via_partition_root from false to true, the > > subcriber will fetch

Re: Optionally automatically disable logical replication subscriptions on error

2021-11-11 Thread Greg Nancarrow
On Thu, Nov 11, 2021 at 8:20 PM osumi.takami...@fujitsu.com wrote: > > C codes are checked by pgindent. > > Note that this depends on the v20 skip xide patch in [1] > Some comments on the v4 patch: (1) Patch subject I think the patch subject should say "disable" instead of "disabling":

Re: Optionally automatically disable logical replication subscriptions on error

2021-11-11 Thread vignesh C
On Thu, Nov 11, 2021 at 2:50 PM osumi.takami...@fujitsu.com wrote: > > On Wednesday, November 10, 2021 1:23 PM Greg Nancarrow > wrote: > > On Wed, Nov 10, 2021 at 12:26 PM osumi.takami...@fujitsu.com > > wrote: > > > > > > On Monday, November 8, 2021 10:15 PM vignesh C > > wrote: > > > >

Re: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread Amit Kapila
On Fri, Nov 12, 2021 at 10:27 AM houzj.f...@fujitsu.com wrote: > > On Friday, November 12, 2021 10:46 AM I wrote: > > On Friday, November 12, 2021 8:15 AM Euler Taveira > > wrote: > > > I reviewed your patch and I think the fix could be simplified by > > > > > > if (OidIsValid(indexOid)) > > >

Re: storing an explicit nonce

2021-11-11 Thread Bruce Momjian
On Tue, Oct 12, 2021 at 10:26:54AM -0400, Robert Haas wrote: > > specifically: Appendix C: Tweaks > > > > Quoting a couple of paragraphs from that appendix: > > > > """ > > In general, if there is information that is available and statically > > associated with a plaintext, it is recommended to

Re: simplifying foreign key/RI checks

2021-11-11 Thread Tom Lane
I wrote: > Anyway, I think that (1) we should write some more test cases around > this behavior, (2) you need to establish the snapshot to use in two > different ways for the RI_FKey_check and ri_Check_Pk_Match cases, > and (3) something's going to have to be done to repair the behavior > in v14

RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread houzj.f...@fujitsu.com
On Fri, Nov 12, 2021 1:33 PM Amit Kapila wrote: > On Fri, Nov 12, 2021 at 10:50 AM Amit Kapila wrote: > > But won't that generate invalidation for the rel twice in the case > > (change Replica Identity from Nothing to some index) you mentioned in > > the previous email? > > > > Oh, I see the

Re: [PATCH] postgres_fdw: suppress explicit casts in text:text comparisons (was: column option to override foreign types)

2021-11-11 Thread Dian M Fay
On Thu Nov 11, 2021 at 3:36 PM EST, Tom Lane wrote: > I thought about this some more and realized exactly why I wanted to > restrict the change to cases where the other side is a plain foreign > Var: that way, if anything surprising happens, we can blame it > directly on the user having declared a

Re: Parallel vacuum workers prevent the oldest xmin from advancing

2021-11-11 Thread Amit Kapila
On Thu, Nov 11, 2021 at 1:37 PM Masahiko Sawada wrote: > > On Thu, Nov 11, 2021 at 3:07 PM Amit Kapila wrote: > > > > > I think the disadvantage I see by not > > doing in ProcArrayInstallRestoedXmin is that we need to take procarray > > lock twice (once in exclusive mode and then in shared

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

2021-11-11 Thread Amit Kapila
On Thu, Nov 11, 2021 at 12:22 PM houzj.f...@fujitsu.com wrote: > > On Friday, November 5, 2021 11:20 AM Greg Nancarrow > wrote: > >On Thu, Nov 4, 2021 at 7:10 PM Amit Kapila > >wrote: > > > >Almost. > >The patch does seem to solve that first problem (double

Re: simplifying foreign key/RI checks

2021-11-11 Thread Tom Lane
Alvaro Herrera writes: > I think we (I) should definitely pursue fixing whatever was broken by > DETACH CONCURRENTLY, back to pg14, independently of this patch ... but > I would appreciate some insight into what the problem is. Here's what I'm on about: regression=# create table pk (f1 int

Re: XLogReadRecord() error in XlogReadTwoPhaseData()

2021-11-11 Thread Noah Misch
On Mon, Nov 08, 2021 at 01:42:46PM +0900, Michael Paquier wrote: > On Sat, Nov 06, 2021 at 06:31:57PM -0700, Noah Misch wrote: > > On Sun, Oct 24, 2021 at 04:35:02PM -0700, Noah Misch wrote: > > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=kittiwake=2021-10-24%2012%3A01%3A10 > > > got

Re: Logical replication timeout problem

2021-11-11 Thread Amit Kapila
On Thu, Nov 11, 2021 at 11:15 PM Fabrice Chapuis wrote: > > Hello, > Our lab is ready now. Amit, I compile Postgres 10.18 with your patch.Tang, I > used your script to configure logical replication between 2 databases and to > generate 10 million entries in an unreplicated foo table. On a

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

2021-11-11 Thread Greg Nancarrow
On Thu, Nov 11, 2021 at 5:52 PM houzj.f...@fujitsu.com wrote: > > When looking into how to fix the second issue, I have a question: > > After changing publish_via_partition_root from false to true, the > subcriber will fetch the partitioned table from publisher when refreshing. > > In subsriber

RE: Optionally automatically disable logical replication subscriptions on error

2021-11-11 Thread osumi.takami...@fujitsu.com
On Wednesday, November 10, 2021 1:23 PM Greg Nancarrow wrote: > On Wed, Nov 10, 2021 at 12:26 PM osumi.takami...@fujitsu.com > wrote: > > > > On Monday, November 8, 2021 10:15 PM vignesh C > wrote: > > > Thanks for the updated patch. Please create a Commitfest entry for > > > this. It will

RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread houzj.f...@fujitsu.com
On Thur, Nov 11, 2021 12:08 PM Amit Kapila wrote: > On Thu, Nov 11, 2021 at 7:07 AM houzj.f...@fujitsu.com > wrote: > > > > On Wed, Nov 10, 2021 7:29 PM Amit Kapila wrote: > > > > > > I don't understand the purpose of idx_b in the above test case, why is it > > > required to reproduce the

Re: Parallel vacuum workers prevent the oldest xmin from advancing

2021-11-11 Thread Masahiko Sawada
On Thu, Nov 11, 2021 at 3:07 PM Amit Kapila wrote: > > On Thu, Nov 11, 2021 at 10:40 AM Masahiko Sawada > wrote: > > > > On Thu, Nov 11, 2021 at 12:53 PM Amit Kapila > > wrote: > > > > > > On Thu, Nov 11, 2021 at 9:11 AM Andres Freund wrote: > > > > > > > > Hi, > > > > > > > > On 2021-11-11

Re: parallel vacuum comments

2021-11-11 Thread Amit Kapila
On Thu, Nov 11, 2021 at 8:11 AM Masahiko Sawada wrote: > > I've attached a draft patch that refactors parallel vacuum and > separates parallel-vacuum-related code to new file vacuumparallel.c. > After discussion, I'll divide the patch into logical chunks. > > What I'm not convinced yet in this

unexpected plan with id = any('{}') condition

2021-11-11 Thread Sergei Kornilov
Hello I have such case: create table test (id int not null, status text);insert into test select i, 'foo' from generate_series(1,100) i;update test set status = 'bar' where id <= 10;create index test_id on test (id );create index test_status_partial on test (status) where status =

Re: On login trigger: take three

2021-11-11 Thread Daniel Gustafsson
> On 11 Nov 2021, at 07:37, Greg Nancarrow wrote: > I've attached an updated patch, that essentially reinstates the v19 > patch Thanks! I've only skimmed it so far but it looks good, will do a more thorough review soon. +This flag is used to avoid extra lookups on the pg_event_trigger

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

2021-11-11 Thread Peter Eisentraut
I have reviewed your patch referential-actions-on-delete-only-set-cols-v3.patch. Attached are two patches that go on top of yours that contain my recommended changes. Basically, this all looks pretty good to me. My changes are mostly stylistic. Some notes of substance: - The omission of

Re: Should AT TIME ZONE be volatile?

2021-11-11 Thread Shay Rojansky
> Yeah, it's not clear that forbidding this would make anyone's life any > better. If you want an index on the UTC equivalent of a local time, > you're going to have to find a way to cope with potential mapping > changes. But refusing to let you use a generated column doesn't > seem to help

RE: [BUG]Invalidate relcache when setting REPLICA IDENTITY

2021-11-11 Thread houzj.f...@fujitsu.com
On Thursday, November 11, 2021 5:36 PM houzj.f...@fujitsu.com wrote: > On Thur, Nov 11, 2021 12:08 PM Amit Kapila wrote: > > On Thu, Nov 11, 2021 at 7:07 AM houzj.f...@fujitsu.com > wrote: > > > > > > On Wed, Nov 10, 2021 7:29 PM Amit Kapila > wrote: > > > > > > > > I don't understand the

Re: 2021-11-11 release announcement draft

2021-11-11 Thread Andrey Borodin
> 11 нояб. 2021 г., в 04:33, Peter Geoghegan написал(а): > > On Wed, Nov 10, 2021 at 11:07 AM Jonathan S. Katz > wrote: >>> * Fix causes of `CREATE INDEX CONCURRENTLY` and `REINDEX CONCURRENTLY` >>> writing >>> corrupt indexes. You should reindex any concurrently-built indexes. >> >>

Re: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display

2021-11-11 Thread Alvaro Herrera
On 2021-Nov-10, Bossart, Nathan wrote: > On 11/10/21, 9:43 AM, "Bharath Rupireddy" > wrote: > > As discussed in [1], isn't it a better idea to add some of activity > > messages [2] such as recovery, archive, backup, streaming etc. to > > server logs at LOG level? > I think this would make the

Re: remove spurious CREATE INDEX CONCURRENTLY wait

2021-11-11 Thread Alvaro Herrera
On 2021-Nov-10, Andres Freund wrote: > > Reverts 27838981be9d (some comments are kept). Per discussion, it does > > not seem safe to relax the lock level used for this; in order for it to > > be safe, there would have to be memory barriers between the point we set > > the flag and the point we

Re: Failed transaction statistics to measure the logical replication progress

2021-11-11 Thread vignesh C
On Wed, Nov 10, 2021 at 3:43 PM vignesh C wrote: > > On Tue, Nov 9, 2021 at 5:05 PM osumi.takami...@fujitsu.com > wrote: > > Yes. I've rebased and updated the patch, paying attention to this point. > > Attached the updated version. > > Thanks for the updated patch, few comments: > 6) Few places