Re: [HACKERS] Logical replication and inheritance

2017-04-16 Thread Amit Langote
On 2017/04/15 3:53, Peter Eisentraut wrote: > On 4/13/17 06:48, Amit Langote wrote: >> That is an important consideration because of pg_dump. See below: >> >> create table foo (a int); >> create table bar () inherits (foo); >> create publication mypub for table foo; -- bar is added too. >> >> $

Re: [HACKERS] Variable substitution in psql backtick expansion

2017-04-16 Thread Pavel Stehule
2017-04-17 1:00 GMT+02:00 Fabien COELHO : > > I checked the pgbench expr related code. >> > > 2. move pgbench expressions to separate module >> > > Probably already existing "fe_utils". > > 3. teach pgbench expressions booleans >> > > See

Re: [HACKERS] Inadequate parallel-safety check for SubPlans

2017-04-16 Thread Tom Lane
Amit Kapila writes: > On Sun, Apr 16, 2017 at 9:30 PM, Tom Lane wrote: >> FYI, I have this on my to-look-at list, and expect to fix it before Robert >> returns from vacation. > Let me know if an initial patch by someone else can be helpful? Sure,

Re: [HACKERS] tablesync patch broke the assumption that logical rep depends on?

2017-04-16 Thread Noah Misch
On Thu, Apr 13, 2017 at 04:56:05AM +, Noah Misch wrote: > On Tue, Apr 11, 2017 at 02:28:44AM +0900, Fujii Masao wrote: > > src/backend/replication/logical/launcher.c > > * Worker started and attached to our shmem. This check is safe > > * because only launcher ever

Re: [HACKERS] Allowing extended stats on foreign and partitioned tables

2017-04-16 Thread Ashutosh Bapat
On Sat, Apr 15, 2017 at 5:27 AM, Peter Eisentraut wrote: > On 4/10/17 06:18, Ashutosh Bapat wrote: >> This isn't exactly about this particular thread. But I noticed, that >> after we introduced RELKIND_PARTITIONED_TABLE, we required to change a >> number of

Re: [HACKERS] Inadequate parallel-safety check for SubPlans

2017-04-16 Thread Amit Kapila
On Sun, Apr 16, 2017 at 9:30 PM, Tom Lane wrote: > Noah Misch writes: >> On Wed, Apr 12, 2017 at 02:41:09PM -0400, Tom Lane wrote: >>> This is 100% wrong. It's failing to recurse into the subexpressions of >>> the SubPlan, which could very easily include

Re: [HACKERS] PANIC in pg_commit_ts slru after crashes

2017-04-16 Thread Michael Paquier
On Sun, Apr 16, 2017 at 6:02 PM, Simon Riggs wrote: > On 15 April 2017 at 21:30, Jeff Janes wrote: >> On Fri, Apr 14, 2017 at 9:33 PM, Pavan Deolasee >> wrote: >> >>> >>> Since all those offsets fall on a page boundary, my

Re: [HACKERS] Shouldn't duplicate addition to publication be a no-op?

2017-04-16 Thread Amit Langote
On 2017/04/15 8:53, Peter Eisentraut wrote: > On 4/13/17 06:23, Amit Langote wrote: >> create table bar (a int); >> create publication mypub for table bar; >> alter publication mypub add table bar; >> ERROR: relation "bar" is already member of publication "mypub" >> >> 2nd command should be a

Re: [HACKERS] Should pg_current_wal_location() become pg_current_wal_lsn()

2017-04-16 Thread Kyotaro HORIGUCHI
At Fri, 14 Apr 2017 18:26:37 -0400, Peter Eisentraut wrote in <052f4ce0-159a-1666-f136-91977d326...@2ndquadrant.com> > On 4/14/17 04:28, Kyotaro HORIGUCHI wrote: > > =# select distinct attname from pg_attribute where attname like '%lsn%'; > >attname

Re: [HACKERS] Cutting initdb's runtime (Perl question embedded)

2017-04-16 Thread Andrew Dunstan
On 04/16/2017 07:43 PM, Peter Eisentraut wrote: > On 4/15/17 12:33, Andrew Dunstan wrote: >> Sure. Just means putting this code a bit later in the file. "make check" >> is only one initdb, so it won't cost much. I'm still inclined to force a >> TAP test for initdb with no TZ set, though. > How

Re: [HACKERS] Comment typo in xlogutils.c

2017-04-16 Thread Peter Eisentraut
On 4/15/17 11:26, Masahiko Sawada wrote: > Attached patch for $subject. > > s/apruptly/abruptly Fixed, thanks. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Inadequate parallel-safety check for SubPlans

2017-04-16 Thread Robert Haas
On Mon, Apr 17, 2017 at 1:24 AM, Tom Lane wrote: > Amit Kapila writes: >> On Sun, Apr 16, 2017 at 9:30 PM, Tom Lane wrote: >>> FYI, I have this on my to-look-at list, and expect to fix it before Robert >>> returns from vacation. >

Re: [HACKERS] OpenSSL 1.1 breaks configure and more

