Re: Inconsistent results from seqscan and gist indexscan

2021-11-26 Thread Tom Lane
Richard Guo writes: > On Fri, Nov 26, 2021 at 5:23 PM Julien Rouhaud wrote: >> On Fri, Nov 26, 2021 at 2:10 PM Richard Guo >> wrote: >>> Seems point_inside() does not handle NaN properly. >> This is unfortunately a known issue, which was reported twice ([1] and >> [2]) already. There's a patch

Re: WIP: WAL prefetch (another approach)

2021-11-26 Thread Tom Lane
Thomas Munro writes: > On Sat, Nov 27, 2021 at 12:34 PM Tomas Vondra > wrote: >> One thing that's not clear to me is what happened to the reasons why >> this feature was reverted in the PG14 cycle? > 3. A wild goose chase for bugs on Tom Lane's antique 32 bit PPC > machine. Tom eventually repr

Re: Add connection active, idle time to pg_stat_activity

2021-11-26 Thread Bharath Rupireddy
On Tue, Nov 16, 2021 at 5:06 PM Rafia Sabih wrote: > Got it. > Updated Thanks for the patch. +1 for adding the idle/idle_in_txn_time/active time. I believe these are the total times a backend in its lifetime accumulates. For instance, if a backend runs 100 txns, then these new columns show the to

Re: Inconsistent results from seqscan and gist indexscan

2021-11-26 Thread Richard Guo
On Fri, Nov 26, 2021 at 5:23 PM Julien Rouhaud wrote: > Hi, > > On Fri, Nov 26, 2021 at 2:10 PM Richard Guo > wrote: > > > > Seems point_inside() does not handle NaN properly. > > This is unfortunately a known issue, which was reported twice ([1] and > [2]) already. There's a patch proposed for

Re: WIP: WAL prefetch (another approach)

2021-11-26 Thread Thomas Munro
On Sat, Nov 27, 2021 at 12:34 PM Tomas Vondra wrote: > One thing that's not clear to me is what happened to the reasons why > this feature was reverted in the PG14 cycle? Reasons for reverting: 1. A bug in commit 323cbe7c, "Remove read_page callback from XLogReader.". I couldn't easily revert

Re: WIP: WAL prefetch (another approach)

2021-11-26 Thread Tomas Vondra
On 11/26/21 22:16, Thomas Munro wrote: On Fri, Nov 26, 2021 at 11:32 AM Tomas Vondra wrote: The results are pretty good / similar to previous results. Replaying the 1h worth of work on a smaller machine takes ~5:30h without prefetching (master or with prefetching disabled). With prefetching ena

Re: Unifying VACUUM VERBOSE and log_autovacuum_min_duration output

2021-11-26 Thread Peter Geoghegan
On Fri, Nov 26, 2021 at 1:57 PM Justin Pryzby wrote: > > * VACUUM VERBOSE doesn't provide much of the most useful > > instrumentation that we have available in log_autovacuum_min_duration, > > and yet produces output that is ludicrously, unmanageably verbose -- > > lots of pg_rusage_show() informa

Re: Unifying VACUUM VERBOSE and log_autovacuum_min_duration output

2021-11-26 Thread Peter Geoghegan
On Fri, Nov 26, 2021 at 12:37 PM Peter Geoghegan wrote: > Unifying everything cannot be approached mechanically, so doing this > requires real buy-in. It's a bit tricky because VACUUM VERBOSE is > supposed to show real time information about what just finished, as a > kind of rudimentary progress

Re: Unifying VACUUM VERBOSE and log_autovacuum_min_duration output

2021-11-26 Thread Justin Pryzby
On Fri, Nov 26, 2021 at 12:37:32PM -0800, Peter Geoghegan wrote: > My preferred approach to this is simple: redefine VACUUM VERBOSE to > not show incremental output, which seems rather unhelpful anyway. > I don't think that we need to keep the getrusage() stuff at all, though. +1 > * VACUUM VERB

Re: WIP: WAL prefetch (another approach)

