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

2020-10-18 Thread Julien Rouhaud
On Sat, Oct 17, 2020 at 6:11 AM Anastasia Lubennikova wrote: > > On 16.10.2020 12:07, Julien Rouhaud wrote: > > Le ven. 16 oct. 2020 à 16:12, Pavel Stehule a écrit > : >> >> >> >> pá 16. 10. 2020 v 9:43 odesílatel napsal: >>> >>> Hi, hackers. >>> For some distributions of data in tables,

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

2020-10-18 Thread Julien Rouhaud
On Sun, Oct 18, 2020 at 12:20 PM Tom Lane wrote: > > 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 >

Re: Resetting spilled txn statistics in pg_stat_replication

2020-10-18 Thread Amit Kapila
On Mon, Oct 19, 2020 at 9:04 AM Masahiko Sawada wrote: > > On Thu, 15 Oct 2020 at 17:51, Amit Kapila wrote: > > > > > > AFAICS, we use name data-type in many other similar stats views like > > pg_stat_subscription, pg_statio_all_sequences, pg_stat_user_functions, > > pg_stat_all_tables. So,

Re: VACUUM PARALLEL option vs. max_parallel_maintenance_workers

2020-10-18 Thread Amit Kapila
On Thu, Oct 15, 2020 at 9:02 AM Amit Kapila wrote: > > On Mon, Oct 5, 2020 at 8:11 AM Amit Kapila wrote: > > > > On Sat, Oct 3, 2020 at 6:55 PM Masahiko Sawada > > wrote: > > > > > > To make the behavior of parallel vacuum more consistent with other > > > parallel maintenance commands (i.g.,

Re: pg_restore error message during ENOSPC with largeobj

2020-10-18 Thread Tom Lane
I wrote: > Isn't the real problem that lo_write returns int, not size_t? After looking at it some more, I decided that we'd just been lazy to begin with: we should be handling this as a regular SQL error condition. Pushed at 929c69aa19. regards, tom lane

Re: Sometimes the output to the stdout in Windows disappears

2020-10-18 Thread Tom Lane
Alexander Lakhin writes: > With the fix all the 200 iterations passed as expected. > Then I ran the loop again just to be sure and got: > test thread/descriptor    ... stderr FAILED   81 ms > iteration 124 failed. Sigh ... still, this: > diff -w -U3 >

Re: Assertion failure with LEFT JOINs among >500 relations

2020-10-18 Thread Tom Lane
David Rowley writes: > It would be good to hear Onder's case to see if he has a good argument > for having a vested interest in pg13 not failing this way with assets > enabled. Yeah, some context for this report would be a good thing. (BTW, am I wrong to suppose that the same case fails the same

Re: Sometimes the output to the stdout in Windows disappears

2020-10-18 Thread Alexander Lakhin
17.10.2020 21:44, Tom Lane wrote: > I propose the attached patch. If this doesn't cause buildfarm problems, > perhaps we should back-patch it. Thank you! I've made a simple cmd script to reproduce problems seen on dory: https://buildfarm.postgresql.org/cgi-bin/show_history.pl?nm=dory=HEAD FOR /L

Re: Sometimes the output to the stdout in Windows disappears

2020-10-18 Thread Tom Lane
Alexander Lakhin writes: > I've made a simple cmd script to reproduce problems seen on dory: > ... > Without the fix I've got errors on iterations 43, 46, 128, 47, 14, 4, > 27, which approximately corresponds to the ECPG-Check failure frequency > on dory (for HEAD). > With the fix all the 200

Re: Implementing Incremental View Maintenance

2020-10-18 Thread Tatsuo Ishii
> * Aggregate support > > The current patch supports several built-in aggregates, that is, count, sum, > avg, min, and max. Other built-in aggregates or user-defined aggregates are > not supported. > > Aggregates in a materialized view definition is checked if this is supported > using OIDs of

[patch] ENUM errdetail should mention bytes, not chars

2020-10-18 Thread Ian Lawrence Barwick
Hi The errdetail emitted when creating/modifying an ENUM value is misleading: postgres=# CREATE TYPE enum_valtest AS ENUM ( 'foo', 'ああ' ); ERROR: invalid enum label "ああ" DETAIL: Labels must be 63

RE: Transactions involving multiple postgres foreign servers, take 2

2020-10-18 Thread tsunakawa.ta...@fujitsu.com
From: Masahiko Sawada > > Unfortunately, I'm afraid we can do nothing about it. If the DBMS's client > library doesn't support cancellation (e.g. doesn't respond to Ctrl+C or > provide a > function that cancel processing in pgorogss), then the Postgres user just > finds > that he can't cancel

