Re: Test patch for partitionwise join with partitioned tables containing default partition

2018-07-05 Thread Rajkumar Raghuwanshi
Thanks for commit Jeff. Thanks for review Ashutosh, Thomas. commit 4513d3a4be0bb7d0141f8b7eaf669a55c08e41b0 Author: Jeff Davis Date: Thu Jul 5 18:56:12 2018 -0700 Add test for partitionwise join involving default partition. Author: Rajkumar Raghuwanshi Reviewed-by: Ashutosh Bapat

Re: using expression syntax for partition bounds

2018-07-05 Thread Amit Langote
Horiguchi-san, On 2018/07/06 14:26, Kyotaro HORIGUCHI wrote: > Hello. > > cf-bot compained on this but I wondered why it got so many > errors. At the first look I found a spare semicolon before a bare > then calause:p > >> -if (!IsA(value, Const)); >> +if (!IsA(value, Const)) >>

Re: Non-reserved replication slots and slot advancing

2018-07-05 Thread Michael Paquier
On Fri, Jul 06, 2018 at 01:07:47PM +0900, Kyotaro HORIGUCHI wrote: > Form the reasons above, I'd like to vote +1 for just ERRORing > in the case. Thanks for the lookup. Do you have a good idea for the error message to provide to users in this case? I would tend to think that "cannot move slot

Re: using expression syntax for partition bounds

2018-07-05 Thread Kyotaro HORIGUCHI
Hello. cf-bot compained on this but I wondered why it got so many errors. At the first look I found a spare semicolon before a bare then calause:p > - if (!IsA(value, Const)); > + if (!IsA(value, Const)) > elog(ERROR, "could not evaluate partition bound expression"); The

Re: [HACKERS] Replication status in logical replication

2018-07-05 Thread Michael Paquier
On Thu, Jul 05, 2018 at 05:13:27PM +0900, Michael Paquier wrote: > This concerns as well v10, so that's not actually an open item... > Well, it was an open item last year. The last set of patches is from > Simon here: >

Re: Legacy GiST invalid tuples

2018-07-05 Thread Tom Lane
Andres Freund writes: > On 2018-07-04 17:02:01 -0400, Alvaro Herrera wrote: >> On 2018-Jul-04, Andres Freund wrote: >>> I don't think we can easily require that everyone pg_upgrading to v13+ >>> upgrades to v12 first? >> We've never done that, I don't know if we can get away with it. >> Upgrades

Re: Non-reserved replication slots and slot advancing

2018-07-05 Thread Kyotaro HORIGUCHI
Hello. At Fri, 6 Jul 2018 08:16:08 +0900, Michael Paquier wrote in <20180705231608.ga2...@paquier.xyz> > On Thu, Jul 05, 2018 at 12:35:29PM -0400, Alvaro Herrera wrote: > > Do we use the term "reserved" anywhere else? It just doesn't click for > > me. Other than "All rights reserved", that is

Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.

2018-07-05 Thread Etsuro Fujita
(2018/07/05 22:04), Ashutosh Bapat wrote: On Thu, Jul 5, 2018 at 4:45 PM, Etsuro Fujita wrote: Another thing I noticed is: actually, we don't produce an Append with child Gathers in apply_scanjoin_target_to_paths, which I thought we would do that in the case of

Re: hot_standby_feedback vs excludeVacuum and snapshots

2018-07-05 Thread Thomas Munro
On Thu, Jul 5, 2018 at 8:27 AM, Noah Misch wrote: >> However, 49bff5300d527 also introduced a similar bug where subtransaction >> commit would fail to release an AccessExclusiveLock, leaving the lock to >> be removed sometimes early and sometimes late. This commit fixes >> that

Re: documentation about explicit locking

