Re: Excessive memory usage in multi-statement queries w/ partitioning

2019-05-26 Thread Amit Langote
On 2019/05/24 23:28, Tom Lane wrote: > So my thought, if we want to do something about this, is not "find > some things we can pfree at the end of planning" but "find a way > to use a separate context for each statement in the query string". > Maybe multi-query strings could be handled by setting

RE: Why does not subquery pruning conditions inherit to parent query?

2019-05-26 Thread Kato, Sho
Friday, May 24, 2019 5:10 PM, David Rowley wrote: > The planner can only push quals down into a subquery, it cannot pull quals > from a subquery into the outer query. > > If you write the query like: > > explain select * from jta, (select a, max(b) from jtb group by a ) c1 > where jta.a = c1.a

Re: [HACKERS] WAL logging problem in 9.4.3?

2019-05-26 Thread Kyotaro HORIGUCHI
Thanks for the comment! At Fri, 24 May 2019 19:33:32 -0700, Noah Misch wrote in <20190525023332.ge1624...@rfd.leadboat.com> > On Mon, May 20, 2019 at 03:54:30PM +0900, Kyotaro HORIGUCHI wrote: > > Following this direction, the attached PoC works *at least for* > > the wal_optimization TAP

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-26 Thread Alvaro Herrera
On 2019-May-27, Michael Paquier wrote: > On Wed, May 15, 2019 at 11:17:51AM +0900, Michael Paquier wrote: > > Perhaps something like the attached for the REINDEX portion would make > > the world a better place? What do you think? > > Alvaro, do you have extra thoughts about this patch improving

Re: docs about FKs referencing partitioned tables

2019-05-26 Thread Michael Paquier
On Thu, May 23, 2019 at 12:02:56AM -0700, Paul A Jungwirth wrote: > The section in the docs (5.10) just before the one I changed has > similar warnings: > >> Other types of constraints (unique, primary key, and foreign key >> constraints) are not inherited. > > and > >> A serious limitation of

Re: initdb recommendations

2019-05-26 Thread Michael Paquier
On Fri, May 24, 2019 at 08:23:57AM -0700, Noah Misch wrote: > Our sspi auth is a more-general version of peer auth, and it works over TCP. > It would be a simple matter of programming to support "peer" on Windows, > consisting of sspi auth with an implicit pg_ident map. I am not sure that it is

Re: [HACKERS] Unlogged tables cleanup

2019-05-26 Thread Michael Paquier
On Thu, May 23, 2019 at 09:14:59AM -0400, Robert Haas wrote: > Suppose we create an unlogged table and then crash. The main fork > makes it to disk, and the init fork does not. Before WAL replay, we > remove any main forks that have init forks, but because the init fork > was lost, that does not

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-26 Thread Michael Paquier
On Wed, May 15, 2019 at 11:17:51AM +0900, Michael Paquier wrote: > Perhaps something like the attached for the REINDEX portion would make > the world a better place? What do you think? Alvaro, do you have extra thoughts about this patch improving the error message consistency for REINDEX

Re: Why does pg_checksums -r not have a long option?

2019-05-26 Thread Michael Paquier
On Sun, May 26, 2019 at 08:35:30AM +0200, Fabien COELHO wrote: > Probably? Attached a patch. No objections with adding a long option for that stuff. But I do have an objection with the naming because we have another tool able to work on relfilenodes: $ oid2name --help | grep FILE -f,

BEFORE UPDATE trigger on postgres_fdw table not work

2019-05-26 Thread Shohei Mochizuki
Hi, I noticed returning a modified record in a row-level BEFORE UPDATE trigger on postgres_fdw foreign tables do not work. Attached patch fixes this issue. Below are scenarios similar to postgres_fdw test to reproduce the issue. postgres=# CREATE SERVER loopback FOREIGN DATA WRAPPER

Re: Confusing error message for REINDEX TABLE CONCURRENTLY

2019-05-26 Thread Michael Paquier
On Sat, May 25, 2019 at 02:42:59PM +1200, David Rowley wrote: > Also, I think people probably will care more about the fact that > nothing was done for that table rather than if the table happens to > have no indexes. For the non-concurrently case, that just happened to > be the same thing. This

Re: Fix inconsistencies for v12

2019-05-26 Thread Tom Lane
Amit Kapila writes: > On Sun, May 26, 2019 at 2:20 AM Alexander Lakhin wrote: >> 5. ExecContextForcesOids - not changed, but may be should be removed >> (orphaned after 578b2297) > Yes, we should remove the use of ExecContextForcesOids. Unless grep is failing me, ExecContextForcesOids is in

Rearranging ALTER TABLE to avoid multi-operations bugs

2019-05-26 Thread Tom Lane
We've had numerous bug reports complaining about the fact that ALTER TABLE generates subsidiary commands that get executed unconditionally, even if they should be discarded due to an IF NOT EXISTS or other condition; see e.g. #14827, #15180, #15670, #15710. In [1] I speculated about fixing this

Re: Fix inconsistencies for v12