RE: Use of "long" in incremental sort code

2020-10-18 Thread Tang, Haiying
Hi Found one more place needed to be changed(long -> int64). Also changed the output for int64 data(Debug mode on & define EXEC_SORTDEBUG ) And, maybe there's a typo in " src\backend\executor\nodeIncrementalSort.c" as below. Obviously, the ">=" is meaningless, right? -

Re: partition routing layering in nodeModifyTable.c

2020-10-18 Thread Amit Langote
On Sun, Oct 18, 2020 at 12:54 AM Alvaro Herrera wrote: > 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

Re: Transactions involving multiple postgres foreign servers, take 2

2020-10-18 Thread Masahiko Sawada
On Mon, 12 Oct 2020 at 17:19, tsunakawa.ta...@fujitsu.com wrote: > > From: Masahiko Sawada > > I was thinking to have a GUC timeout parameter like statement_timeout. > > The backend waits for the setting value when resolving foreign > > transactions. > > Me too. > > > > But this idea seems

Re: [patch] ENUM errdetail should mention bytes, not chars

2020-10-18 Thread Julien Rouhaud
On Mon, Oct 19, 2020 at 12:18 PM Ian Lawrence Barwick wrote: > > Hi > > The errdetail emitted when creating/modifying an ENUM value is misleading: > > postgres=# CREATE TYPE enum_valtest AS ENUM ( > 'foo', > 'ああ' >); >

Re: Resetting spilled txn statistics in pg_stat_replication

2020-10-18 Thread Masahiko Sawada
On Thu, 15 Oct 2020 at 17:51, Amit Kapila wrote: > > On Tue, Oct 13, 2020 at 5:41 AM Masahiko Sawada > wrote: > > > > On Mon, 12 Oct 2020 at 23:45, Shinoda, Noriyoshi (PN Japan A > > Delivery) wrote: > > > > > > > > > > As it may have been discussed, I think the 'name' column in > > > >

Re: Internal key management system

2020-10-18 Thread Masahiko Sawada
On Sat, 17 Oct 2020 at 05:24, Bruce Momjian wrote: > > On Fri, Jul 31, 2020 at 04:06:38PM +0900, Masahiko Sawada wrote: > > > Given that the purpose of the key manager is to help TDE, discussing > > > the SQL interface part (i.g., the second patch) deviates from the > > > original purpose. I

Re: Online checksums verification in the backend