2018-07-05 Thread Amit Langote
On 2018/07/05 23:02, Robert Haas wrote: > On Wed, Jul 4, 2018 at 3:09 AM, Amit Langote > wrote: >> I wonder why we mention on the following page that CREATE COLLATION >> requires SHARE ROW EXCLUSIVE lock >> >> https://www.postgresql.org/docs/devel/static/explicit-locking.html >> >> I know that's

Re: Global shared meta cache

2018-07-05 Thread Amit Langote
On 2018/07/05 23:00, Robert Haas wrote: > With respect to partitioning specifically, it seems like we might be > able to come up with some way of planning that doesn't need a full > relcache entry for every partition, particularly if there are no > partition-local objects (indexes, triggers,

Re: documentation fixes for partition pruning, round three

2018-07-05 Thread Amit Langote
On 2018/07/06 6:55, David Rowley wrote: > On 6 July 2018 at 09:41, Alvaro Herrera wrote: >> On 2018-Jul-05, Peter Eisentraut wrote: >>> Committed. >> >> Thanks for handling this. >> >> Should we do this in REL_11_STABLE too? I vote yes. > > Sorry for now paying much attention to this, but I've

Re: [HACKERS] Optional message to user when terminating/cancelling backend

2018-07-05 Thread Michael Paquier
On Fri, Jul 06, 2018 at 12:18:02PM +1200, Thomas Munro wrote: > 6118 --select pg_cancel_backend(pg_backend_pid(), 'it brings on many > changes'); > 6119 select pg_cancel_backend(pg_backend_pid(), NULL); > 6120! ERROR: canceling statement due to user request > 6121--- 25,32 > 6122 > 6123

Re: Should contrib modules install .h files?

2018-07-05 Thread Michael Paquier
On Wed, Jul 04, 2018 at 05:00:56PM -0400, Tom Lane wrote: > Andrew Gierth writes: >> This installs to $(includedir_server)/$(MODULEDIR)/$MODULE/file.h >> (e.g. include/server/extension/hstore/hstore.h for an actual example), >> and errors if HEADERS_xxx is defined for anything that's not a module

RE: Global shared meta cache

2018-07-05 Thread Ideriha, Takeshi
>-Original Message- >From: se...@rielau.com [mailto:se...@rielau.com] >Sent: Wednesday, June 27, 2018 2:04 AM >To: Ideriha, Takeshi/出利葉 健 ; pgsql-hackers > >Subject: RE: Global shared meta cache > >Takeshi-san, > > >>My customer created hundreds of thousands of partition tables and tried

Re: Why B-Tree suffix truncation matters

2018-07-05 Thread Peter Geoghegan
On Thu, Jul 5, 2018 at 7:17 AM, Andrey Borodin wrote: > Some years ago I've observed viable performance improvement (around 8% in > inserts and 5% in selects) of covering indexes in a series of experiments [0]. Covering indexes are definitely a closely related idea. It kind of makes sense that

Re: Copy function for logical replication slots

2018-07-05 Thread Michael Paquier
On Thu, Jul 05, 2018 at 05:24:48PM +0900, Masahiko Sawada wrote: > Yes, you're right. To guarantee that restart LSN of copied slot is > available, it seems to me that it's better to copy new slot while > holding the origin slot as you mentioned before. Since the replication > slot creation code

Re: [HACKERS] Optional message to user when terminating/cancelling backend

2018-07-05 Thread Thomas Munro
On Fri, Jun 15, 2018 at 9:56 AM, Daniel Gustafsson wrote: > attached Hi Daniel, 6118 --select pg_cancel_backend(pg_backend_pid(), 'it brings on many changes'); 6119 select pg_cancel_backend(pg_backend_pid(), NULL); 6120! ERROR: canceling statement due to user request 6121--- 25,32 6122

Re: Desirability of client-side expressions in psql?

2018-07-05 Thread Andrew Dunstan
On Tue, Jul 3, 2018 at 8:43 AM, Ashutosh Bapat wrote: > On Mon, Jun 25, 2018 at 1:29 AM, Fabien COELHO wrote: >> >> I do not mind spending some time for elegance, but I mind spending time for >> nothing. >> >> I hope some committers will also express their views about the feature. >> > > There's

