Re: Poll: are people okay with function/operator table redesign?

2020-04-18 Thread Pavel Stehule
so 18. 4. 2020 v 22:36 odesílatel Tom Lane napsal: > Robert Haas writes: > > On Fri, Apr 17, 2020 at 6:30 PM David G. Johnston > > wrote: > >> I feel like writing them as: > >> + (date, integer) -> date > >> makes more sense as they are mainly sorted on the operator symbol as > opposed to the l

Re: Implementation DISTINCT for window aggregate function: SUM

2020-04-18 Thread David Rowley
On Sat, 18 Apr 2020 at 23:47, Eugen Konkov wrote: > select id, amount, sum(DISTINCT amount) over () as total > from xx; > Why this is not possible in PG? Mainly because nobody has committed anything to implement it yet. > Why Window-specific functions do not allow DISTINCT to be used within t

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-04-18 Thread Justin Pryzby
On Tue, Apr 07, 2020 at 10:53:05AM -0500, Justin Pryzby wrote: > On Tue, Apr 07, 2020 at 08:40:30AM -0400, James Coleman wrote: > > > And, should it use two spaces before "Sort Method", "Memory" and > > > "Pre-sorted > ... > > I read through that subthread, and the ending seemed to be Peter > > wa

Re: DETACH PARTITION and FOR EACH ROW triggers on partitioned tables

2020-04-18 Thread Justin Pryzby
v3 fixes a brown-paper-bag logic error. -- Justin >From b5de1fc71f805bb8c7ec7e77bfce9a604ccd4bc8 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Fri, 3 Apr 2020 22:43:26 -0500 Subject: [PATCH v3] fix detaching tables with inherited row triggers The old behavior is buggy, and the intended beh

Re: DETACH PARTITION and FOR EACH ROW triggers on partitioned tables

2020-04-18 Thread Justin Pryzby
On Thu, Apr 09, 2020 at 09:46:38AM -0400, Tom Lane wrote: > Amit Langote writes: > > On Thu, Apr 9, 2020 at 3:09 AM Tom Lane wrote: > >> My point is that so long as you only allow the case of exactly one parent, > >> you can just delete the child trigger, because it must belong to that > >> paren

Re: relocating the server's backup manifest code

2020-04-18 Thread Michael Paquier
On Sat, Apr 18, 2020 at 10:43:52AM -0400, Robert Haas wrote: > I'm not in favor of this renaming. Different people have different > preferences, of course, but my impression is that the general project > style is to choose names that follow English word ordering, i.e. > appendStringInfo rather than

Re: where should I stick that backup?

2020-04-18 Thread Greg Stark
Fwiw, it was common trick in the Oracle world to create a named pipe to gzip and then write your backup to it. I really like that way of doing things but I suppose it's probably too old-fashioned to expect to survive. And in practice while it worked for a manual process for a sysadmin it's pretty a

Re: WAL usage calculation patch

2020-04-18 Thread Justin Pryzby
On Sat, Apr 18, 2020 at 05:39:35PM +0200, Julien Rouhaud wrote: > On Sat, Apr 18, 2020 at 6:16 AM Amit Kapila wrote: > > > > On Fri, Apr 17, 2020 at 6:45 PM Peter Eisentraut > > wrote: > > > On 2020-04-14 05:57, Amit Kapila wrote: > > > > Peter E, others, any suggestions on how to move forward?

Re: fixing old_snapshot_threshold's time->xid mapping

2020-04-18 Thread Andres Freund
Hi, On 2020-04-17 14:12:44 +1200, Thomas Munro wrote: > What about a contrib function that lets you clobber > oldSnapshotControl->current_timestamp? It looks like all times in > this system come ultimately from GetSnapshotCurrentTimestamp(), which > uses that variable to make sure that time never

Re: sqlsmith crash incremental sort

2020-04-18 Thread James Coleman
On Thu, Apr 16, 2020 at 9:26 PM Tom Lane wrote: > > Tomas Vondra writes: > > I think we have essentially three options: > > 1) assuming there's just a single group > > 2) assuming each row is a separate group > > 3) something in between > > If (1) and (2) are worst/best-case scenarios, maybe we s

