Re: Improve choose_custom_plan for initial partition prune case

2020-10-06 Thread Andy Fan
> > > 2. Associate them with RelationOid, and we can record such information in > the > Append node as well. The bad part is the same relation Oid may appear > multiple > times in a query. for example: SELECT .. FROM p p1, p p2 where > p1.partkey1 = $1 > AND p2.partkey2 = $2; > > I just came up

Re: Improve choose_custom_plan for initial partition prune case

2020-10-06 Thread Andy Fan
On Sat, Oct 3, 2020 at 10:05 AM Andy Fan wrote: > Hi Amit: > > Very glad to see your comment! > > On Fri, Oct 2, 2020 at 4:21 PM Amit Langote > wrote: > >> Hi Andy, >> >> On Fri, Oct 2, 2020 at 1:04 AM Andy Fan wrote: >> > >> > Given the plan example: >> > >> > CREATE TABLE measurement ( >> >

Re: new heapcheck contrib module

2020-10-06 Thread Andrey Borodin
> 7 окт. 2020 г., в 04:20, Mark Dilger > написал(а): > > > >> On Oct 5, 2020, at 5:24 PM, Mark Dilger wrote: >> >> - This version does not change clog handling, which leaves Andrey's concern >> unaddressed. Peter also showed some support for (or perhaps just a lack of >> opposition to)

Re: speed up unicode normalization quick check

2020-10-06 Thread Michael Paquier
On Sat, Sep 19, 2020 at 04:09:27PM -0700, Mark Dilger wrote: > I am marking this ready for committer. I didn't object to the > whitespace weirdness in your patch (about which `git apply` > grumbles) since you seem to have done that intentionally. I have no > further comments on the performance is

Re: Resetting spilled txn statistics in pg_stat_replication

2020-10-06 Thread Masahiko Sawada
On Tue, 6 Oct 2020 at 17:56, Amit Kapila wrote: > > On Tue, Oct 6, 2020 at 9:34 AM Masahiko Sawada > wrote: > > > > Looking at pgstat_reset_replslot_counter() in the v8 patch, even if we > > pass a physical slot name to pg_stat_reset_replication_slot() a > > PgStat_MsgResetreplslotcounter is sent

Re: Improve choose_custom_plan for initial partition prune case

2020-10-06 Thread Andy Fan
Hi Ashutosh: Thanks for coming. On Mon, Oct 5, 2020 at 9:27 PM Ashutosh Bapat wrote: > On Thu, Oct 1, 2020 at 9:34 PM Andy Fan wrote: > > > > Given the plan example: > > > > CREATE TABLE measurement ( > > city_id int not null, > > logdate date not null, > > peaktemp

Re: [HACKERS] logical decoding of two-phase transactions

2020-10-06 Thread Amit Kapila
On Tue, Oct 6, 2020 at 10:23 AM peter.b.sm...@fujitsu.com wrote: > > > [BEGIN] > > == > Patch V6-0001, File: contrib/test_decoding/expected/prepared.out (so > prepared.sql also) > == > > COMMENT > Line 30 - The INSERT INTO test_prepared1 VALUES (2); is kind of > strange because it

Re: Two fsync related performance issues?

2020-10-06 Thread Thomas Munro
On Mon, Oct 5, 2020 at 2:38 PM Thomas Munro wrote: > On Wed, Sep 9, 2020 at 3:49 PM Thomas Munro wrote: > > For the record, Andres Freund mentioned a few problems with this > > off-list and suggested we consider calling Linux syncfs() for each top > > level directory that could potentially be on

Re: [HACKERS] Custom compression methods

2020-10-06 Thread Dilip Kumar
On Tue, Oct 6, 2020 at 10:21 PM Tomas Vondra wrote: > > On Tue, Oct 06, 2020 at 11:00:55AM +0530, Dilip Kumar wrote: > >On Mon, Oct 5, 2020 at 9:34 PM Tomas Vondra > > wrote: > >> > >> On Mon, Oct 05, 2020 at 07:57:41PM +0530, Dilip Kumar wrote: > >> >On Mon, Oct 5, 2020 at 5:53 PM Tomas Vondra >

Re: nbtpage.c:356 Expression 'metad->btm_root != P_NONE' is always false.

2020-10-06 Thread Tom Lane
=?UTF-8?B?0JDQvdGC0L7QvSDQn9Cw0YbQtdCy?= writes: > I am trying to help for Project PostgreSQL. Check source code PostgreSQL by > PVS-Studio. > PVS-Studio have many issue, but some issue is interesting. > nbtpage.c:356 *High* V547 >

nbtpage.c:356 Expression 'metad->btm_root != P_NONE' is always false.

2020-10-06 Thread Антон Пацев
Hello! I am trying to help for Project PostgreSQL. Check source code PostgreSQL by PVS-Studio. PVS-Studio have many issue, but some issue is interesting. nbtpage.c:356 *High* V547 Expression 'metad->btm_root != 0

Re: Use standard SIGHUP and SIGTERM handlers in autoprewarm module

2020-10-06 Thread Bharath Rupireddy
On Tue, Oct 6, 2020 at 11:41 AM Bharath Rupireddy wrote: > > On Tue, Oct 6, 2020 at 11:20 AM Fujii Masao > wrote: > > > > +1 Or it's also ok to make each patch separately. > > Anyway, thanks! > > > > Thanks. +1 to have separate patches. I will post two separate patches > for autoprewarm and WalR

Re: Recent failures on buildfarm member hornet

2020-10-06 Thread Noah Misch
On Tue, Oct 06, 2020 at 09:56:49PM -0400, Tom Lane wrote: > Noah Misch writes: > > On Mon, Oct 05, 2020 at 08:42:15PM -0400, Tom Lane wrote: > >> hornet has failed its last five runs with > >> TRAP: FailedAssertion("variadicArgType != InvalidOid", File: > >> "pg_aggregate.c", Line: 216, PID: 3473

Re: Recent failures on buildfarm member hornet

2020-10-06 Thread Tom Lane
Noah Misch writes: > On Mon, Oct 05, 2020 at 08:42:15PM -0400, Tom Lane wrote: >> hornet has failed its last five runs with >> TRAP: FailedAssertion("variadicArgType != InvalidOid", File: >> "pg_aggregate.c", Line: 216, PID: 34734498) > Building the tree with -O0 suppresses the problem. (xlc do

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

2020-10-06 Thread Bruce Momjian
On Wed, Oct 7, 2020 at 10:42:49AM +0900, Michael Paquier wrote: > On Tue, Oct 06, 2020 at 09:22:29AM -0400, Bruce Momjian wrote: > > I propose moving the pg_stat_statements queryid hash code into the > > server (with a version number), and also adding a postgresql.conf > > variable that lets you c

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Michael Paquier
On Tue, Oct 06, 2020 at 11:22:11AM -0400, Bruce Momjian wrote: > On Tue, Oct 6, 2020 at 11:06:13AM -0400, Tom Lane wrote: >> OK. FWIW, I'd vote for separate --no-instructions and --no-scripts >> switches. > > Works for me. +1. -- Michael signature.asc Description: PGP signature

Re: Recent failures on buildfarm member hornet

2020-10-06 Thread Noah Misch
On Mon, Oct 05, 2020 at 08:42:15PM -0400, Tom Lane wrote: > hornet has failed its last five runs with > > 2020-10-05 22:45:42.784 UTC [34734498:40] pg_regress/create_aggregate LOG: > statement: create aggregate my_percentile_disc(float8 ORDER BY anyelement) ( > stype = internal, >

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

2020-10-06 Thread Michael Paquier
On Tue, Oct 06, 2020 at 09:22:29AM -0400, Bruce Momjian wrote: > I propose moving the pg_stat_statements queryid hash code into the > server (with a version number), and also adding a postgresql.conf > variable that lets you control how detailed the queryid hash is > computed. This addresses the p

Re: WIP: WAL prefetch (another approach)

2020-10-06 Thread Tomas Vondra
On Thu, Sep 24, 2020 at 11:38:45AM +1200, Thomas Munro wrote: On Wed, Sep 9, 2020 at 11:16 AM Tomas Vondra wrote: OK, thanks for looking into this. I guess I'll wait for an updated patch before testing this further. The storage has limited capacity so I'd have to either reduce the amount of dat

Re: Parallel INSERT (INTO ... SELECT ...)

2020-10-06 Thread Greg Nancarrow
On Wed, Oct 7, 2020 at 12:40 AM Bharath Rupireddy wrote: > > In parallel, we are not doing anything(due to the same reason > explained in above comment) to find whether there is a foreign > partition or not while deciding to go with parallel/non-parallel copy, > we are just throwing an error durin

Re: [doc] clarify behaviour of pg_dump's -t/--table option with non-tables

2020-10-06 Thread Ian Lawrence Barwick
2020年10月6日(火) 22:48 Magnus Hagander : > > On Tue, Oct 6, 2020 at 3:45 PM Ian Lawrence Barwick wrote: >> >> 2020年10月6日(火) 21:58 Ian Lawrence Barwick : >> > >> > Hi >> > >> > Recently I ran into a case where someone was wondering why it was not >> > possible to dump the contents of a view, even thou

Re: [HACKERS] logical decoding of two-phase transactions

2020-10-06 Thread Peter Smith
Hello Ajin. I have gone through the v6 patch changes and have a list of review comments below. Apologies for the length of this email - I know that many of the following comments are trivial, but I figured I should either just ignore everything cosmetic, or list everything regardless. I chose the

Re: pg_dump bug for extension owned tables

2020-10-06 Thread Tom Lane
Andrew Dunstan writes: > Thanks, Committed. Further investigation shows this was introduced in > release 12, so that's how far back I went. Still further investigation shows that this patch caused bug #16655 [1]. It should *not* have been designed to unconditionally clear the table's "interesting

Re: pg_upgrade analyze script

2020-10-06 Thread Bruce Momjian
On Tue, Oct 6, 2020 at 10:40:30PM +0200, Magnus Hagander wrote: > I think that's information that belongs in the documentation, for those that > case. I'm willing to bet that the large majority of the people who run the > script never read that, and certainly don't cancel it. Those that need it to

Re: pg_upgrade dead code for pre-8.4 versions

2020-10-06 Thread Magnus Hagander
On Tue, Oct 6, 2020 at 8:45 PM Bruce Momjian wrote: > On Tue, Oct 6, 2020 at 11:40:57AM +0200, Daniel Gustafsson wrote: > > > On 6 Oct 2020, at 11:27, Magnus Hagander wrote: > > > > > ISTM that code could be cleaned out, because it should be dead based > on the initial check that we are upgradi

Re: pg_upgrade analyze script

2020-10-06 Thread Magnus Hagander
On Tue, Oct 6, 2020 at 9:05 PM Bruce Momjian wrote: > On Tue, Oct 6, 2020 at 11:43:01AM +0200, Magnus Hagander wrote: > > For a long time now, pg_upgrade drops a script (analyze_new_cluster.sh) > that > > just calls vacuumdb to run the analyze in stages. This script made a lot > of > > sense bac

Re: Add primary keys to system catalogs

2020-10-06 Thread Andres Freund
Hi, On 2020-10-06 15:31:16 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2020-10-03 08:40:31 +0200, Peter Eisentraut wrote: > >> Since we have ADD PRIMARY KEY USING INDEX, we can declare a primary key for > >> an existing index. So this doesn't have to affect the low-level early > >> boo

Re: Add primary keys to system catalogs

2020-10-06 Thread Tom Lane
Andres Freund writes: > On 2020-10-03 08:40:31 +0200, Peter Eisentraut wrote: >> Since we have ADD PRIMARY KEY USING INDEX, we can declare a primary key for >> an existing index. So this doesn't have to affect the low-level early >> bootstrapping. The attached patch adds those commands manually.

Re: pg_upgrade analyze script

2020-10-06 Thread Bruce Momjian
On Tue, Oct 6, 2020 at 11:43:01AM +0200, Magnus Hagander wrote: > For a long time now, pg_upgrade drops a script (analyze_new_cluster.sh) that > just calls vacuumdb to run the analyze in stages. This script made a lot of > sense back when it actually implemented the stages, but these days since it

Re: pg_upgrade dead code for pre-8.4 versions

2020-10-06 Thread Bruce Momjian
On Tue, Oct 6, 2020 at 11:40:57AM +0200, Daniel Gustafsson wrote: > > On 6 Oct 2020, at 11:27, Magnus Hagander wrote: > > > ISTM that code could be cleaned out, because it should be dead based on the > > initial check that we are upgrading from 8.4 or later? > > +1. Commit 2209b3923a7afe0b re

Re: Add primary keys to system catalogs

2020-10-06 Thread Andres Freund
Hi, On 2020-10-03 08:40:31 +0200, Peter Eisentraut wrote: > Since we have ADD PRIMARY KEY USING INDEX, we can declare a primary key for > an existing index. So this doesn't have to affect the low-level early > bootstrapping. The attached patch adds those commands manually. Another > option might

Re: A modest proposal: let's add PID to assertion failure messages

2020-10-06 Thread Andres Freund
On 2020-10-05 10:20:01 +1300, Thomas Munro wrote: > On Mon, Oct 5, 2020 at 10:08 AM Tom Lane wrote: > > In these days when we run almost all test cases in parallel, it's > > frequently not that easy to tie a "TRAP: ..." message in the log > > to nearby log messages. (The postmaster's subsequent c

Re: [PATCH] Automatic HASH and LIST partition creation

2020-10-06 Thread Anastasia Lubennikova
On 06.10.2020 00:21, Pavel Borisov wrote: Hi, hackers! I added some extra tests for different cases of use of automatic partition creation. v3-0002 can be applied on top of the original v2 patch for correct work with some corner cases with constraints included in this test. Thank you for the

Re: [HACKERS] Custom compression methods

2020-10-06 Thread Tomas Vondra
On Tue, Oct 06, 2020 at 11:00:55AM +0530, Dilip Kumar wrote: On Mon, Oct 5, 2020 at 9:34 PM Tomas Vondra wrote: On Mon, Oct 05, 2020 at 07:57:41PM +0530, Dilip Kumar wrote: >On Mon, Oct 5, 2020 at 5:53 PM Tomas Vondra > wrote: >> >> On Mon, Oct 05, 2020 at 11:17:28AM +0530, Dilip Kumar wrote:

Re: Partitionwise join fails under GEQO

2020-10-06 Thread Tom Lane
Ashutosh Bapat writes: > On Mon, Oct 5, 2020 at 11:59 PM Tom Lane wrote: >> ... we could avoid the growth in eclass members for large partition sets >> if we simply didn't store child eclass members, instead translating >> on-the-fly when we need to deal with child rels. I have a patch >> about

Re: Yet another fast GiST build

2020-10-06 Thread Pavel Borisov
It became normal with -fsanitize=signed-integer-overflow,null,alignment instead of -fsanitize=undefined (which is strictly a 'default' list of needed and unnecessary things to check, can be overridden anyway but needed some reading for it) Thanks! -- Best regards, Pavel Borisov Postgres Profess

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Bruce Momjian
On Tue, Oct 6, 2020 at 11:06:13AM -0400, Tom Lane wrote: > Magnus Hagander writes: > > On Tue, Oct 6, 2020 at 4:31 PM Tom Lane wrote: > >> Hm, does it matter? I think those wrappers send the output to /dev/null > >> anyway. > > > The debian ones don't, because they consider it useful informati

Re: Index Skip Scan (new UniqueKeys)

2020-10-06 Thread Dmitry Dolgov
> On Mon, Sep 21, 2020 at 05:59:32PM -0700, Peter Geoghegan wrote: > > * I see the following compiler warning: > > /code/postgresql/patch/build/../source/src/backend/optimizer/path/uniquekeys.c: > In function ‘populate_baserel_uniquekeys’: > /code/postgresql/patch/build/../source/src/backend/optimi

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Tom Lane
Magnus Hagander writes: > On Tue, Oct 6, 2020 at 4:31 PM Tom Lane wrote: >> Hm, does it matter? I think those wrappers send the output to /dev/null >> anyway. > The debian ones don't, because they consider it useful information to the > user. I'd say that it is, especially in the case of pg_upg

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Magnus Hagander
On Tue, Oct 6, 2020 at 4:31 PM Tom Lane wrote: > Magnus Hagander writes: > > The use case for this is for example the debian or redhat package > wrappers. > > When these commands are run under those wrappers the printed instructions > > are *wrong*. It's better in that case to exclude them, and

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Tom Lane
Magnus Hagander writes: > The use case for this is for example the debian or redhat package wrappers. > When these commands are run under those wrappers the printed instructions > are *wrong*. It's better in that case to exclude them, and let the wrapper > be responsible for printing the correct i

Re: Yet another fast GiST build

2020-10-06 Thread Tom Lane
Heikki Linnakangas writes: > You get the same error with: > select (float8 '1e+300')::float4; > float.c:1204:11: runtime error: 1e+300 is outside the range of > representable values of type 'float' > SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior float.c:1204:11 in > It boils down to ca

Re: Transactions involving multiple postgres foreign servers, take 2

2020-10-06 Thread Masahiko Sawada
On Fri, 2 Oct 2020 at 18:20, tsunakawa.ta...@fujitsu.com wrote: > > From: Masahiko Sawada > > You proposed the first idea > > to avoid such a situation that FDW implementor can write the code > > while trying to reduce the possibility of errors happening as much as > > possible, for example by us

Re: [doc] clarify behaviour of pg_dump's -t/--table option with non-tables

2020-10-06 Thread Magnus Hagander
On Tue, Oct 6, 2020 at 3:45 PM Ian Lawrence Barwick wrote: > 2020年10月6日(火) 21:58 Ian Lawrence Barwick : > > > > Hi > > > > Recently I ran into a case where someone was wondering why it was not > > possible to dump the contents of a view, even though the documentation > [1] > > seems to imply this

Re: [doc] clarify behaviour of pg_dump's -t/--table option with non-tables

2020-10-06 Thread Magnus Hagander
On Tue, Oct 6, 2020 at 2:59 PM Ian Lawrence Barwick wrote: > Hi > > Recently I ran into a case where someone was wondering why it was not > possible to dump the contents of a view, even though the documentation [1] > seems to imply this is possible. > > Currently it says: > > Dump only tables w

Re: [doc] clarify behaviour of pg_dump's -t/--table option with non-tables

2020-10-06 Thread Ian Lawrence Barwick
2020年10月6日(火) 21:58 Ian Lawrence Barwick : > > Hi > > Recently I ran into a case where someone was wondering why it was not > possible to dump the contents of a view, even though the documentation [1] > seems to imply this is possible. > > Currently it says: > > Dump only tables with names matchi

Re: Parallel INSERT (INTO ... SELECT ...)

2020-10-06 Thread Bharath Rupireddy
On Tue, Oct 6, 2020 at 4:13 PM Greg Nancarrow wrote: > > On Tue, Oct 6, 2020 at 9:10 PM Bharath Rupireddy > wrote: > > > But the problem may arise if a partitioned table has foreign table as > > a partition, I think we can not allow parallelism for this case too, > > but it's hard to determine ah

Re: enable_incremental_sort changes query behavior

2020-10-06 Thread James Coleman
On Tue, Oct 6, 2020 at 9:28 AM Jaime Casanova wrote: > Can you please create an entry in the commitfest for this one so we > don't lose track of it? Done.

Re: enable_incremental_sort changes query behavior

2020-10-06 Thread Jaime Casanova
On Tue, 6 Oct 2020 at 06:46, James Coleman wrote: > > > All right, here's a modified patch. I did a bit of surgery: the > > concept is the same, but I decided to explicitly not the parallels to > > (and follow as possible) prepare_sort_from_pathkeys(). That means we > > only have to do the express

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

2020-10-06 Thread Bruce Momjian
On Tue, Oct 6, 2020 at 02:34:58PM +0900, Michael Paquier wrote: > On Mon, Oct 05, 2020 at 11:23:50PM -0400, Bruce Momjian wrote: > > On Tue, Oct 6, 2020 at 11:11:27AM +0800, Julien Rouhaud wrote: > >> Maybe we could add a new hook for only queryid computation, and add a > >> GUC to let people cho

Re: Yet another fast GiST build

2020-10-06 Thread Heikki Linnakangas
On 06/10/2020 14:05, Pavel Borisov wrote: I've been making tests with memory sanitizer Thanks! and got one another error in regression test create_index: CREATE INDEX gpointind ON point_tbl USING gist (f1); server closed the connection unexpectedly with logfile: gistproc.c:1714:28: runtime

Re: Logical Replication - detail message with names of missing columns

2020-10-06 Thread Bharath Rupireddy
On Tue, Oct 6, 2020 at 5:24 PM Amit Kapila wrote: > > On Tue, Oct 6, 2020 at 12:14 PM Bharath Rupireddy > wrote: > > > > On Mon, Oct 5, 2020 at 9:39 AM Amit Kapila wrote: > > > > > > > > > 3. The patch doesn't seem to be freeing the memory allocated for > > > missingattsbuf. > > > > > > > I don

[doc] clarify behaviour of pg_dump's -t/--table option with non-tables

2020-10-06 Thread Ian Lawrence Barwick
Hi Recently I ran into a case where someone was wondering why it was not possible to dump the contents of a view, even though the documentation [1] seems to imply this is possible. Currently it says: Dump only tables with names matching pattern. For this purpose, "table" includes views, mate

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Magnus Hagander
On Tue, Oct 6, 2020 at 1:49 PM Ian Lawrence Barwick wrote: > 2020年10月6日(火) 19:26 Magnus Hagander : > > > > The attached patch adds a switch --no-instructions to initdb and > pg_upgrade, which prevents them from printing instructions about how to > start the cluster (initdb) or how to analyze and

Re: [doc] remove reference to pg_dump pre-8.1 switch behaviour

2020-10-06 Thread Ian Lawrence Barwick
2020年10月6日(火) 21:13 Ian Lawrence Barwick : > > Hi > > The pg_dump doc page [1], under the -t/--table option, contains a Note > documenting the behavioural differences introduced in PostgreSQL 8.2. > > As it's been almost exactly 14 years since that note was added [2], I suggest > it can be removed

[doc] remove reference to pg_dump pre-8.1 switch behaviour

2020-10-06 Thread Ian Lawrence Barwick
Hi The pg_dump doc page [1], under the -t/--table option, contains a Note documenting the behavioural differences introduced in PostgreSQL 8.2. As it's been almost exactly 14 years since that note was added [2], I suggest it can be removed entirely. [1] https://www.postgresql.org/docs/current/ap

Re: Logical Replication - detail message with names of missing columns

2020-10-06 Thread Amit Kapila
On Tue, Oct 6, 2020 at 12:14 PM Bharath Rupireddy wrote: > > On Mon, Oct 5, 2020 at 9:39 AM Amit Kapila wrote: > > > > > > 3. The patch doesn't seem to be freeing the memory allocated for > > missingattsbuf. > > > > I don't think we need to do that. We are passing missingattsbuf.data to > erepo

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Ian Lawrence Barwick
2020年10月6日(火) 19:26 Magnus Hagander : > > The attached patch adds a switch --no-instructions to initdb and pg_upgrade, > which prevents them from printing instructions about how to start the cluster > (initdb) or how to analyze and delete clusters (pg_upgrade). > > The use case for this is for ex

Re: enable_incremental_sort changes query behavior

2020-10-06 Thread James Coleman
On Mon, Oct 5, 2020 at 10:38 PM James Coleman wrote: > > On Mon, Oct 5, 2020 at 11:33 AM James Coleman wrote: > > > > On Sun, Oct 4, 2020 at 9:40 PM James Coleman wrote: > > > > > > On Sat, Oct 3, 2020 at 10:10 PM James Coleman wrote: > > > > > > > > On Sat, Oct 3, 2020 at 5:44 PM Tomas Vondra

Re: Partitionwise join fails under GEQO

2020-10-06 Thread Ashutosh Bapat
On Mon, Oct 5, 2020 at 11:59 PM Tom Lane wrote: > > Ashutosh Bapat writes: > > On Mon, Oct 5, 2020 at 6:47 AM Tom Lane wrote: > >> Now that I've seen this, I wonder whether add_child_join_rel_equivalences > >> might not be making duplicate EC entries even without GEQO. Is there any > >> guarant

Re: Yet another fast GiST build

2020-10-06 Thread Pavel Borisov
I've been making tests with memory sanitizer and got one another error in regression test create_index: CREATE INDEX gpointind ON point_tbl USING gist (f1); server closed the connection unexpectedly with logfile: gistproc.c:1714:28: runtime error: 1e+300 is outside the range of representable value

Re: Parallel INSERT (INTO ... SELECT ...)

2020-10-06 Thread Greg Nancarrow
On Tue, Oct 6, 2020 at 9:10 PM Bharath Rupireddy wrote: > But the problem may arise if a partitioned table has foreign table as > a partition, I think we can not allow parallelism for this case too, > but it's hard to determine ahead of time whether a table has a foreign > partition.(See [1] in c

Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Magnus Hagander
The attached patch adds a switch --no-instructions to initdb and pg_upgrade, which prevents them from printing instructions about how to start the cluster (initdb) or how to analyze and delete clusters (pg_upgrade). The use case for this is for example the debian or redhat package wrappers. When t

Re: Parallel INSERT (INTO ... SELECT ...)

2020-10-06 Thread Bharath Rupireddy
On Tue, Oct 6, 2020 at 3:08 PM Greg Nancarrow wrote: > > I have not found issues with partition tables (yet) or toast column values. > I think for toast column values there may not be a problem as each parallel worker inserts toast column values individually. But the problem may arise if a parti

RE: [PoC] Non-volatile WAL buffer

2020-10-06 Thread Takashi Menjo
Hi Gang, I have tried to but yet cannot reproduce performance degrade you reported when inserting 328-byte records. So I think the condition of you and me would be different, such as steps to reproduce, postgresql.conf, installation setup, and so on. My results and condition are as follows. Ma

pg_upgrade analyze script

2020-10-06 Thread Magnus Hagander
For a long time now, pg_upgrade drops a script (analyze_new_cluster.sh) that just calls vacuumdb to run the analyze in stages. This script made a lot of sense back when it actually implemented the stages, but these days since it's just calling a single command, I think it's just unnecessary complic

Re: pg_upgrade dead code for pre-8.4 versions

2020-10-06 Thread Daniel Gustafsson
> On 6 Oct 2020, at 11:27, Magnus Hagander wrote: > ISTM that code could be cleaned out, because it should be dead based on the > initial check that we are upgrading from 8.4 or later? +1. Commit 2209b3923a7afe0b removed support for 8.3 so anything left checking for pre-8.4 should be removed a

Re: Parallel INSERT (INTO ... SELECT ...)

2020-10-06 Thread Greg Nancarrow
On Mon, Oct 5, 2020 at 10:36 PM Dilip Kumar wrote: > > > > I have one question which is common to both this patch and parallel > > > inserts in CTAS[1], do we need to skip creating tuple > > > queues(ExecParallelSetupTupleQueues) as we don't have any tuples > > > that's being shared from workers t

Re: Add session statistics to pg_stat_database

2020-10-06 Thread Masahiro Ikeda
On 2020-09-05 00:50, Laurenz Albe wrote: I have changed the code so that connections are counted immediately. Attached is a new version. Thanks for making a patch. I'm interested in this feature. I think to add the number of login failures is good for security. Although we can see the event fr

pg_upgrade dead code for pre-8.4 versions

2020-10-06 Thread Magnus Hagander
pg_upgrade documentation says it supports upgrades from 8.4 and newer. But there is code in there that makes a check and differs pre-8.4 from 8.4-or-newer. ISTM that code could be cleaned out, because it should be dead based on the initial check that we are upgrading from 8.4 or later? This appe

Re: Resetting spilled txn statistics in pg_stat_replication

2020-10-06 Thread Amit Kapila
On Tue, Oct 6, 2020 at 9:34 AM Masahiko Sawada wrote: > > Looking at pgstat_reset_replslot_counter() in the v8 patch, even if we > pass a physical slot name to pg_stat_reset_replication_slot() a > PgStat_MsgResetreplslotcounter is sent to the stats collector. I’m > okay with not raising an error b

RE: extension patch of CREATE OR REPLACE TRIGGER

2020-10-06 Thread osumi.takami...@fujitsu.com
Hi I spent too much time to respond to this e-mail. Sorry. Actually, I got stuck to deal with achieving both error detection of internal trigger case and pending trigger case. > * I'm concerned by the fact that there doesn't seem to be any defense against > somebody replacing a foreign-key trigg

Re: Add primary keys to system catalogs

2020-10-06 Thread Craig Ringer
On Sun, 4 Oct 2020, 01:32 John Naylor, wrote: > > On Sat, Oct 3, 2020 at 9:27 AM Craig Ringer > wrote: > > So a big +1 from me for the idea. Especially if we ensure psql > recognises when the relation 'oid' attribute has a declared PK and includes > it in the column list. > > Oid has been in the

Is the doc for SHOW somewhat stale?

2020-10-06 Thread Kyotaro Horiguchi
Hello. If I read the documentation of the SHOW command, it says: https://www.postgresql.org/docs/13/sql-show.html > name > The name of a run-time parameter. Available parameters are documented > in Chapter 19 and on the SET reference page. In addition, there are a > few parameters that ca