Re: Non-reserved replication slots and slot advancing

2018-07-05 Thread Michael Paquier
On Thu, Jul 05, 2018 at 12:35:29PM -0400, Alvaro Herrera wrote: > Do we use the term "reserved" anywhere else? It just doesn't click for > me. Other than "All rights reserved", that is ... This is used in a couple of places in the docs: $ git grep -i slot | grep reserved src/sgml/catalogs.sgml:

Re: documentation fixes for partition pruning, round three

2018-07-05 Thread David Rowley
On 6 July 2018 at 09:41, Alvaro Herrera wrote: > On 2018-Jul-05, Peter Eisentraut wrote: >> Committed. > > Thanks for handling this. > > Should we do this in REL_11_STABLE too? I vote yes. Sorry for now paying much attention to this, but I've read through what's been committed and I also think

Re: patch to allow disable of WAL recycling

2018-07-05 Thread Thomas Munro
On Fri, Jul 6, 2018 at 3:37 AM, Jerry Jelinek wrote: >> If the problem is specifically the file system caching behavior, then we >> could also consider using the dreaded posix_fadvise(). > > I'm not sure that solves the problem for non-cached files, which is where > we've observed the performance

Re: documentation fixes for partition pruning, round three

2018-07-05 Thread Alvaro Herrera
On 2018-Jul-05, Peter Eisentraut wrote: > On 01.06.18 23:33, Justin Pryzby wrote: > >>> - should we find a unified term for "inheritence-based partitioning" and > >>> avoid > >>>using the word "partitioning" in that context? For example: > >>> "Partitioning > >>>can be implemented

Re: patch to allow disable of WAL recycling

2018-07-05 Thread Andres Freund
Hi, On 2018-06-26 07:35:57 -0600, Jerry Jelinek wrote: > + > + wal_recycle (boolean) > + > + wal_recycle configuration > parameter > + > + > + > + > +When this parameter is on, past log file segments > +in the pg_wal directory are

Re: make installcheck-world in a clean environment

2018-07-05 Thread Peter Eisentraut
Exactly what order of steps are you executing that doesn't work? -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: patch to allow disable of WAL recycling

2018-07-05 Thread Peter Eisentraut
On 05.07.18 17:37, Jerry Jelinek wrote: > Your patch describes this feature as a performance feature.  We would > need to see more measurements about what this would do on other > platforms and file systems than your particular one.  Also, we need to > be careful with user options

Re: documentation fixes for partition pruning, round three

2018-07-05 Thread Peter Eisentraut
On 01.06.18 23:33, Justin Pryzby wrote: >>> - should we find a unified term for "inheritence-based partitioning" and >>> avoid >>>using the word "partitioning" in that context? For example: >>> "Partitioning >>>can be implemented using table inheritance[...]". One possible phrase >>>

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-07-05 Thread David Rowley
On 6 July 2018 at 01:18, Jesper Pedersen wrote: > With 0002 INSERTs get close to the TPS of the non-partitioned case. However, > UPDATEs doesn't see the same speedup. But, as you said, a discussion for > another thread. Hi Jesper, Thanks for testing this out. It was only really the locking I

Re: pgsql: Fix "base" snapshot handling in logical decoding