2021-11-26 Thread Thomas Munro
On Fri, Nov 26, 2021 at 11:32 AM Tomas Vondra wrote: > The results are pretty good / similar to previous results. Replaying the > 1h worth of work on a smaller machine takes ~5:30h without prefetching > (master or with prefetching disabled). With prefetching enabled this > drops to ~2h (default co

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

2021-11-26 Thread Justin Pryzby
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_resetsharedcounter > +GetIOPathDesc > +StrategyRejectBuffer + an extra blank line pgstat_reset_s

Unifying VACUUM VERBOSE and log_autovacuum_min_duration output

2021-11-26 Thread Peter Geoghegan
I think that it's worth unifying VACUUM VERBOSE and log_autovacuum_min_duration output, to remove the redundancy, and to provide more useful VACUUM VERBOSE output. Both variants already output approximately the same things. But, each variant reports on certain details that the other variant lacks.

Re: Windows build warnings

2021-11-26 Thread Daniel Gustafsson
> On 26 Nov 2021, at 20:33, Tom Lane wrote: > > Andrew Dunstan writes: >> On 11/26/21 04:12, Daniel Gustafsson wrote: >>> On 26 Nov 2021, at 05:45, Tom Lane wrote: > Personally I'm not really in favour of outright disabling the C4101 > warning on Windows, because I think it is a useful

Re: Parallel Full Hash Join

2021-11-26 Thread Thomas Munro
On Sun, Nov 21, 2021 at 4:48 PM Justin Pryzby wrote: > On Wed, Nov 17, 2021 at 01:45:06PM -0500, Melanie Plageman wrote: > > Yes, this looks like that issue. > > > > I've attached a v8 set with the fix I suggested in [1] included. > > (I added it to 0001). > > This is still crashing :( > https://c

Re: Windows build warnings

2021-11-26 Thread Tom Lane
Andrew Dunstan writes: > On 11/26/21 04:12, Daniel Gustafsson wrote: >> On 26 Nov 2021, at 05:45, Tom Lane wrote: Personally I'm not really in favour of outright disabling the C4101 warning on Windows, because I think it is a useful warning for Postgres developers on Windows for ca

Re: rand48 replacement

2021-11-26 Thread Tom Lane
I wrote: > ... What we do need is a decision > about what to do on Windows. We could write it like > +#ifndef WIN32 > + srandom(pg_prng_i32(&pg_global_prng_state)); > +#endif > but I have a different modest suggestion: add > #define srandom(seed) srand(seed) > in win32_port.h. As far as I can

Re: Why not try for a HOT update, even when PageIsFull()?

2021-11-26 Thread Peter Geoghegan
On Sun, Nov 21, 2021 at 4:29 PM Peter Geoghegan wrote: > On Fri, Nov 19, 2021 at 11:51 AM Alvaro Herrera > wrote: > > I certainly do not object to removing it. > > I'd like to do so soon. I'll wait a few more days, in case Pavan objects. Pushed just now. Thanks -- Peter Geoghegan

Re: rand48 replacement

2021-11-26 Thread Tom Lane
Aleksander Alekseev writes: > It looks like the patch is in pretty good shape. I noticed that the > return value of pg_prng_strong_seed() is not checked in several > places, also there was a typo in pg_trgm.c. The corrected patch is > attached. Assuming the new version will not upset cfbot, I woul

Re: Windows build warnings

2021-11-26 Thread Andrew Dunstan
On 11/26/21 04:12, Daniel Gustafsson wrote: >> On 26 Nov 2021, at 05:45, Tom Lane wrote: >>> Personally I'm not really in favour of outright disabling the C4101 >>> warning on Windows, because I think it is a useful warning for >>> Postgres developers on Windows for cases unrelated to the use of

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

2021-11-26 Thread Tom Lane
Michael Paquier writes: > On Thu, Nov 25, 2021 at 06:19:03PM -0800, SATYANARAYANA NARLAPURAM wrote: >> If we are keeping it then why not make it better? > Well, non-exclusive backups are better by design in many aspects, so I > don't quite see the point in spending time on something that has more

RE: Optionally automatically disable logical replication subscriptions on error

2021-11-26 Thread osumi.takami...@fujitsu.com
On Monday, November 22, 2021 3:53 PM vignesh C wrote: > Few comments: Thank you so much for your review ! > 1) Changes to handle pg_dump are missing. It should be done in > dumpSubscription and getSubscriptions Fixed. > 2) "And" is missing > --- a/doc/src/sgml/ref/alter_subscription.sgml > +++ b

Re: prevent immature WAL streaming

2021-11-26 Thread Alvaro Herrera
On 2021-Nov-26, Amul Sul wrote: > On Fri, Nov 26, 2021 at 1:42 AM Tom Lane wrote: > > > > Meh ... but given the simplicity of the write-side fix, maybe changing > > it is appropriate. Actually, fixing the other side is equally simple, and it is also more correct. What changed my mind is that up

Re: Kerberos delegation support in libpq and postgres_fdw