2019-05-26 Thread Amit Kapila
On Sun, May 26, 2019 at 2:20 AM Alexander Lakhin wrote: > > Hello hackers, > > Please also consider fixing the following inconsistencies found in new > v12 code: > > 1. AT_AddOids - remove (orphaned after 578b2297) > 2. BeingModified ->TM_BeingModified (for consistency) > /* - * A tuple is

Re: Fix typos for v12

2019-05-26 Thread David Fetter
On Sun, May 26, 2019 at 06:43:41PM +0300, Alexander Lakhin wrote: > 26.05.2019 16:49, Amit Kapila wrote: > > This occurred to me as well while reviewing, but I thought typo fixes > > should be fine. Anyway, I have excluded those before pushing. So, if > > we want to fix these, then maybe one has

Different row estimations on base rels

2019-05-26 Thread Donald Dong
Hi, I noticed the estimated rows of the base relations during the join searching is *very* different from the estimations in the final plan. Join search (rows of the initial_rels): RELOPTINFO (ct): rows=1 width=4 RELOPTINFO (it): rows=1 width=4 RELOPTINFO (mc): rows=17567 width=32 RELOPTINFO

Re: Fix typos for v12

2019-05-26 Thread Alexander Lakhin
26.05.2019 16:49, Amit Kapila wrote: > This occurred to me as well while reviewing, but I thought typo fixes > should be fine. Anyway, I have excluded those before pushing. So, if > we want to fix these, then maybe one has to first get this fixed in > upstream first and then take from there. >

Re: GSoD Introductory Resources and Tutorial Projects

2019-05-26 Thread sharon clark
Hello Stephen, Thank you for the information. I'll be in touch. Best wishes, Sharon Get Outlook for Android From: Stephen Frost Sent: Sunday, May 26, 2019 7:33:25 AM To: sharon clark Cc: pgsql-hackers@lists.postgresql.org Subject: Re:

Re: This seems like very unfriendly behaviour

2019-05-26 Thread Andres Freund
Hi, On May 26, 2019 9:49:49 AM EDT, Dave Cramer wrote: >On Sun, 26 May 2019 at 01:40, Jaime Casanova > >wrote: > >> On Sat, 25 May 2019 at 08:35, Dave Cramer >wrote: >> > >> > How do I get rid of this slot ? >> > >> > select pg_drop_replication_slot('mysub'); >> > ERROR: replication slot

Re: GSoD Introductory Resources and Tutorial Projects

2019-05-26 Thread Stephen Frost
Greetings, * sharon clark (sc...@hotmail.com) wrote: > I plan to submit a proposal for both the PostgreSQL Introductory Resources > and Tutorial projects, but I’m open to learning technologies for ANY other > projects listed. Please feel free to contact me with any questions. Thanks for

Re: Fix typos for v12

2019-05-26 Thread Amit Kapila
On Sat, May 25, 2019 at 8:36 PM Tom Lane wrote: > > Amit Kapila writes: > > I have taken one pass over it and all fixes seem to be correct and got > > introduced in v12. I will re-verify them once again and then commit > > your patch if I don't found any problem. In the meantime, if anyone > >

Re: This seems like very unfriendly behaviour

2019-05-26 Thread Dave Cramer
On Sun, 26 May 2019 at 01:40, Jaime Casanova wrote: > On Sat, 25 May 2019 at 08:35, Dave Cramer wrote: > > > > How do I get rid of this slot ? > > > > select pg_drop_replication_slot('mysub'); > > ERROR: replication slot "mysub" is active for PID 13065 > > test_database=# select * from

vacuumdb as server application in v12 release note

2019-05-26 Thread Tatsuo Ishii
In the v12 beta1 release note: E.1.3.9. Server Applications Allow vacuumdb to select tables for vacuum based on... Why is vacuumdb listed in "Server Applications"? It's in "PostgreSQL Client Applications" section in our manual. Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English:

Re: Read-only access to temp tables for 2PC transactions

2019-05-26 Thread Simon Riggs
On Fri, 24 May 2019 at 18:09, Andres Freund wrote: > Hi, > > On 2019-05-24 19:37:15 +0300, Konstantin Knizhnik wrote: > > From my point of view releasing all temporary table locks after > preparing of > > 2PC transaction is not technically possible: > > assume that this transaction has updated

Re: [HACKERS] Small fix: avoid passing null pointers to memcpy()

2019-05-26 Thread didier
Hi, On Fri, May 24, 2019 at 6:35 PM Tom Lane wrote: > These seem to be down to use of AnyArrayType: > > typedef union AnyArrayType > { > ArrayType flt; > ExpandedArrayHeader xpn; > } AnyArrayType; > > ASAN seems to believe that use of this union entitles the compiler to >

Re: Why does pg_checksums -r not have a long option?

2019-05-26 Thread Fabien COELHO
Subject: Why does pg_checksums -r not have a long option? Was this just forgotten? Probably? Attached a patch. -- Fabien.diff --git a/doc/src/sgml/ref/pg_checksums.sgml b/doc/src/sgml/ref/pg_checksums.sgml index a0ffeb0ab0..5549ea679a 100644 --- a/doc/src/sgml/ref/pg_checksums.sgml +++

Why does pg_checksums -r not have a long option?

2019-05-26 Thread Peter Eisentraut
Was this just forgotten? -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services