2018-07-05 Thread Alvaro Herrera
Thanks for the detective work! I pushed this test change. (I still don't quite understand what you mean with the freezing part, though.) -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: Listing triggers in partitions (was Re: Remove mention in docs that foreign keys on partitioned tables)

2018-07-05 Thread Robert Haas
On Fri, Jun 29, 2018 at 12:06 PM, Alvaro Herrera wrote: > Okay, pushed that way. > > We can redo this if/when we add support for cloning BEFORE row triggers, > which are going to need the trigger link info, I suspect. Yeah, having an explicit representation seems less likely to be fragile.

Re: mxid_age() and age(xid) appear undocumented

2018-07-05 Thread Peter Geoghegan
On Thu, Jul 5, 2018 at 12:36 PM, Robert Haas wrote: > On Sun, Jul 1, 2018 at 11:18 PM, David Rowley > wrote: >> I see d692308cf494f6126 mentions mxid_age() in passing, but there >> appears to be no formal definition of either of these functions. >> >> Should there be? > > It seems like a good

Re: mxid_age() and age(xid) appear undocumented

2018-07-05 Thread Robert Haas
On Sun, Jul 1, 2018 at 11:18 PM, David Rowley wrote: > I see d692308cf494f6126 mentions mxid_age() in passing, but there > appears to be no formal definition of either of these functions. > > Should there be? It seems like a good idea to me. -- Robert Haas EnterpriseDB:

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-07-05 Thread Sergei Kornilov
Hello > Currently pg_stat_statements_reset() and other stats reset functions like > pg_stat_reset() can be executed only by superusers. > But why did you allow pg_read_all_stats role to execute that function, > by default? That change looks strange to me. This is not behavior change, only fix

Re: pgsql: Fix "base" snapshot handling in logical decoding

2018-07-05 Thread Alvaro Herrera
Hi Arseny. I'm writing a commit message to push this test change, and I can't explain this bit: On 2018-Jul-02, Arseny Sher wrote: > 3) As a side note, answer to my question 'why do we get different errors >with VACUUM and VACUUM FULL' is the following. With VACUUM FULL, not >only old

Re: Global shared meta cache

2018-07-05 Thread Andres Freund
Hi, On 2018-07-05 10:00:13 -0400, Robert Haas wrote: > I think we need to take a little bit broader view of this problem. > For instance, maybe we could have backend-local caches that are kept > relatively small, and then a larger shared cache that can hold more > entries. I think it's pretty

Re: Covering GiST indexes

2018-07-05 Thread Andrey Borodin
Hi! > 13 апр. 2018 г., в 17:36, Andrey Borodin написал(а): > > Here's V2, with basic set of tests. > Currently, I'm investigating what to document and more places to tests. Here is v3 version of the patch. I've fixed some comments and added some words to docs. Best regards, Andrey Borodin.

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-07-05 Thread Fujii Masao
On Wed, Jul 4, 2018 at 7:12 PM, Haribabu Kommi wrote: > > > On Mon, Jul 2, 2018 at 6:42 PM Sergei Kornilov wrote: >> >> Hello > > > Thanks for the review. > >> >> I found SELECT pg_stat_statements_reset(NULL,NULL,s.queryid) in tests and >> it pass tests, but i wonder how it works. Should not we

Re: Make deparsing of column defaults faster

2018-07-05 Thread Justin Pryzby
On Mon, Jun 04, 2018 at 10:00:53PM -0400, Peter Eisentraut wrote: > On 6/4/18 20:55, Jeff Janes wrote: > > Since defaults can't contain Vars, this patch converts the second > > parameter to zero in places where pg_get_expr is invoked on column > > defaults. > > My in-progress generated columns

Re: Regarding shared_preload_libraries (postgresql.conf file)

2018-07-05 Thread Andrew Gierth
> "Abi" == Abi KR writes: Abi> hello everyone, Abi> We wanted to make use of embedded key-value store(BadgerDB - Abi> implemented in golang) to save the data related to our extension. Abi> The problem is, when we load our extension using Abi> shared_preload_libraries, we could able to

Re: Non-reserved replication slots and slot advancing

2018-07-05 Thread Alvaro Herrera
On 2018-Jul-05, Michael Paquier wrote: > On Wed, Jul 04, 2018 at 09:57:31AM -0400, Alvaro Herrera wrote: > > None from me. > > Thanks Alvaro. For now the patch uses the following error message: > +SELECT pg_replication_slot_advance('regression_slot3', '0/1'); -- error > +ERROR: cannot move