2017-04-16 Thread Andreas Karlsson
On 04/16/2017 03:14 AM, Tom Lane wrote: 1. Back-patch that patch, probably also including the followup adjustments in 86029b31e and 36a3be654. 2. Add #if's to use 31cf1a1a4's coding with OpenSSL >= 1.1, while keeping the older code for use when built against older OpenSSLs. 3.

Re: [HACKERS] tablesync patch broke the assumption that logical rep depends on?

2017-04-16 Thread Petr Jelinek
On 16/04/17 21:27, Steve Singer wrote: > On 04/10/2017 01:28 PM, Fujii Masao wrote: >> Hi, >> >> src/backend/replication/logical/launcher.c >> * Worker started and attached to our shmem. This check is safe >> * because only launcher ever starts the workers, so nobody

Re: [HACKERS] Shouldn't duplicate addition to publication be a no-op?

2017-04-16 Thread Robert Haas
On Sun, Apr 16, 2017 at 11:58 PM, Amit Langote wrote: > By the way, Petr said in the other thread that it could be made a no-op > (presumably without requiring IF NOT EXISTS) on the grounds that > membership of table in publication is "soft object" or "property"

Re: [HACKERS] snapbuild woes

2017-04-16 Thread Noah Misch
On Thu, Apr 13, 2017 at 12:58:12AM -0400, Noah Misch wrote: > On Wed, Apr 12, 2017 at 10:21:51AM -0700, Andres Freund wrote: > > On 2017-04-12 11:03:57 -0400, Peter Eisentraut wrote: > > > On 4/12/17 02:31, Noah Misch wrote: > > > >>> But I hope you mean to commit these snapbuild patches before

Re: [HACKERS] Logical replication launcher uses wal_retrieve_retry_interval

2017-04-16 Thread Masahiko Sawada
On Fri, Apr 14, 2017 at 9:59 PM, Petr Jelinek wrote: > On 14/04/17 14:30, Michael Paquier wrote: >> On Fri, Apr 14, 2017 at 9:19 PM, Petr Jelinek >> wrote: >>> I am not quite sure adding more GUCs is all that great option. When >>>

[HACKERS] pgbench tap tests & minor fixes

2017-04-16 Thread Fabien COELHO
Hello, When developping new features for pgbench, I usually write some tests which are lost when the feature is committed. Given that I have submitted some more features and that part of pgbench code may be considered for sharing with pgsql, I think that improving the abysmal state of tests

Re: [HACKERS] Should pg_current_wal_location() become pg_current_wal_lsn()

2017-04-16 Thread Kyotaro HORIGUCHI
At Sat, 15 Apr 2017 12:56:32 -0400, Robert Haas wrote in > On Fri, Apr 14, 2017 at 6:52 PM, Tom Lane wrote: > > Peter Eisentraut writes: > >> If

Re: [HACKERS] OpenSSL 1.1 breaks configure and more

2017-04-16 Thread Tom Lane
Andreas Karlsson writes: > On 04/16/2017 03:14 AM, Tom Lane wrote: >> 1. Back-patch that patch, probably also including the followup adjustments >> in 86029b31e and 36a3be654. > Given that I cannot recall seeing any complaints about the behavior of > 9.4 compared to 9.3 I am

Re: [HACKERS] Variable substitution in psql backtick expansion

2017-04-16 Thread Fabien COELHO
I checked the pgbench expr related code. 2. move pgbench expressions to separate module Probably already existing "fe_utils". 3. teach pgbench expressions booleans See https://commitfest.postgresql.org/14/985/ -- Fabien. -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Cutting initdb's runtime (Perl question embedded)

2017-04-16 Thread Peter Eisentraut
On 4/15/17 12:33, Andrew Dunstan wrote: > Sure. Just means putting this code a bit later in the file. "make check" > is only one initdb, so it won't cost much. I'm still inclined to force a > TAP test for initdb with no TZ set, though. How much is this going to buy overall? Is it worth the

Re: [HACKERS] Inadequate parallel-safety check for SubPlans

2017-04-16 Thread Tom Lane
Noah Misch writes: > On Wed, Apr 12, 2017 at 02:41:09PM -0400, Tom Lane wrote: >> This is 100% wrong. It's failing to recurse into the subexpressions of >> the SubPlan, which could very easily include parallel-unsafe function >> calls. Example: > The above-described topic is

Re: [HACKERS] Quorum commit for multiple synchronous replication.

2017-04-16 Thread Fujii Masao
On Sun, Apr 16, 2017 at 1:19 PM, Noah Misch wrote: > On Fri, Apr 14, 2017 at 11:58:23PM -0400, Noah Misch wrote: >> On Wed, Apr 05, 2017 at 09:51:02PM -0400, Noah Misch wrote: >> > On Thu, Apr 06, 2017 at 12:48:56AM +0900, Fujii Masao wrote: >> >> > > > On Mon, Dec 19, 2016 at

Re: [HACKERS] pg_dump emits ALTER TABLE ONLY partitioned_table