2021-11-26 Thread Daniel Gustafsson
> On 3 Nov 2021, at 13:41, Daniel Gustafsson wrote: > > This patch no longer applies following the Perl namespace changes, can you > please submit a rebased version? Marking the patch "Waiting on Author". As the thread has stalled, and the OP email bounces, I'm marking this patch Returned with F

Re: Add regression coverage for REVOKE ADMIN OPTION

2021-11-26 Thread Daniel Gustafsson
> On 16 Nov 2021, at 15:32, Mark Dilger wrote: > Thanks for the review! Pushed to master along with the bugfix it helped uncover, thanks! -- Daniel Gustafsson https://vmware.com/

Re: Allow CURRENT_ROLE in GRANTED BY

2021-11-26 Thread Daniel Gustafsson
> On 18 Nov 2021, at 14:42, Daniel Gustafsson wrote: > >> On 18 Nov 2021, at 14:41, Peter Eisentraut >> wrote: >> >> On 16.11.21 15:27, Daniel Gustafsson wrote: > On 16 Nov 2021, at 15:04, Daniel Gustafsson wrote: ..or should the attached small diff be applied to fix it? >>> Actuall

Re: pg_upgrade fails with non-standard ACL

2021-11-26 Thread Daniel Gustafsson
This patch has been marked Waiting on Author since early March, with the thread stalled since then. I'm marking this CF entry Returned with Feedback, please feel free to resubmit it if/when a new version of the patch is available. -- Daniel Gustafsson https://vmware.com/

Re: ResourceOwner refactoring

2021-11-26 Thread Aleksander Alekseev
Hi Heikki, > I will submit the actual code review in the follow-up email The patchset is in a good shape. I'm changing the status to "Ready for Committer". -- Best regards, Aleksander Alekseev

Re: pg_upgrade and publication/subscription problem

2021-11-26 Thread Marcos Pegoraro
> > AFAIU the main problem in your case is that you didn't block the write > traffic on the publisher side. Let me try to understand the situation. > After the upgrade is finished, there are some new tables with data on > the publisher, and did old tables have any additional data? > Correct. > > A

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

2021-11-26 Thread Bharath Rupireddy
On Fri, Nov 26, 2021 at 11:50 AM Michael Paquier wrote: > > On Sat, Nov 20, 2021 at 11:46:35AM +0530, Bharath Rupireddy wrote: > > Thanks. Here's the v3 patch, a much simpler one. Please review it. > > + pqsignal(SIGINT, SignalHandlerForTermination); > + pqsignal(SIGTERM, SignalHandlerForTermi

Re: Inconsistent results from seqscan and gist indexscan

2021-11-26 Thread Julien Rouhaud
Hi, On Fri, Nov 26, 2021 at 2:10 PM Richard Guo wrote: > > Seems point_inside() does not handle NaN properly. This is unfortunately a known issue, which was reported twice ([1] and [2]) already. There's a patch proposed for it: https://commitfest.postgresql.org/32/2710/ (adding Horiguchi-san in

Re: Deduplicate code updating ControleFile's DBState.

2021-11-26 Thread Amul Sul
On Fri, Nov 26, 2021 at 12:16 PM Michael Paquier wrote: > > On Thu, Nov 25, 2021 at 04:04:23PM +0900, Michael Paquier wrote: > > I have not check the performance implication of that with a micro > > benchmark or the like, but I can get behind 0001 on consistency > > grounds between the backend and

Re: Windows build warnings

2021-11-26 Thread Daniel Gustafsson
> On 26 Nov 2021, at 05:45, Tom Lane wrote: >> Personally I'm not really in favour of outright disabling the C4101 >> warning on Windows, because I think it is a useful warning for >> Postgres developers on Windows for cases unrelated to the use of >> PG_USED_FOR_ASSERTS_ONLY. I'm not sure I fin

Re: Add connection active, idle time to pg_stat_activity

2021-11-26 Thread Dilip Kumar
On Tue, Nov 16, 2021 at 5:06 PM Rafia Sabih wrote: > > I think this change is wrong, basically, "tsmsg->m_idle_in_xact_time" > > is used for counting the database level idle in transaction count, you > > can check "pg_stat_get_db_idle_in_transaction_time" function for that. > > So "pgStatTransact

Re: [PATCH] ALTER tab completion

2021-11-26 Thread Ken Kato
Hi, Thank you for the comments! I made following updates: -ALTER DEFAULT PRIVILEGES: missing FOR USER FOR ROLE is an equivalent. That does not seem mandatory to me. I deleted the completion for "FOR USER". -ALTER VIEW: no completion after ALTER COLUMN column_name + /* ALTER VIEW xxx A