Re: [PATCH] Find additional connection service files in pg_service.conf.d directory

2018-07-05 Thread Curt Tilmes
On Mon, Jun 18, 2018 at 12:17 PM Arthur Zakirov wrote: > I think when some error occured in searchServiceFileDirectory() then the > error "definition of service \"%s\" not found" will be raised, because > group_found is false. It may confuse as it hides a real error. For > example, if permission

Re: patch to allow disable of WAL recycling

2018-07-05 Thread Jerry Jelinek
Peter, Thanks for taking a look a this. I have a few responses in line. I am not a PG expert, so if there is something here that I've misunderstood, please let me know. On Sun, Jul 1, 2018 at 6:54 AM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 26.06.18 15:35, Jerry Jelinek

Re: Global shared meta cache

2018-07-05 Thread Konstantin Knizhnik
On 05.07.2018 17:00, Robert Haas wrote: On Mon, Jul 2, 2018 at 5:59 AM, Konstantin Knizhnik wrote: But I am not sure that just using RW lock will be enough replace local cache with global. I'm pretty sure it won't. In fact, no matter what kind of locking you use, it's bound to cost

Re: Regarding shared_preload_libraries (postgresql.conf file)

2018-07-05 Thread David Fetter
On Thu, Jul 05, 2018 at 06:46:26PM +0530, Abi KR wrote: > hello everyone, > We wanted to make use of embedded key-value store(BadgerDB - > implemented in golang) to save the data related to our extension. > > > The problem is, > when we load our extension using shared_preload_libraries,

Re: Speed up the removal of WAL files

2018-07-05 Thread Fujii Masao
On Wed, Feb 21, 2018 at 4:52 PM, Michael Paquier wrote: > On Wed, Feb 21, 2018 at 07:20:00AM +, Tsunakawa, Takayuki wrote: >> Right. Then I thought of doing the following to avoid making a new >> function only for RemoveNonParentXlogFiles() which is similar to >> RemoveXlogFile(). >> >> *

Re: Make deparsing of column defaults faster

2018-07-05 Thread Peter Eisentraut
On 29.06.18 05:15, Jeff Janes wrote: > Since pg_dump calls pg_get_expr once over and over again on the same > table consecutively, perhaps we could cache the column alias assignments > in a single-entry cache, so if it is called on the same table as last > time it just re-uses the aliases from

Re: Should contrib modules install .h files?

2018-07-05 Thread Andrew Gierth
> "Andrew" == Andrew Gierth writes: Andrew> Patch with docs (including an example) and Install.pm changes Andrew> (blind). I'll stick this in the open CF to see what cfbot Andrew> thinks of it. Andrew> Meh. Oversight in handling empty or missing vars. Also Andrew> incorrect dir in msvc

Re: Why B-Tree suffix truncation matters

2018-07-05 Thread Andrey Borodin
Hi, Peter! > 4 июля 2018 г., в 20:43, Peter Geoghegan написал(а): > > I've been working on B-Tree suffix truncation Thank you for this detailed explanation. I must admit I've been seriously confusing prefix truncation and suffix truncation before this post. Some years ago I've observed

Re: documentation about explicit locking

2018-07-05 Thread Robert Haas
On Wed, Jul 4, 2018 at 3:09 AM, Amit Langote wrote: > I wonder why we mention on the following page that CREATE COLLATION > requires SHARE ROW EXCLUSIVE lock > > https://www.postgresql.org/docs/devel/static/explicit-locking.html > > I know that's the lock taken on the pg_collation catalog, but do

Re: Global shared meta cache

2018-07-05 Thread Robert Haas
On Mon, Jul 2, 2018 at 5:59 AM, Konstantin Knizhnik wrote: > But I am not sure that just using RW lock will be enough replace local cache > with global. I'm pretty sure it won't. In fact, no matter what kind of locking you use, it's bound to cost something. There is no such thing as a free

