Re: retry shm attach for windows (WAS: Re: [HACKERS] OK, so culicidae is *still* broken)

2017-06-02 Thread Noah Misch
On Fri, May 26, 2017 at 05:50:45PM +0530, Amit Kapila wrote: > On Fri, May 26, 2017 at 5:30 AM, Tsunakawa, Takayuki > wrote: > > I guessed that the reason Noah suggested 1 - 5 seconds of retry is based > > on the expectation that the address space might be freed

Re: [HACKERS] proposal: PLpgSQL parallel assignemnt

2017-06-02 Thread Craig Ringer
On 2 June 2017 at 15:51, Pavel Stehule wrote: > a, b := fx(); > > Comments, notes, ideas? I'd be pretty happy to have (a, b) = (x, y); (a, b) = f(x); which is SQL-esque. But what, if anything, does Ada do? -- Craig Ringer

Re: [HACKERS] proposal: PLpgSQL parallel assignemnt

2017-06-02 Thread Pavel Stehule
2017-06-02 10:06 GMT+02:00 Craig Ringer : > On 2 June 2017 at 15:51, Pavel Stehule wrote: > > > a, b := fx(); > > > > Comments, notes, ideas? > > I'd be pretty happy to have > > (a, b) = (x, y); > (a, b) = f(x); > > which is SQL-esque. > This is

[HACKERS] Do we need the gcc feature "__builtin_expect" to promote the branches prediction?

2017-06-02 Thread Hao Lee
Hi all, There is a lot of "if statement" in system, and GCC provides a feature,"__builtin_expect", which let compilers know which branch is mostly run. as we known, miss-prediction will lead the performance lost(because the CPU will thrown away some instructions, and re-fetch some new

Re: [HACKERS] logical replication - still unstable after all these months

2017-06-02 Thread Mark Kirkwood
On 02/06/17 17:11, Erik Rijkers wrote: On 2017-06-02 00:46, Mark Kirkwood wrote: On 31/05/17 21:16, Petr Jelinek wrote: I'm seeing a new failure with the patch applied - this time the history table has missing rows. Petr, I'll put back your access :-) Is this error during 1-minute runs?

Re: [HACKERS] Fix a typo in predicate.c

2017-06-02 Thread Magnus Hagander
On Fri, Jun 2, 2017 at 7:32 AM, Masahiko Sawada wrote: > Hi, > > While reading predicate lock source code, I found a comment typo in > predicate.c file. > Attached patch fixes it. > > s/scrach/scratch/ > Applied, thanks. -- Magnus Hagander Me:

Re: [HACKERS] Why does logical replication launcher set application_name?

2017-06-02 Thread Masahiko Sawada
On Wed, May 31, 2017 at 12:10 PM, Peter Eisentraut wrote: > Here is a proposed solution that splits bgw_name into bgw_type and > bgw_name_extra. bgw_type shows up in pg_stat_activity.backend_type. > Uses of application_name are removed, because they are no

[HACKERS] comment fix in attoptcache.c

2017-06-02 Thread Amit Langote
Noticed a comment copy-pasted from spccache.c, which attached patch fixes to match the file. /* * InitializeAttoptCache - * Initialize the tablespace cache. + * Initialize the attribute options cache. */ Thanks, Amit diff --git a/src/backend/utils/cache/attoptcache.c

[HACKERS] proposal: PLpgSQL parallel assignemnt

2017-06-02 Thread Pavel Stehule
Hi Some modern or old languages (GO, Lua, CLU) has similarly designed function OUT parameters like PLpgSQL. In these languages is usually supported parallel assignment. It is not supported by PLpgSQL - there is workaround - using SELECT FROM, but it is workaround. The implementation of PA is

Re: [HACKERS] Re: [GSOC 17] Eliminate O(N^2) scaling from rw-conflict tracking in serializable transactions

2017-06-02 Thread Mengxing Liu
Hi, Alvaro and Kevin. > Anyway, this is just my analysis. > So I want to hack the PG and count the conflict lists' size of transactions. > That would be more accurate. In the last week, I hacked the PG to add an additional thread to count RWConflict list lengths. And tune the benchmark to

Re: [HACKERS] Bug in ExecModifyTable function and trigger issues for foreign tables

2017-06-02 Thread Etsuro Fujita
On 2017/05/16 21:36, Etsuro Fujita wrote: One approach I came up with to fix this issue is to rewrite the targetList entries of an inherited UPDATE/DELETE properly using rewriteTargetListUD, when generating a plan for each child table in inheritance_planner. Attached is a WIP patch for that.

Re: [HACKERS] comment fix in attoptcache.c