Re: relocating the server's backup manifest code

2020-04-18 Thread Magnus Hagander
On Sat, Apr 18, 2020 at 5:43 PM Tom Lane wrote: > Robert Haas writes: > > Despite the fact that we are after feature freeze, I think it would be > > a good idea to commit this to PG 13. It could be saved for PG 14, but > > that will make future back-patching substantially harder. Also, a > > pat

Re: Race condition in SyncRepGetSyncStandbysPriority

2020-04-18 Thread Tom Lane
Masahiko Sawada writes: > On Sat, 18 Apr 2020 at 00:31, Tom Lane wrote: >> + /* Quick out if not even configured to be synchronous */ >> + if (SyncRepConfig == NULL) >> + return false; > I felt strange a bit that we do the above check in > SyncRepGetSyncRecPtr() because SyncRepReleaseW

Re: relocating the server's backup manifest code

2020-04-18 Thread Tom Lane
Robert Haas writes: > Despite the fact that we are after feature freeze, I think it would be > a good idea to commit this to PG 13. It could be saved for PG 14, but > that will make future back-patching substantially harder. Also, a > patch that's just moving code is pretty low-risk. +1 in princi

Re: WAL usage calculation patch

2020-04-18 Thread Julien Rouhaud
On Sat, Apr 18, 2020 at 6:16 AM Amit Kapila wrote: > > On Fri, Apr 17, 2020 at 6:45 PM Peter Eisentraut > wrote: > > > > On 2020-04-14 05:57, Amit Kapila wrote: > > > Peter E, others, any suggestions on how to move forward? I think here > > > we should follow the rule "follow the style of nearby

Re: Error on failed COMMIT

2020-04-18 Thread Tony Locke
On Thu, 16 Apr 2020 at 21:16, Shay Rojansky wrote: > Npgsql would be fine. In fact, Npgsql doesn't have any specific expectations > nor any specific logic around commit; it assumes errors may be returned for > any command (COMMIT or otherwise), and surfaces those errors as .NET > exceptions. H

Re: where should I stick that backup?

2020-04-18 Thread Robert Haas
On Fri, Apr 17, 2020 at 7:44 PM Andres Freund wrote: > This suggest that pipes do have a considerably higher overhead on > windows, but that it's not all that terrible if one takes care to use > large buffers in each pipe element. > > It's notable though that even the simplest use of a pipe does a

Re: relocating the server's backup manifest code

2020-04-18 Thread Robert Haas
On Sat, Apr 18, 2020 at 8:57 AM Michael Paquier wrote: > +static inline bool > +IsManifestEnabled(manifest_info *manifest) > +{ > + return (manifest->buffile != NULL); > +} > I would keep this one static and located within backup_manifest.c as > it is only used there. Oh, OK. > +extern void In

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-04-18 Thread Dilip Kumar
On Sat, Apr 18, 2020 at 6:12 PM Erik Rijkers wrote: > > On 2020-04-18 11:10, Erik Rijkers wrote: > > On 2020-04-18 11:07, Erik Rijkers wrote: > Hi Erik, > > While setting up the cascading replication I have hit one issue on > base code[1]. After fixing that I have got one cras

valgrind error

2020-04-18 Thread Andrew Dunstan
I was just trying to revive lousyjack, my valgrind buildfarm animal which has been offline for 12 days, after having upgraded the machine (fedora 31, gcc 9.3.1, valgrind 3.15) and noticed lots of errors like this: 2020-04-17 19:26:03.483 EDT [63741:3] pg_regress LOG:  statement: CREATE DATABASE

Re: relocating the server's backup manifest code

2020-04-18 Thread Michael Paquier
On Sat, Apr 18, 2020 at 08:37:58AM -0400, Robert Haas wrote: > Despite the fact that we are after feature freeze, I think it would be > a good idea to commit this to PG 13. It could be saved for PG 14, but > that will make future back-patching substantially harder. Also, a > patch that's just movin

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-04-18 Thread Erik Rijkers
On 2020-04-18 11:10, Erik Rijkers wrote: On 2020-04-18 11:07, Erik Rijkers wrote: Hi Erik, While setting up the cascading replication I have hit one issue on base code[1]. After fixing that I have got one crash with streaming on patch. I am not sure whether you are facing any of these 2 issu