Re: Cache invalidation after authentication (on-the-fly role creation)

2018-07-05 Thread Stephen Frost
Greetings Thomas, * Thomas Munro (thomas.mu...@enterprisedb.com) wrote: > Many people use custom scripts, ldap2pg or other similar tools to > synchronise or manage their PostgreSQL roles from an LDAP server. While I don't have any particular opinion on the proposed patch, I wanted to share a

Re: [HACKERS] Bug in to_timestamp().

2018-07-05 Thread Alexander Korotkov
On Fri, Mar 2, 2018 at 3:52 PM Arthur Zakirov wrote: > > On Fri, Mar 02, 2018 at 01:44:53PM +0100, Dmitry Dolgov wrote: > > Well, I'm not sure that it's completely unrelated, but I see your point - it > > makes sense to discuss this and move forward in small steps. So, if there > > are > > no

Re: Should contrib modules install .h files?

2018-07-05 Thread Andrew Gierth
> "Andrew" == Andrew Gierth writes: Andrew> Patch with docs (including an example) and Install.pm changes (blind). Andrew> I'll stick this in the open CF to see what cfbot thinks of it. Meh. Oversight in handling empty or missing vars. Also incorrect dir in msvc version. Fixed I hope. --

Re: Pluggable Storage - Andres's take

2018-07-05 Thread Alexander Korotkov
On Thu, Jul 5, 2018 at 3:25 PM Alexander Korotkov wrote: > > My current working state is at [3] (urls to clone repo are at [4]). > > This is *HEAVILY WIP*. I plan to continue working on it over the next > > days, but I'll temporarily focus onto v11 work. If others want I could > > move repo to

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-07-05 Thread Jesper Pedersen
Hi David, On 06/22/2018 02:28 AM, David Rowley wrote: I've attached 2 patches: 0001: implements items 1-6 0002: Is not intended for commit. It just a demo of where we could get the performance if we were smarter about locking partitions. I've just included this to show 0001's worth. I did

Regarding shared_preload_libraries (postgresql.conf file)

2018-07-05 Thread Abi KR
hello everyone, We wanted to make use of embedded key-value store(BadgerDB - implemented in golang) to save the data related to our extension. The problem is, when we load our extension using shared_preload_libraries, we could able to open badgerdb and use it in postmaster

Re: Cache invalidation after authentication (on-the-fly role creation)

2018-07-05 Thread Thomas Munro
On Thu, Jul 5, 2018 at 9:35 AM, Tom Lane wrote: > Thomas Munro writes: >> PerformAuthentication(MyProcPort); >> + AcceptInvalidationMessages(); >> InitializeSessionUserId(username, useroid); > > That seems like a *really* ad-hoc place to put it. Why

Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.