2020-10-18 Thread Julien Rouhaud
On Mon, Oct 19, 2020 at 10:39 AM Michael Paquier wrote: > > On Fri, Oct 16, 2020 at 09:22:02AM +0800, Julien Rouhaud wrote: > > And Michael just told me that I also missed adding one of the C files > > while splitting the patch into two. > > + if (PageIsNew(page)) > + { > + /* > +

RE: [POC] Fast COPY FROM command for the table with foreign partitions

2020-10-18 Thread tsunakawa.ta...@fujitsu.com
Hello Andrey-san, Thank you for challenging an interesting feature. Below are my review comments. (1) - /* for use by copy.c when performing multi-inserts */ + /* +* The following fields are currently only relevant to copy.c. +* +* True if okay to use

Re: Sometimes the output to the stdout in Windows disappears

2020-10-18 Thread Alexander Lakhin
18.10.2020 21:04, Tom Lane wrote: > Alexander Lakhin writes: >> @@ -0,0 +1 @@ >> +SQL error: descriptor "mydesc" not found on line 31 > does not look like the same kind of failure as what we've been dealing > with up to now. So maybe what we've got is that we fixed the stdio > loss problem, and

Re: Assertion failure with LEFT JOINs among >500 relations

2020-10-18 Thread David Rowley
On Mon, 19 Oct 2020 at 12:25, Tom Lane wrote: > > David Rowley writes: > > On Mon, 19 Oct 2020 at 12:10, Tom Lane wrote: > >> TBH, I see no need to do anything in the back branches. This is not > >> an issue for production usage. > > > I understand the Assert failure is pretty harmless, so

RE: Resetting spilled txn statistics in pg_stat_replication

2020-10-18 Thread Shinoda, Noriyoshi (PN Japan A Delivery)
Amit-san, Sawada-san, Thank you for your comment. > AFAICS, we use name data-type in many other similar stats views like > pg_stat_subscription, pg_statio_all_sequences, pg_stat_user_functions, > pg_stat_all_tables. So, shouldn't we consistent with those views? I checked the data type used

Re: Online checksums verification in the backend

2020-10-18 Thread Michael Paquier
On Fri, Oct 16, 2020 at 09:22:02AM +0800, Julien Rouhaud wrote: > And Michael just told me that I also missed adding one of the C files > while splitting the patch into two. + if (PageIsNew(page)) + { + /* +* Check if the page is really new or if there's corruption that +

Re: Sometimes the output to the stdout in Windows disappears

2020-10-18 Thread Tom Lane
I wrote: >> diff -w -U3 >> .../src/interfaces/ecpg/test/expected/thread-descriptor.stderr >> .../src/interfaces/ecpg/test/results/thread-descriptor.stderr >> --- .../src/interfaces/ecpg/test/expected/thread-descriptor.stderr    >> 2019-12-04 16:05:46 +0300 >> +++

Re: Assertion failure with LEFT JOINs among >500 relations

2020-10-18 Thread Tom Lane
David Rowley writes: > On Sat, 17 Oct 2020 at 06:00, Tom Lane wrote: >> I'm good with the v2 patch. > Thanks a lot for having a look. I'll proceed in getting the v2 which I > sent earlier into master. > For the backbranches, I think I go with something more minimal in the > form of adding:

Re: jit and explain nontext

2020-10-18 Thread David Rowley
On Sun, 18 Oct 2020 at 08:21, Justin Pryzby wrote: > /* don't print information if no JITing happened */ > - if (!ji || ji->created_functions == 0) > + if (!ji || (ji->created_functions == 0 && > + es->format == EXPLAIN_FORMAT_TEXT)) >

Re: Possible memory leak in pgcrypto with EVP_MD_CTX

2020-10-18 Thread Michael Paquier
On Thu, Oct 15, 2020 at 04:22:12PM +0900, Michael Paquier wrote: > That's a bit annoying, because this memory is allocated directly by > OpenSSL, and Postgres does not know how to free it until it gets > registered in the list of open_digests that would be used by the > cleanup callback, so I

Re: Assertion failure with LEFT JOINs among >500 relations

2020-10-18 Thread David Rowley
On Sat, 17 Oct 2020 at 06:00, Tom Lane wrote: > I'm confused now, because the v2 patch does remove those isnan calls? I think that was a case of a last-minute change of mind and forgetting to attach the updated patch. > I rechecked the archives, and I agree that there's no data about > exactly

Re: Assertion failure with LEFT JOINs among >500 relations

2020-10-18 Thread David Rowley
On Mon, 19 Oct 2020 at 12:10, Tom Lane wrote: > > David Rowley writes: > > For the backbranches, I think I go with something more minimal in the > > form of adding: > > TBH, I see no need to do anything in the back branches. This is not > an issue for production usage. I understand the Assert

Re: Assertion failure with LEFT JOINs among >500 relations

2020-10-18 Thread David Rowley
On Mon, 19 Oct 2020 at 13:06, Tom Lane wrote: > (BTW, am I wrong to suppose that the same case fails the same > way in our older branches? Certainly that Assert has been there > a long time.) I only tested as back as far as 9.5, but it does fail there. David

Non-configure build of thread_test has been broken for awhile

2020-10-18 Thread Tom Lane
If you go into src/test/thread/ and type "make", you get a bunch of "undefined reference to `pg_fprintf'" failures. That's because thread_test.c #include's postgres.h but the Makefile doesn't bother to link it with libpgport, arguing (falsely) that that might not exist yet. Presumably, this has

Re: Sometimes the output to the stdout in Windows disappears

2020-10-18 Thread Tom Lane
Alexander Lakhin writes: > I just wanted to inform that the ECPG-test failures can still persist in > the buildfarm, unfortunately. Right, but at least now we can see that there are other issues to investigate. Personally I stopped paying any attention to buildfarm ECPG failures on Windows some

Re: Assertion failure with LEFT JOINs among >500 relations

2020-10-18 Thread Tom Lane
David Rowley writes: > On Mon, 19 Oct 2020 at 12:10, Tom Lane wrote: >> TBH, I see no need to do anything in the back branches. This is not >> an issue for production usage. > I understand the Assert failure is pretty harmless, so non-assert > builds shouldn't suffer too greatly. I just

Re: public schema default ACL

2020-10-18 Thread Noah Misch
On Wed, Aug 05, 2020 at 10:00:02PM -0700, Noah Misch wrote: > On Mon, Aug 03, 2020 at 09:46:23AM -0400, Robert Haas wrote: > > On Mon, Aug 3, 2020 at 2:30 AM Noah Misch wrote: > > > Between (b)(2)(X) and (b)(3)(X), what are folks' preferences? Does anyone > > > strongly favor some other option