Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

2020-10-17 Thread Tom Lane
Alvaro Herrera writes: > Wait ... what? I've been thinking that this GUC is just to enable or > disable the computation of query ID, not to change the algorithm to do > so. Do we really need to allow different algorithms in different > sessions? We established that some time ago, no?

Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

2020-10-17 Thread Alvaro Herrera
On 2020-Oct-17, Tom Lane wrote: > Fair point, but if we allow several different values to be set in > different sessions, what ends up happening in pg_stat_statements? > > On the other hand, maybe that's just a matter for documentation. > "If the 'same' query is processed with two different query

Re: pg_restore error message during ENOSPC with largeobj

2020-10-17 Thread Tom Lane
Justin Pryzby writes: > I overflowed my homedir while testing with pg_reload, and got: > |pg_restore: error: could not write to large object (result: > 18446744073709551615, expected: 30) Bleah. > I guess casting to long was the best option c. 2002 (commit 6faf8024f) but I > gather the modern w

RE: Parallel copy

2020-10-17 Thread Hou, Zhijie
Hi Vignesh, After having a look over the patch, I have some suggestions for 0003-Allow-copy-from-command-to-process-data-from-file.patch. 1. +static uint32 +EstimateCstateSize(ParallelContext *pcxt, CopyState cstate, List *attnamelist, + char **whereClauseStr, c

pg_restore error message during ENOSPC with largeobj

2020-10-17 Thread Justin Pryzby
I overflowed my homedir while testing with pg_reload, and got: |pg_restore: error: could not write to large object (result: 18446744073709551615, expected: 30) src/bin/pg_dump/pg_backup_archiver.c f (res != AH->lo_buf_used) fatal("could not write to large object (result: %lu,

Re: jit and explain nontext

2020-10-17 Thread Justin Pryzby
On Thu, Oct 15, 2020 at 02:51:38PM +1300, David Rowley wrote: > On Thu, 15 Oct 2020 at 14:43, Justin Pryzby wrote: > > On Thu, Oct 15, 2020 at 02:23:01PM +1300, David Rowley wrote: > > > On Thu, 15 Oct 2020 at 14:15, Tom Lane wrote: > > > > Hmm, I dunno if my opinion counts as "wisdom", but what

Re: Sometimes the output to the stdout in Windows disappears

2020-10-17 Thread Tom Lane
I wrote: > Alexander Lakhin writes: >> What bothers me is: >> There must be a call to *WSACleanup* for each successful call to >> WSAStartup >> >> . > Yeah, that is a very odd statement. Surely, t

Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

2020-10-17 Thread Tom Lane
Alvaro Herrera writes: > On 2020-Oct-17, Julien Rouhaud wrote: >> On Sat, Oct 17, 2020 at 12:23 AM Tom Lane wrote: >>> then there's a potential security issue if the GUC is USERSET level: >>> a user could hide her queries from pg_stat_statement by turning the >>> GUC off. So this line of thought

Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

2020-10-17 Thread Alvaro Herrera
On 2020-Oct-17, Julien Rouhaud wrote: > On Sat, Oct 17, 2020 at 12:23 AM Tom Lane wrote: > > then there's a potential security issue if the GUC is USERSET level: > > a user could hide her queries from pg_stat_statement by turning the > > GUC off. So this line of thought suggests the GUC needs t

Re: warn_unused_results

2020-10-17 Thread Tom Lane
Peter Eisentraut writes: > Forgetting to assign the return value of list APIs such as lappend() is > a perennial favorite. The compiler can help point out such mistakes. > GCC has an attribute warn_unused_results. Also C++ has standardized > this under the name "nodiscard", and C has a propos

Re: partition routing layering in nodeModifyTable.c

2020-10-17 Thread Alvaro Herrera
On 2020-Oct-17, Amit Langote wrote: > Hmm, I don't see ri_PartitionCheckExpr as being a piece of routing > information, because it's primarily meant to be used when inserting > *directly* into a partition, although it's true we do initialize it in > routing target partitions too in some cases. >

Re: Sometimes the output to the stdout in Windows disappears

2020-10-17 Thread Tom Lane
Alexander Lakhin writes: > 16.10.2020 19:18, Tom Lane wrote: >> What if we arranged to call WSAStartup just once, during the first >> libpq connection-open in a process, and then never did WSACleanup? >> Surely the OS can cope with that, and it eliminates any risk that >> WSACleanup breaks somethi

Re: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)

2020-10-17 Thread Peter Geoghegan
On Tue, Oct 13, 2020 at 7:26 PM Noah Misch wrote: > 1. Disable parallelism for the index build under ExecuteTruncateGuts(). >Nobody will mourn a performance loss from declining parallelism for an >empty index, but I feel like this is fixing in the wrong place. > 2. Make _bt_begin_parallel(

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

2020-10-17 Thread David G. Johnston
On Fri, Oct 16, 2020 at 3:11 PM Anastasia Lubennikova < a.lubennik...@postgrespro.ru> wrote: > User visible change is: > > > - -> Nested Loop (actual rows=N loops=N) > + -> Nested Loop (actual min_rows=0 rows=0 max_rows=0 > loops=2) > I'd be inclined to append both new

Re: Sometimes the output to the stdout in Windows disappears

2020-10-17 Thread Andrew Dunstan
On 10/16/20 12:18 PM, Tom Lane wrote: > > But wait a minute: I just looked at Microsoft's docs [1] and found > > In a multithreaded environment, WSACleanup terminates Windows Sockets > operations for all threads. > > This makes me (a) wonder if that explains the side-effects on stdio, > a

Re: Wrong example in the bloom documentation

2020-10-17 Thread Daniel Westermann (DWE)
On Fri, Oct  9, 2020 at 11:08:32AM -0400, Bruce Momjian wrote: > On Fri, Oct  9, 2020 at 05:44:57AM +, Daniel Westermann (DWE) wrote: > > Hi Bruce, Tom, > > > > On Thu, Oct  8, 2020 at 03:43:32PM -0400, Tom Lane wrote: > > >> "Daniel Westermann (DWE)" writes: > > >> >> I was hoping someone mo

[doc] improve tableoid description

2020-10-17 Thread Ian Lawrence Barwick
[doc] improve tableoid description Hi Attached patch aims to improve the description of the tableoid system column [1] by: - mentioning it's useful for determining table names for partitioned tables as well as for those in inheritance hierarchies - mentioning the possibility of casting tableoi

Timing of relcache inval at parallel worker init

2020-10-17 Thread Noah Misch
While reviewing what became commit fe4d022, I was surprised at the sequence of relfilenode values that RelationInitPhysicalAddr() computed for pg_class, during ParallelWorkerMain(), when running the last command of this recipe: begin; cluster pg_class using pg_class_oid_index; set force_para

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

2020-10-17 Thread hubert depesz lubaczewski
On Sat, Oct 17, 2020 at 12:26:08PM +0800, Julien Rouhaud wrote: > >> - -> Nested Loop (actual rows=N loops=N) > >> + -> Nested Loop (actual min_rows=0 rows=0 max_rows=0 > >> loops=2) > > This interface is ok - there is not too much space for creativity. > Yes I also th

Re: Sometimes the output to the stdout in Windows disappears

2020-10-17 Thread Alexander Lakhin
16.10.2020 19:18, Tom Lane wrote: > Oh, very interesting. > Now that you have it somewhat in captivity, maybe you could determine > some things: > > 1. Is it only stdout that's affected? What of other stdio streams? > (Note that testing stderr might be tricky because it's probably > line-buffered.

Re: partition routing layering in nodeModifyTable.c

2020-10-17 Thread Amit Langote
On Fri, Oct 16, 2020 at 11:45 PM Alvaro Herrera wrote: > On 2020-Oct-16, Amit Langote wrote: > > On Thu, Oct 15, 2020 at 11:59 PM Heikki Linnakangas wrote: > > > On Wed, Oct 14, 2020 at 6:04 PM Heikki Linnakangas > > > wrote: > > > > And if we removed > > > ri_PartitionInfo->pi_PartitionToRootM