2018-07-05 Thread Ashutosh Bapat
On Thu, Jul 5, 2018 at 4:45 PM, Etsuro Fujita wrote: > > > In the case where scanjoin_target_parallel_safe=false, we actually will > consider such parallel paths using the existing partial paths for the parent > appendrel in the code path shown in a previous email (note: we would already > have

Re: Should contrib modules install .h files?

2018-07-05 Thread Andrew Gierth
> "Andrew" == Andrew Gierth writes: Patch with docs (including an example) and Install.pm changes (blind). I'll stick this in the open CF to see what cfbot thinks of it. Anyone have any objection to putting this into 11beta if it works, as well as 12devel? -- Andrew (irc:RhodiumToad)

Re: peripatus build failures....

2018-07-05 Thread Larry Rosenman
On Wed, Jul 04, 2018 at 08:37:40PM -0500, Larry Rosenman wrote: > On Wed, Jul 04, 2018 at 08:19:48PM -0500, Larry Rosenman wrote: > > On Thu, Jul 05, 2018 at 12:56:49PM +1200, Thomas Munro wrote: > > > On Thu, Jul 5, 2018 at 12:35 PM, Larry Rosenman wrote: > > > > I agree. Is there an easy way I

Re: Pluggable Storage - Andres's take

2018-07-05 Thread Alexander Korotkov
Hi! On Tue, Jul 3, 2018 at 10:06 AM Andres Freund wrote: > As I've previously mentioned I had planned to spend some time to polish > Haribabu's version of the pluggable storage patch and rebase it on the > vtable based slot approach from [1]. While doing so I found more and > more things that I

Re: Generating partitioning tuple conversion maps faster

2018-07-05 Thread David Rowley
On 30 June 2018 at 05:40, David Rowley wrote: > I think your idea > to reduce the loops in test 6 from 2000 down to 1001 should be worth > it. I'll try the idea out next week. The attached changes things to use your way of picking up the search for the next column at the column after the last

Re: shared-memory based stats collector

2018-07-05 Thread Kyotaro HORIGUCHI
Hello. At Thu, 05 Jul 2018 12:04:23 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20180705.120423.49626073.horiguchi.kyot...@lab.ntt.co.jp> > UNDO logs seems a bit promising. If we looking stats in a long > transaction, the required memory for UNDO information easily > reaches to

Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.

2018-07-05 Thread Etsuro Fujita
(2018/07/05 20:15), Etsuro Fujita wrote: (2018/07/04 19:11), Ashutosh Bapat wrote: On Wed, Jul 4, 2018 at 3:36 PM, Etsuro Fujita wrote: I don't produce a test case where the plan is an Append with Gather subplans, but I'm not sure that it's a good thing to allow us to consider such a plan

Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.

2018-07-05 Thread Etsuro Fujita
(2018/07/04 19:11), Ashutosh Bapat wrote: On Wed, Jul 4, 2018 at 3:36 PM, Etsuro Fujita wrote: I don't produce a test case where the plan is an Append with Gather subplans, but I'm not sure that it's a good thing to allow us to consider such a plan because in that plan, each Gather would try

Re: Should contrib modules install .h files?

2018-07-05 Thread Andrew Gierth
> "Tom" == Tom Lane writes: >> This installs to $(includedir_server)/$(MODULEDIR)/$MODULE/file.h >> (e.g. include/server/extension/hstore/hstore.h for an actual >> example), and errors if HEADERS_xxx is defined for anything that's >> not a module listed in MODULES or MODULE_big. Tom>

Re: AtEOXact_ApplyLauncher() and subtransactions

2018-07-05 Thread Amit Khandekar
On 4 July 2018 at 00:27, Robert Haas wrote: > On Tue, Jun 26, 2018 at 6:25 AM, Amit Khandekar > wrote: >> Added this into the July 2018 commitfest : >> >> https://commitfest.postgresql.org/18/1696/ > > It seems to me that it would probably be better to separate this into > two patches, because

Regarding shared_preload_libraries (postgresql.conf file)

2018-07-05 Thread Abinaya k
hello everyone, We are building in-memory index extension for postgres. It makes use of another third-party embedded key-value store (*BadgerDB* - implemented in golang) to store secondary indexes. The problem is

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-07-05 Thread David Rowley
On 5 July 2018 at 18:39, Kato, Sho wrote: > postgres=# create table a(i int) partition by range(i); > CREATE TABLE > postgres=# create table a_1 partition of a for values from(1) to (200); > CREATE TABLE > postgres=# create table a_2 partition of a for values from(200) to (400); > server closed

Re: Bulk Insert into PostgreSQL

2018-07-05 Thread Srinivas Karthik V
Thanks for the link! Alternatively, when I am trying to create an index on a column of a table which is of size 400 GB, it is taking roughly 7 hrs. The index is created only on one column which is not a primary key. The query I am using is, create index on table (colname). I request your valuable

Re: Copy function for logical replication slots

2018-07-05 Thread Masahiko Sawada
On Thu, Jul 5, 2018 at 4:47 PM, Michael Paquier wrote: > On Tue, Jul 03, 2018 at 05:27:07PM +0900, Masahiko Sawada wrote: >> On Tue, Jul 3, 2018 at 1:01 PM, Michael Paquier wrote: >>> One property which seems important to me is to make sure that the target >>> slot has the same data as the

Re: Unexpected behavior of DROP VIEW/TABLE IF EXISTS

2018-07-05 Thread Pavel Stehule
2018-07-04 23:17 GMT+02:00 Tom Lane : > Robert Haas writes: > > Another possibility that would also seem to meet the OP's needs is to > > make it do this: > > > DROP TABLE IF EXISTS X; > > NOTICE: relation "X" is not a table, skipping > > > His complaint was really that it generated an ERROR,

Re: PANIC during crash recovery of a recently promoted standby

2018-07-05 Thread Michael Paquier
On Thu, Jul 05, 2018 at 01:03:14PM +0530, Pavan Deolasee wrote: > Many thanks Michael for doing the gruelling of coming up with a more > complete fix, verifying all the cases, in various back branches. No problem. I hope I got the credits right. If there is anything wrong please feel free to

Re: Recovery performance of DROP DATABASE with many tablespaces

2018-07-05 Thread Simon Riggs
On 4 June 2018 at 17:46, Fujii Masao wrote: > Hi, > > My colleague encountered the problem that WAL replay took a long time > in the standby with large shared_buffers when he dropped the database > using many tablespaces. As far as I read the code, this happens because > DROP DATABASE generates

Re: [HACKERS] Replication status in logical replication

2018-07-05 Thread Michael Paquier
On Mon, May 21, 2018 at 10:15:02AM +0900, Masahiko Sawada wrote: > I've added this to Open Items so as not to forget. This concerns as well v10, so that's not actually an open item... Well, it was an open item last year. The last set of patches is from Simon here:

Re: Copy function for logical replication slots

2018-07-05 Thread Michael Paquier
On Tue, Jul 03, 2018 at 05:27:07PM +0900, Masahiko Sawada wrote: > On Tue, Jul 3, 2018 at 1:01 PM, Michael Paquier wrote: >> One property which seems important to me is to make sure that the target >> slot has the same data as the origin slot once the caller knows that the >> copy has completed,

Re: PANIC during crash recovery of a recently promoted standby

2018-07-05 Thread Pavan Deolasee
On Thu, Jul 5, 2018 at 7:20 AM, Michael Paquier wrote: > On Mon, Jul 02, 2018 at 10:41:05PM +0900, Michael Paquier wrote: > > I am planning to finish wrapping this patch luckily on Wednesday JST > > time, or in the worst case on Thursday. I got this problem on my mind > > for a couple of days

Re: [HACKERS] WAL logging problem in 9.4.3?

2018-07-05 Thread Michael Paquier
On Wed, Jul 04, 2018 at 07:55:53AM -0400, Andrew Dunstan wrote: > Many thanks for working on this. No problem. Thanks for the lookup. > +1 for these changes, even though the TRUNCATE fix looks perverse. If > anyone wants to propose further optimizations in this area this would > at least give

Re: [HACKERS] Restricting maximum keep segments by repslots

2018-07-05 Thread Masahiko Sawada
On Wed, Jul 4, 2018 at 5:28 PM, Kyotaro HORIGUCHI wrote: > Hello. > > At Tue, 26 Jun 2018 16:26:59 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI > wrote in > <20180626.162659.223208514.horiguchi.kyot...@lab.ntt.co.jp> >> The previous patche files doesn't have version number so I let >> the

RE: Speeding up INSERTs and UPDATEs to partitioned tables

2018-07-05 Thread Kato, Sho
Hi, I tried to benchmark with v1-0001-Speed-up-INSERT-and-UPDATE-on-partitioned-tables.patch, but when I create the second partition, server process get segmentation fault. I don't know the cause, but it seems that an incorrect value is set to partdesc->boundinfo. (gdb) p