2017-04-16 Thread Noah Misch
On Thu, Apr 13, 2017 at 11:38:08AM -0400, Robert Haas wrote: > On Thu, Apr 13, 2017 at 11:05 AM, Stephen Frost wrote: > > Sure, though I won't be able to today and I've got some doubts about the > > other patches. I'll have more time tomorrow though. > > OK, cool. I'll mark

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

2017-04-16 Thread Noah Misch
On Wed, Apr 12, 2017 at 10:55:08PM +0900, Fujii Masao wrote: > When I shut down the publisher while I repeated creating and dropping > the subscription in the subscriber, the publisher emitted the following > PANIC error during shutdown checkpoint. > > PANIC: concurrent transaction log activity

Re: [HACKERS] some review comments on logical rep code

2017-04-16 Thread Noah Misch
On Fri, Apr 14, 2017 at 04:47:12AM +0900, Fujii Masao wrote: > Though I've read only a part of the logical rep code yet, I'd like to > share some (relatively minor) review comments that I got so far. > > In ApplyWorkerMain(), DatumGetInt32() should be used to get integer > value from the

Re: [HACKERS] Logical replication - TRAP: FailedAssertion in pgstat.c

2017-04-16 Thread Erik Rijkers
On 2017-04-15 04:47, Erik Rijkers wrote: 0001-Reserve-global-xmin-for-create-slot-snasphot-export.patch + 0002-Don-t-use-on-disk-snapshots-for-snapshot-export-in-l.patch+ 0003-Prevent-snapshot-builder-xmin-from-going-backwards.patch + 0004-Fix-xl_running_xacts-usage-in-snapshot-builder.patch

Re: [HACKERS] Interval for launching the table sync worker

2017-04-16 Thread Noah Misch
On Thu, Apr 06, 2017 at 11:33:22AM +0900, Masahiko Sawada wrote: > While testing table sync worker for logical replication I noticed that > if the table sync worker of logical replication failed to insert the > data for whatever reason, the table sync worker process exits with > error. And then

Re: [HACKERS] Inadequate parallel-safety check for SubPlans

2017-04-16 Thread Noah Misch
On Wed, Apr 12, 2017 at 02:41:09PM -0400, Tom Lane wrote: > While poking at the question of parallel_safe marking for Plans, > I noticed that max_parallel_hazard_walker() does this: > > /* We can push the subplans only if they are parallel-safe. */ > else if (IsA(node, SubPlan)) >

Re: [HACKERS] PANIC in pg_commit_ts slru after crashes

2017-04-16 Thread Simon Riggs
On 15 April 2017 at 21:30, Jeff Janes wrote: > On Fri, Apr 14, 2017 at 9:33 PM, Pavan Deolasee > wrote: > >> >> Since all those offsets fall on a page boundary, my guess is that we're >> somehow failing to handle a new page correctly. >> >> Looking

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

2017-04-16 Thread Tom Lane
Craig Ringer writes: > On 12 April 2017 at 13:34, Kuntal Ghosh wrote: >> For backend_type=background worker, application_name shows the name of >> the background worker (BackgroundWorker->bgw_name). I think we need >> some way to distinguish

Re: [HACKERS] Variable substitution in psql backtick expansion

2017-04-16 Thread Pavel Stehule
2017-04-12 1:42 GMT+02:00 Fabien COELHO : > > Hmmm. Although I do not buy this, it could work as a replacement for \set >>> which it seems cannot be upgraded because some people may rely on it to >>> just store whatever comes after it in a variable. >>> >> >> I have no strong

Re: [HACKERS] Logical replication - TRAP: FailedAssertion in pgstat.c

2017-04-16 Thread Andres Freund
On 2017-04-16 10:46:21 +0200, Erik Rijkers wrote: > On 2017-04-15 04:47, Erik Rijkers wrote: > > > > 0001-Reserve-global-xmin-for-create-slot-snasphot-export.patch + > > 0002-Don-t-use-on-disk-snapshots-for-snapshot-export-in-l.patch+ > >

Re: [HACKERS] tablesync patch broke the assumption that logical rep depends on?

2017-04-16 Thread Steve Singer
On 04/10/2017 01:28 PM, Fujii Masao wrote: Hi, src/backend/replication/logical/launcher.c * Worker started and attached to our shmem. This check is safe * because only launcher ever starts the workers, so nobody can steal * the worker slot. The tablesync

Re: [HACKERS] Logical replication - TRAP: FailedAssertion in pgstat.c

2017-04-16 Thread Petr Jelinek
On 16/04/17 20:41, Andres Freund wrote: > On 2017-04-16 10:46:21 +0200, Erik Rijkers wrote: >> On 2017-04-15 04:47, Erik Rijkers wrote: >>> >>> 0001-Reserve-global-xmin-for-create-slot-snasphot-export.patch + >>> 0002-Don-t-use-on-disk-snapshots-for-snapshot-export-in-l.patch+ >>>

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

2017-04-16 Thread Petr Jelinek
On 16/04/17 18:47, Tom Lane wrote: > Craig Ringer writes: >> On 12 April 2017 at 13:34, Kuntal Ghosh wrote: >>> For backend_type=background worker, application_name shows the name of >>> the background worker (BackgroundWorker->bgw_name). I