relocating the server's backup manifest code

2020-04-18 Thread Robert Haas
Hi, The backup manifest patch added a bunch of new code to src/backend/replication/basebackup.c, and while lamenting the complexity of that source file yesterday, I suddenly realized that I'd unwittingly contributed to making that problem worse, and that it would be quite easy to move the code add

Re: snapshot too old issues, first around wraparound and then more.

2020-04-18 Thread Robert Haas
On Fri, Apr 17, 2020 at 4:40 PM Thomas Munro wrote: > I understood that you'd forked a new thread to discuss one particular > problem among the many that Andres nailed to the door, namely the xid > map's failure to be monotonic, and here I was responding to other > things from his list, namely the

Re: Poll: are people okay with function/operator table redesign?

2020-04-18 Thread Robert Haas
On Fri, Apr 17, 2020 at 6:30 PM David G. Johnston wrote: > I feel like writing them as: > > + (date, integer) -> date > > makes more sense as they are mainly sorted on the operator symbol as opposed > to the left operand. I thought about that, too, but I think the way Tom did it is better. It's

Implementation DISTINCT for window aggregate function: SUM

2020-04-18 Thread Eugen Konkov
Hello PostgreSQL-development, Oracle has implementation: select id, amount, sum(DISTINCT amount) over () as total from xx; https://dbfiddle.uk/?rdbms=oracle_18&fiddle=8eeb60183ec9576ddb4b2c9f2874d09f Why this is not possible in PG? https://dbfiddle.uk/?rdbms=postgres_12&fiddle=97c05203af4c9

Re: PG compilation error with Visual Studio 2015/2017/2019

2020-04-18 Thread Ranier Vilela
Em sex., 17 de abr. de 2020 às 15:44, Juan José Santamaría Flecha < juanjo.santama...@gmail.com> escreveu: > > On Fri, Apr 17, 2020 at 10:33 AM Amit Kapila > wrote: > >> >> I see some differences in the output when _create_locale() is used vs. >> when GetLocaleInfoEx() is used. Forex. >> > > Tha

Re: fixing old_snapshot_threshold's time->xid mapping

2020-04-18 Thread Dilip Kumar
On Sat, Apr 18, 2020 at 11:47 AM Thomas Munro wrote: > > On Fri, Apr 17, 2020 at 2:12 PM Thomas Munro wrote: > > What about a contrib function that lets you clobber > > oldSnapshotControl->current_timestamp? It looks like all times in > > this system come ultimately from GetSnapshotCurrentTimest

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-04-18 Thread Erik Rijkers
On 2020-04-18 11:07, Erik Rijkers wrote: Hi Erik, While setting up the cascading replication I have hit one issue on base code[1]. After fixing that I have got one crash with streaming on patch. I am not sure whether you are facing any of these 2 issues or any other issue. If your issue is no

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-04-18 Thread Erik Rijkers
On 2020-04-16 11:46, Erik Rijkers wrote: On 2020-04-16 11:33, Dilip Kumar wrote: On Tue, Apr 14, 2020 at 9:14 PM Erik Rijkers wrote: On 2020-04-14 12:10, Dilip Kumar wrote: > v14-0001-Immediately-WAL-log-assignments.patch + > v14-0002-Issue-individual-invalidations-with.patch

Re: 001_rep_changes.pl stalls

2020-04-18 Thread Noah Misch
On Fri, Apr 17, 2020 at 05:06:29PM +0900, Kyotaro Horiguchi wrote: > At Fri, 17 Apr 2020 17:00:15 +0900 (JST), Kyotaro Horiguchi > wrote in > > By the way, if latch is consumed in WalSndLoop, succeeding call to > > WalSndWaitForWal cannot be woke-up by the latch-set. Doesn't that > > cause miss