2017-06-02 Thread Magnus Hagander
On Fri, Jun 2, 2017 at 11:14 AM, Amit Langote wrote: > Noticed a comment copy-pasted from spccache.c, which attached patch fixes > to match the file. > > /* > * InitializeAttoptCache > - * Initialize the tablespace cache. > + * Initialize the

[HACKERS] Why restore_command is called for existing files in pg_xlog?

2017-06-02 Thread Alexander Kukushkin
Hello hackers, There is one strange and awful thing I don't understand about restore_command: it is always being called for every single WAL segment postgres wants to apply (even if such segment already exists in pg_xlog) until replica start streaming from the master. If there is no

Re: [HACKERS] Race conditions with WAL sender PID lookups

2017-06-02 Thread Michael Paquier
On Fri, Jun 2, 2017 at 2:21 PM, Noah Misch wrote: > On Tue, May 30, 2017 at 11:13:37AM -0700, Michael Paquier wrote: >> On Tue, May 30, 2017 at 11:09 AM, Peter Eisentraut >> wrote: >> > I don't think this is my item. Most of the behavior is

Re: [HACKERS] statement_timeout is not working as expected with postgres_fdw

2017-06-02 Thread Rafia Sabih
On Tue, May 16, 2017 at 9:39 PM, Robert Haas wrote: > On Sun, May 7, 2017 at 11:54 AM, Robert Haas wrote: >> I'm having second thoughts based on some more experimentation I did >> this morning. I'll update again once I've had a bit more time to poke

Re: [HACKERS] UPDATE of partition key

2017-06-02 Thread Amit Khandekar
On 2 June 2017 at 01:17, Robert Haas wrote: > On Thu, Jun 1, 2017 at 7:41 AM, Amit Khandekar wrote: >>> Regarding the trigger issue, I can't claim to have a terribly strong >>> opinion on this. I think that practically anything we do here might >>>

Re: [HACKERS] Broken hint bits (freeze)

2017-06-02 Thread Dmitriy Sarafannikov
Thanks for all. We found the source of the problem. It was mistake in upgrade to 9.6. We upgrade replica with rsync as it is in the documentation: rsync --verbose --relative --archive --hard-links --size-only old_pgdata new_pgdata remote_dir We must provide 100% read-only availability of our

Re: [HACKERS] PG10 transition tables, wCTEs and multiple operations on the same table

2017-06-02 Thread Thomas Munro
On Fri, Jun 2, 2017 at 10:48 PM, Marko Tiikkaja wrote: > Since the subject of transition tables came up, I thought I'd test how this > case works: > > =# create table qwr(a int); > CREATE TABLE > > =# create function qq() returns trigger as $$ begin raise notice '%', > (select

Re: [HACKERS] Default Partition for Range

2017-06-02 Thread Robert Haas
On Fri, Jun 2, 2017 at 8:09 AM, Amit Kapila wrote: > I think if you have found spelling mistakes unrelated to this patch, > then it is better to submit those as a separate patch in a new thread. +1. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The

Re: [HACKERS] Hash Functions

2017-06-02 Thread Robert Haas
On Fri, Jun 2, 2017 at 1:24 AM, Jeff Davis wrote: > 1. For range partitioning, I think it's "yes, a little". As you point > out, there are already some weird edge cases -- the main way range > partitioning would make the problem worse is simply by having more > users. I agree.

Re: [HACKERS] Effect of changing the value for PARALLEL_TUPLE_QUEUE_SIZE

2017-06-02 Thread Robert Haas
On Fri, Jun 2, 2017 at 9:01 AM, Amit Kapila wrote: > Your reasoning sounds sensible to me. I think the other way to attack > this problem is that we can maintain some local queue in each of the > workers when the shared memory queue becomes full. Basically, we can >

Re: [HACKERS] Effect of changing the value for PARALLEL_TUPLE_QUEUE_SIZE

2017-06-02 Thread Amit Kapila
On Fri, Jun 2, 2017 at 6:38 PM, Robert Haas wrote: > On Fri, Jun 2, 2017 at 9:01 AM, Amit Kapila wrote: >> Your reasoning sounds sensible to me. I think the other way to attack >> this problem is that we can maintain some local queue in each of

Re: [HACKERS] Default Partition for Range

2017-06-02 Thread Rafia Sabih
On Wed, May 31, 2017 at 5:53 PM, Beena Emerson wrote: > Hello, > > PFA the updated patch. > Dependent patch default_partition_v17.patch [1] > This patch adds regression tests and removes the separate function to > get default partition qual. > > > On Mon, May 29, 2017 at

Re: [HACKERS] Do we need the gcc feature "__builtin_expect" to promote the branches prediction?

2017-06-02 Thread Hao Lee
Okay. Thanks On Fri, Jun 2, 2017 at 7:27 PM, Julien Rouhaud wrote: > On 02/06/2017 12:50, Craig Ringer wrote: > > > > > > On 2 Jun. 2017 16:42, "Hao Lee" > > wrote: > > > > Hi all, > >There is a lot of "if

Re: [HACKERS] PG10 transition tables, wCTEs and multiple operations on the same table

2017-06-02 Thread Thomas Munro
On Sat, Jun 3, 2017 at 12:10 AM, Thomas Munro wrote: > I would have expected that to be handled by separate transition tables > at different query levels, but evidently it isn't. I am wondering if we need to wrap the execution of a modifying CTE in

Re: [HACKERS] Patch: Add --no-comments to skip COMMENTs with pg_dump

2017-06-02 Thread Robert Haas
On Thu, Jun 1, 2017 at 10:05 PM, Tom Lane wrote: > I dunno. What's the actual use-case, other than as a bad workaround > to a problem we should fix a different way? Well, that's a fair point. I don't have a specific use case in mind. However, I also don't think that options

Re: [HACKERS] Effect of changing the value for PARALLEL_TUPLE_QUEUE_SIZE

2017-06-02 Thread Amit Kapila
On Thu, Jun 1, 2017 at 6:41 PM, Rafia Sabih wrote: > On Tue, May 30, 2017 at 4:57 PM, Robert Haas wrote: > >> I did a little bit of brief experimentation on this same topic a long >> time ago and didn't see an improvement from boosting the

[HACKERS] PG10 transition tables, wCTEs and multiple operations on the same table

2017-06-02 Thread Marko Tiikkaja
Since the subject of transition tables came up, I thought I'd test how this case works: =# create table qwr(a int); CREATE TABLE =# create function qq() returns trigger as $$ begin raise notice '%', (select count(*) from oo); return null; end $$ language plpgsql; CREATE FUNCTION =# create

Re: [HACKERS] Perfomance bug in v10

2017-06-02 Thread Teodor Sigaev
Teodor, could you check if this patch fixes your real-world problem? It works fine with original query, thank you. But some other query slowdowns for ~10% (9 secs vs 10 secs). Look at following part of plans of huge query: without patch: -> Nested Loop (cost=34.82..50.91 rows=1 width=20)

Re: [HACKERS] Do we need the gcc feature "__builtin_expect" to promote the branches prediction?

2017-06-02 Thread Craig Ringer
On 2 Jun. 2017 16:42, "Hao Lee" wrote: Hi all, There is a lot of "if statement" in system, and GCC provides a feature,"__builtin_expect", which let compilers know which branch is mostly run. Compilers and CPUs are really good at guessing this. Humans are wrong about

Re: [HACKERS] Do we need the gcc feature "__builtin_expect" to promote the branches prediction?

2017-06-02 Thread Julien Rouhaud
On 02/06/2017 12:50, Craig Ringer wrote: > > > On 2 Jun. 2017 16:42, "Hao Lee" > wrote: > > Hi all, >There is a lot of "if statement" in system, and GCC provides > a feature,"__builtin_expect", which let compilers know which

Re: [HACKERS] Default Partition for Range

2017-06-02 Thread Amit Kapila
On Fri, Jun 2, 2017 at 4:12 PM, Rafia Sabih wrote: > On Wed, May 31, 2017 at 5:53 PM, Beena Emerson > wrote: > > Hi Beena, > > I had a look at the patch from the angle of aesthetics and there are a > few cosmetic changes I might suggest.

Re: [HACKERS] make check false success

2017-06-02 Thread Robert Haas
On Thu, Jun 1, 2017 at 10:18 AM, Sandro Santilli wrote: > I noticed that the `check` Makefile rule imported by PGXS is giving > a success exit code even when it is unsupported. > > The attached patch fixes that. Hmm. I'm not 100% sure that the existing behavior is wrong. --

Re: retry shm attach for windows (WAS: Re: [HACKERS] OK, so culicidae is *still* broken)

2017-06-02 Thread Amit Kapila
On Thu, Jun 1, 2017 at 10:36 PM, Petr Jelinek wrote: > On 01/06/17 15:25, Tom Lane wrote: >> Robert Haas writes: >>> So, are you going to, perhaps, commit this? Or who is picking this up? >> >>> /me knows precious little about Windows. >> >>

Re: [HACKERS] Perfomance bug in v10

2017-06-02 Thread Tom Lane
Teodor Sigaev writes: >> Teodor, could you check if this patch fixes your real-world problem? > It works fine with original query, thank you. But some other query slowdowns > for > ~10% (9 secs vs 10 secs). Look at following part of plans of huge query: > ... > As you said,

Re: [HACKERS] Perfomance bug in v10

2017-06-02 Thread Claudio Freire
On Fri, Jun 2, 2017 at 10:27 AM, Tom Lane wrote: > Teodor Sigaev writes: >>> Teodor, could you check if this patch fixes your real-world problem? > >> It works fine with original query, thank you. But some other query slowdowns >> for >> ~10% (9 secs vs 10

Re: [HACKERS] Range Merge Join v1

2017-06-02 Thread Jeff Davis
On Tue, May 30, 2017 at 11:44 PM, Andrew Borodin wrote: > Hi, Jeff! Hi! > Sorry for being late. Actually, I had several unsuccessful attempts to > find something wrong with the patch. > Here's my review. > > in pathkey.c > > ecs = (EquivalenceClass **) palloc(nClauses *

Re: [HACKERS] Perfomance bug in v10

2017-06-02 Thread Teodor Sigaev
There were old threads about considering a risk factor when estimating plans, and I'm thinking this issue is the planner failing to do exactly that. I'm afraid it's tool late for v10 -- Teodor Sigaev E-mail: teo...@sigaev.ru

Re: [HACKERS] Perfomance bug in v10

2017-06-02 Thread Tom Lane
Teodor Sigaev writes: >> There were old threads about considering a risk factor when estimating >> plans, and I'm thinking this issue is the planner failing to do >> exactly that. > I'm afraid it's tool late for v10 Yeah, we're surely not opening that can of worms for v10.

Re: [HACKERS] Perfomance bug in v10

2017-06-02 Thread Claudio Freire
On Fri, Jun 2, 2017 at 11:46 AM, Teodor Sigaev wrote: >> There were old threads about considering a risk factor when estimating >> plans, and I'm thinking this issue is the planner failing to do >> exactly that. >> > I'm afraid it's tool late for v10 Clearly -- Sent via

Re: retry shm attach for windows (WAS: Re: [HACKERS] OK, so culicidae is *still* broken)

2017-06-02 Thread Petr Jelinek
On 02/06/17 15:37, Amit Kapila wrote: > On Thu, Jun 1, 2017 at 10:36 PM, Petr Jelinek > wrote: >> On 01/06/17 15:25, Tom Lane wrote: >>> Robert Haas writes: So, are you going to, perhaps, commit this? Or who is picking this up? >>>

Re: [HACKERS] pg_class.relpartbound definition overly brittle

2017-06-02 Thread Tom Lane
Robert Haas writes: > Also, you're attacking a straw man. Accidentally storing a meaningless > parse location in the catalog isn't a feature, and we shouldn't > pretend otherwise. It's not meaningless, and it is a feature, useful for debugging. Otherwise you'd have a hard

Re: [HACKERS] proposal: PLpgSQL parallel assignemnt

2017-06-02 Thread Pavel Stehule
2017-06-02 10:15 GMT+02:00 Pavel Stehule : > > > 2017-06-02 10:06 GMT+02:00 Craig Ringer : > >> On 2 June 2017 at 15:51, Pavel Stehule wrote: >> >> > a, b := fx(); >> > >> > Comments, notes, ideas? >> >> I'd be pretty happy

[HACKERS] sketchy partcollation handling

2017-06-02 Thread Robert Haas
If you create a partitioned table in the obvious way, partcollation ends up 0: rhaas=# create table foo (a int, b text) partition by list (a); CREATE TABLE rhaas=# select * from pg_partitioned_table; partrelid | partstrat | partnatts | partattrs | partclass | partcollation | partexprs

Re: [HACKERS] pg_class.relpartbound definition overly brittle

2017-06-02 Thread Robert Haas
On Thu, Jun 1, 2017 at 9:31 AM, Tom Lane wrote: > Let me explain the project standards in words of one syllable: user code > should not examine the contents of node trees. That's what pg_get_expr > is for. There is not, never has been, and never will be any guarantee > that

Re: [HACKERS] Questions about upgrade standby with rsync

2017-06-02 Thread Robert Haas
On Fri, Jun 2, 2017 at 12:42 PM, Sergey Burladyan wrote: > Hello, all! > > I have problem with upgrading standby via rsync. This mailing list is for discussion of PostgreSQL development, not user questions. You might try pgsql-general or pgsql-admin. -- Robert Haas

Re: [HACKERS] Use of non-restart-safe storage by temp_tablespaces

2017-06-02 Thread Bruce Momjian
On Wed, May 31, 2017 at 08:28:51AM -0700, Mark Dilger wrote: > > Uh, I thought only the sessions that created the temporary objects could > > see them, and since they are not in WAL and autovacuum can't see them, > > their non-existence in a temporary tablespace would not be a problem. > > You

Re: [HACKERS] Hash Functions

2017-06-02 Thread Robert Haas
On Fri, Jun 2, 2017 at 10:19 AM, Joe Conway wrote: >> Yeah, that's not crazy. I find it a bit surprising in terms of the >> semantics, though. SET >> when_i_try_to_insert_into_a_specific_partition_i_dont_really_mean_it = >> true? > > Maybe > SET partition_tuple_retry =

Re: [HACKERS] TAP: allow overriding PostgresNode in get_new_node

2017-06-02 Thread Robert Haas
On Thu, Jun 1, 2017 at 3:36 AM, Michael Paquier wrote: > On Wed, May 31, 2017 at 7:18 PM, Craig Ringer wrote: >> Note that you can achieve the same effect w/o patching >> PostgresNode.pm, albeit in a somewhat ugly manner, by re-blessing the >>

Re: [HACKERS] Perfomance bug in v10

2017-06-02 Thread Teodor Sigaev
BTW, was the larger query plan that you showed (with a Materialize node) generated by 9.6, or v10 HEAD? Because I would be surprised if 9.6 did v10, commit acbd8375e954774181b673a31b814e9d46f436a5 Author: Magnus Hagander Date: Fri Jun 2 11:18:24 2017 +0200 -- Teodor

Re: [HACKERS] [PATCH] relocation truncated to fit: citus build failure on s390x

2017-06-02 Thread Tom Lane
Andres Freund writes: > On 2017-05-31 11:57:16 -0400, Alvaro Herrera wrote: >> My vote would be to backpatch it all the way. > +1 Done, buildfarm seems happy. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)

[HACKERS] Questions about upgrade standby with rsync

2017-06-02 Thread Sergey Burladyan
Hello, all! I have problem with upgrading standby via rsync. Documentation say: > Verify that the "Latest checkpoint location" values match in all clusters. But it is impossible for "WAL archive only" standby, if I not mistaken. Standby can make restartpoint only at master checkpoint location,

Re: [HACKERS] BEFORE trigger can cause undetected partition constraint violation

2017-06-02 Thread Robert Haas
On Fri, Jun 2, 2017 at 12:51 AM, Amit Langote wrote: > Attached patch makes InitResultRelInfo() *always* initialize the > partition's constraint, that is, regardless of whether insert/copy is > through the parent or directly on the partition. I'm wondering if >

Re: [HACKERS] strcmp() tie-breaker for identical ICU-collated strings

2017-06-02 Thread Amit Khandekar
On 2 June 2017 at 03:18, Thomas Munro wrote: > On Fri, Jun 2, 2017 at 9:27 AM, Peter Geoghegan wrote: >> On Thu, Jun 1, 2017 at 2:24 PM, Thomas Munro >> wrote: >>> Why should ICU be any different than the system

Re: [HACKERS] Hash Functions

2017-06-02 Thread Joe Conway
On 06/02/2017 05:47 AM, Robert Haas wrote: > On Fri, Jun 2, 2017 at 1:24 AM, Jeff Davis wrote: >> 2. I basically see two approaches to solve the problem: >> (a) Tom suggested at PGCon that we could have a GUC that >> automatically causes inserts to the partition to be

Re: [HACKERS] Re: [GSOC 17] Eliminate O(N^2) scaling from rw-conflict tracking in serializable transactions

2017-06-02 Thread Alvaro Herrera
Mengxing Liu wrote: > Hi, Alvaro and Kevin. > > > Anyway, this is just my analysis. > > So I want to hack the PG and count the conflict lists' size of > > transactions. That would be more accurate. > > In the last week, I hacked the PG to add an additional thread to count > RWConflict list

Re: [HACKERS] Do we need the gcc feature "__builtin_expect" to promote the branches prediction?

2017-06-02 Thread Andres Freund
Hi, On 2017-06-02 16:40:56 +0800, Hao Lee wrote: > Hi all, >There is a lot of "if statement" in system, and GCC provides a > feature,"__builtin_expect", which let compilers know which branch is > mostly run. as we known, miss-prediction will lead the performance > lost(because the CPU

Re: [HACKERS] walsender termination error messages worse in v10

2017-06-02 Thread Petr Jelinek
Hi Andres, On 02/06/17 20:51, Andres Freund wrote: > Hi, > > commit 7c4f52409a8c7d85ed169bbbc1f6092274d03920 > Author: Peter Eisentraut > Date: 2017-03-23 08:36:36 -0400 > > Logical replication support for initial data copy > > made walreceiver emit worse messages in

Re: [HACKERS] PG 10 release notes

2017-06-02 Thread Jim Nasby
On 4/24/17 8:31 PM, Bruce Momjian wrote: I have committed the first draft of the Postgres 10 release notes. They are current as of two days ago, and I will keep them current. Please give me any feedback you have. The only unusual thing is that this release has ~180 items while most recent

Re: [HACKERS] pg_class.relpartbound definition overly brittle

2017-06-02 Thread Mark Dilger
> On Jun 2, 2017, at 9:59 AM, Tom Lane wrote: > > Robert Haas writes: >> Also, you're attacking a straw man. Accidentally storing a meaningless >> parse location in the catalog isn't a feature, and we shouldn't >> pretend otherwise. > > It's not

Re: [HACKERS] Perfomance bug in v10

2017-06-02 Thread Tom Lane
Teodor Sigaev writes: >> BTW, was the larger query plan that you showed (with a Materialize node) >> generated by 9.6, or v10 HEAD? Because I would be surprised if 9.6 did > v10, > commit acbd8375e954774181b673a31b814e9d46f436a5 > Author: Magnus Hagander

[HACKERS] walsender termination error messages worse in v10

2017-06-02 Thread Andres Freund
Hi, commit 7c4f52409a8c7d85ed169bbbc1f6092274d03920 Author: Peter Eisentraut Date: 2017-03-23 08:36:36 -0400 Logical replication support for initial data copy made walreceiver emit worse messages in v10 than before when the master gets shut down. Before 10 you'll get

Re: [HACKERS] strcmp() tie-breaker for identical ICU-collated strings

2017-06-02 Thread Peter Geoghegan
On Fri, Jun 2, 2017 at 10:34 AM, Amit Khandekar wrote: > Ok. I was thinking we are doing the tie-breaker because specifically > strcoll_l() was unexpectedly returning 0 for some cases. Now I get it, > that we do that to be compatible with texteq(). Both of these

Re: [HACKERS] Get stuck when dropping a subscription during synchronizing table

2017-06-02 Thread Peter Eisentraut
On 5/24/17 15:14, Petr Jelinek wrote: > All the locking works just fine the way it is in master. The issue with > deadlock with apply comes from the wrong handling of the SIGTERM in the > apply (we didn't set InterruptPending). I changed the SIGTERM handler in > patch 0001 just to die which is

Re: [HACKERS] Error while creating subscription when server is running in single user mode

2017-06-02 Thread Peter Eisentraut
On 6/1/17 21:55, Andres Freund wrote: > On 2017-06-01 21:42:41 -0400, Peter Eisentraut wrote: >> We should look at what the underlying problem is before we prohibit >> anything at a high level. > > I'm not sure there's any underlying issue here, except being in single > user mode. My point is

Re: [HACKERS] Why does logical replication launcher set application_name?

2017-06-02 Thread Peter Eisentraut
On 6/2/17 02:31, Masahiko Sawada wrote: > On Wed, May 31, 2017 at 12:10 PM, Peter Eisentraut > wrote: >> Here is a proposed solution that splits bgw_name into bgw_type and >> bgw_name_extra. bgw_type shows up in pg_stat_activity.backend_type. >> Uses of

Re: [HACKERS] Why does logical replication launcher set application_name?

2017-06-02 Thread Peter Eisentraut
On 5/30/17 23:10, Peter Eisentraut wrote: > Here is a proposed solution that splits bgw_name into bgw_type and > bgw_name_extra. bgw_type shows up in pg_stat_activity.backend_type. > Uses of application_name are removed, because they are no longer > necessary to identity the process type. > >

Re: [HACKERS] Re: [GSOC 17] Eliminate O(N^2) scaling from rw-conflict tracking in serializable transactions

2017-06-02 Thread Kevin Grittner
> Mengxing Liu wrote: >> The CPU utilization of CheckForSerializableConflictOut/In is >> 0.71%/0.69%. How many cores were on the system used for this test? The paper specifically said that they didn't see performance degradation on the PostgreSQL implementation until 32 concurrent connections

[HACKERS] Directory pg_replslot is not properly cleaned

2017-06-02 Thread Fabrízio de Royes Mello
Hi all, This week I faced a out of disk space trouble in 8TB production cluster. During investigation we notice that pg_replslot was the culprit growing more than 1TB in less than 1 (one) hour. We're using PostgreSQL 9.5.6 with pglogical 1.2.2 replicating to a new 9.6 instance and planning the

Re: [HACKERS] Directory pg_replslot is not properly cleaned

2017-06-02 Thread Fabrízio de Royes Mello
On Fri, Jun 2, 2017 at 6:32 PM, Fabrízio de Royes Mello < fabriziome...@gmail.com> wrote: > > Hi all, > > This week I faced a out of disk space trouble in 8TB production cluster. During investigation we notice that pg_replslot was the culprit growing more than 1TB in less than 1 (one) hour. > >

Re: [HACKERS] walsender termination error messages worse in v10

2017-06-02 Thread Petr Jelinek
On 02/06/17 23:45, Andres Freund wrote: > Hi Petr, > > On 2017-06-02 22:57:37 +0200, Petr Jelinek wrote: >> On 02/06/17 20:51, Andres Freund wrote: >>> I don't understand why the new block is there, nor does the commit >>> message explain it. >>> >> >> Hmm, that particular change can actually be

Re: [HACKERS] logical replication - still unstable after all these months

2017-06-02 Thread Petr Jelinek
On 02/06/17 22:29, Petr Jelinek wrote: > On 02/06/17 08:55, Mark Kirkwood wrote: >> On 02/06/17 17:11, Erik Rijkers wrote: >> >>> On 2017-06-02 00:46, Mark Kirkwood wrote: On 31/05/17 21:16, Petr Jelinek wrote: I'm seeing a new failure with the patch applied - this time the

Re: [HACKERS] walsender termination error messages worse in v10

2017-06-02 Thread Andres Freund
Hi Petr, On 2017-06-02 22:57:37 +0200, Petr Jelinek wrote: > On 02/06/17 20:51, Andres Freund wrote: > > I don't understand why the new block is there, nor does the commit > > message explain it. > > > > Hmm, that particular change can actually be reverted. It was needed for > one those custom

Re: [HACKERS] Error while creating subscription when server is running in single user mode

2017-06-02 Thread Andres Freund
On 2017-06-02 15:00:21 -0400, Peter Eisentraut wrote: > On 6/1/17 21:55, Andres Freund wrote: > > On 2017-06-01 21:42:41 -0400, Peter Eisentraut wrote: > >> We should look at what the underlying problem is before we prohibit > >> anything at a high level. > > > > I'm not sure there's any

Re: [HACKERS] Create subscription with `create_slot=false` and incorrect slot name

2017-06-02 Thread Peter Eisentraut
On 6/1/17 08:20, Petr Jelinek wrote: > I think the combination of those patches is probably good enough > solution for PG10 (I never understood the need for name validation in > ReplicationSlotAcquire() anyway). I have committed these two patches and will close this open item. -- Peter

Re: [HACKERS] proposal: PLpgSQL parallel assignemnt

2017-06-02 Thread Pavel Stehule
2017-06-02 19:05 GMT+02:00 Pavel Stehule : > > > 2017-06-02 10:15 GMT+02:00 Pavel Stehule : > >> >> >> 2017-06-02 10:06 GMT+02:00 Craig Ringer : >> >>> On 2 June 2017 at 15:51, Pavel Stehule wrote:

Re: [HACKERS] TAP: allow overriding PostgresNode in get_new_node

2017-06-02 Thread Chapman Flack
On 06/02/2017 12:50 PM, Robert Haas wrote: > On Thu, Jun 1, 2017 at 3:36 AM, Michael Paquier >> >> +$pgnclass = 'PostgresNode' unless defined $pgnclass; >> I'd rather leave any code of this kind for the module maintainers, > > Craig's proposal is a standard Perl idiom, though. Would it not

Re: [HACKERS] logical replication - still unstable after all these months

2017-06-02 Thread Petr Jelinek
On 02/06/17 08:55, Mark Kirkwood wrote: > On 02/06/17 17:11, Erik Rijkers wrote: > >> On 2017-06-02 00:46, Mark Kirkwood wrote: >>> On 31/05/17 21:16, Petr Jelinek wrote: >>> >>> I'm seeing a new failure with the patch applied - this time the >>> history table has missing rows. Petr, I'll put

Re: [HACKERS] Why does logical replication launcher set application_name?

2017-06-02 Thread Petr Jelinek
On 02/06/17 21:05, Peter Eisentraut wrote: > On 6/2/17 02:31, Masahiko Sawada wrote: >> I'd say current patch makes the user difficult to >> distinguish between apply worker and table sync worker. > > We could arguably make apply workers and sync workers have different > bgw_type values. But if

Re: [HACKERS] statement_timeout is not working as expected with postgres_fdw

2017-06-02 Thread Robert Haas
On Fri, Jun 2, 2017 at 3:48 AM, Rafia Sabih wrote: > I tried following the sketch stated above, and here's what I added to > v2 of the patch. In begin_remote_xact when savepoint is send to the > remote server through do_sql_command I set the changing_xact_state >

Re: [HACKERS] Error while creating subscription when server is running in single user mode

2017-06-02 Thread Tom Lane
Peter Eisentraut writes: > My point is that we shouldn't be putting checks into DDL commands about > single-user mode if the actual cause of the issue is in a lower-level > system. Not all uses of a particular DDL command necessary use a latch, > for example.

Re: [HACKERS] TAP: allow overriding PostgresNode in get_new_node

2017-06-02 Thread J Chapman Flack
On 06/02/2017 12:50 PM, Robert Haas wrote: > On Thu, Jun 1, 2017 at 3:36 AM, Michael Paquier >> >> +$pgnclass = 'PostgresNode' unless defined $pgnclass; >> I'd rather leave any code of this kind for the module maintainers, > > Craig's proposal is a standard Perl idiom, though. Would it not

Re: [HACKERS] Adding support for Default partition in partitioning

2017-06-02 Thread Robert Haas
On Thu, Jun 1, 2017 at 3:35 PM, Jeevan Ladhe wrote: > Please let me know if I have missed anything and any further comments. + errmsg("a default partition \"%s\" already exists", I suggest: partition \"%s\" conflicts with existing default

Re: [HACKERS] PostgreSQL 10 changes in exclusion constraints - did something change? CASE WHEN behavior oddity

2017-06-02 Thread Tom Lane
Andres Freund writes: > On 2017-05-28 14:03:26 -0400, Tom Lane wrote: >> I think it would be possible to teach eval_const_expressions that >> it must not discard CASE/COALESCE subexpressions that contain SRFs, >> which would preserve the rule that expression simplification

Re: [HACKERS] Why does logical replication launcher set application_name?

2017-06-02 Thread Peter Eisentraut
On 6/2/17 15:08, Peter Eisentraut wrote: > On 5/30/17 23:10, Peter Eisentraut wrote: >> Here is a proposed solution that splits bgw_name into bgw_type and >> bgw_name_extra. bgw_type shows up in pg_stat_activity.backend_type. >> Uses of application_name are removed, because they are no longer >>

Re: [HACKERS] PG10 transition tables, wCTEs and multiple operations on the same table

2017-06-02 Thread Thomas Munro
On Sat, Jun 3, 2017 at 1:20 AM, Thomas Munro wrote: > On Sat, Jun 3, 2017 at 12:10 AM, Thomas Munro > wrote: >> I would have expected that to be handled by separate transition tables >> at different query levels, but evidently it

Re: [HACKERS] Why does logical replication launcher set application_name?

2017-06-02 Thread Peter Eisentraut
On 6/2/17 16:44, Petr Jelinek wrote: > However, I am not sure about the bgw_name_extra. I think I would have > preferred keeping full bgw_name field which would be used where full > name is needed and bgw_type where only the worker type is used. The > concatenation just doesn't sit well with me,

Re: [HACKERS] walsender & parallelism

2017-06-02 Thread Andres Freund
On 2017-06-02 23:27:55 -0400, Peter Eisentraut wrote: > On 5/31/17 23:54, Peter Eisentraut wrote: > > On 5/29/17 22:01, Noah Misch wrote: > >> On Tue, May 23, 2017 at 01:45:59PM -0400, Andres Freund wrote: > >>> On May 23, 2017 1:42:41 PM EDT, Petr Jelinek > >>>

Re: [HACKERS] logical replication and PANIC during shutdown checkpoint in publisher

2017-06-02 Thread Andres Freund
On 2017-06-01 17:29:12 -0700, Andres Freund wrote: > On 2017-06-02 08:38:51 +0900, Michael Paquier wrote: > > On Fri, Jun 2, 2017 at 7:05 AM, Andres Freund wrote: > > > I'm a unhappy how this is reusing SIGINT for WalSndLastCycleHandler. > > > Normally INT is used cancel

Re: [HACKERS] Error while creating subscription when server is running in single user mode

2017-06-02 Thread Peter Eisentraut
On 6/2/17 15:24, Andres Freund wrote: > but that doesn't really solve the issue that > logical rep pretty essentially requires multiple processes. But it may be sensible to execute certain DDL commands for repair, which is why I'm arguing for a finer-grained approach than just prohibiting

Re: [HACKERS] PostgreSQL 10 changes in exclusion constraints - did something change? CASE WHEN behavior oddity

2017-06-02 Thread Andres Freund
Hi, On 2017-06-02 22:53:00 -0400, Tom Lane wrote: > I think you've got enough on your plate. I can take care of whatever > we decide to do here. Thanks. > Andres Freund writes: > >> Another possibility is to say that we've broken this situation > >> irretrievably and we

Re: [HACKERS] Server ignores contents of SASLInitialResponse

2017-06-02 Thread Noah Misch
On Tue, May 30, 2017 at 03:04:47AM +, Noah Misch wrote: > On Thu, May 25, 2017 at 10:52:23AM -0400, Michael Paquier wrote: > > On Thu, May 25, 2017 at 9:32 AM, Michael Paquier > > wrote: > > > On Thu, May 25, 2017 at 8:51 AM, Heikki Linnakangas >

Re: [HACKERS] Error while creating subscription when server is running in single user mode

2017-06-02 Thread Peter Eisentraut
On 6/2/17 15:41, Tom Lane wrote: > It's certainly plausible that we could have the latch code just ignore > WL_POSTMASTER_DEATH if not IsUnderPostmaster. I think that the original > reasoning for not doing that was that the calling code should know which > environment it's in, and not pass an

Re: [HACKERS] logical replication - still unstable after all these months

2017-06-02 Thread Mark Kirkwood
On 03/06/17 11:10, Petr Jelinek wrote: On 02/06/17 22:29, Petr Jelinek wrote: On 02/06/17 08:55, Mark Kirkwood wrote: On 02/06/17 17:11, Erik Rijkers wrote: On 2017-06-02 00:46, Mark Kirkwood wrote: On 31/05/17 21:16, Petr Jelinek wrote: I'm seeing a new failure with the patch applied -

Re: [HACKERS] PostgreSQL 10 changes in exclusion constraints - did something change? CASE WHEN behavior oddity

2017-06-02 Thread Andres Freund
Hi, On 2017-05-28 14:03:26 -0400, Tom Lane wrote: > I think it would be possible to teach eval_const_expressions that > it must not discard CASE/COALESCE subexpressions that contain SRFs, > which would preserve the rule that expression simplification doesn't > change the query semantics. That

Re: [HACKERS] logical replication - still unstable after all these months

2017-06-02 Thread Petr Jelinek
On 03/06/17 04:45, Mark Kirkwood wrote: > On 03/06/17 11:10, Petr Jelinek wrote: > >> On 02/06/17 22:29, Petr Jelinek wrote: >>> On 02/06/17 08:55, Mark Kirkwood wrote: On 02/06/17 17:11, Erik Rijkers wrote: > On 2017-06-02 00:46, Mark Kirkwood wrote: >> On 31/05/17 21:16, Petr

Re: [HACKERS] logical replication busy-waiting on a lock

2017-06-02 Thread Petr Jelinek
On 03/06/17 03:25, Andres Freund wrote: > >> That should solve the original problem reported here. > > Did you verify that? > Yes, I tried to manually create multiple exported logical decoding snapshots in parallel and read data from them and it worked fine, while it blocked before. > >> @@

Re: [HACKERS] logical replication busy-waiting on a lock

2017-06-02 Thread Petr Jelinek
On 02/06/17 03:38, Robert Haas wrote: > On Thu, Jun 1, 2017 at 2:28 PM, Andres Freund wrote: >> On 2017-06-01 14:17:44 +0200, Petr Jelinek wrote: >>> Thinking more about this, I am not convinced it's a good idea to change >>> exports this late in the cycle. I still think it's

Re: [HACKERS] logical replication busy-waiting on a lock

2017-06-02 Thread Andres Freund
Hi, On 2017-06-03 03:03:20 +0200, Petr Jelinek wrote: > All right, here is my rough attempt on doing what Andres has suggested, > going straight from xid to vxid, seems to work fine in my tests and > parallel pg_dump seems happy with it as well. Cool! > The second patch removes the xid

Re: [HACKERS] walsender & parallelism

2017-06-02 Thread Noah Misch
On Fri, Jun 02, 2017 at 11:27:55PM -0400, Peter Eisentraut wrote: > On 5/31/17 23:54, Peter Eisentraut wrote: > > On 5/29/17 22:01, Noah Misch wrote: > >> On Tue, May 23, 2017 at 01:45:59PM -0400, Andres Freund wrote: > >>> On May 23, 2017 1:42:41 PM EDT, Petr Jelinek > >>>

  1   2   >