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

2017-06-06 Thread Amit Langote
On 2017/06/07 1:19, Robert Haas wrote: > On Mon, Jun 5, 2017 at 1:02 AM, Amit Langote > wrote: >> On 2017/06/03 1:56, Robert Haas wrote: >>> On Fri, Jun 2, 2017 at 12:51 AM, Amit Langote >>> wrote: Attached patch makes

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

2017-06-06 Thread Peter Eisentraut
On 6/6/17 15:58, Robert Haas wrote: > The problem with the status quo (after Peter's commit) is that there's > now nothing at all to identify the logical replication launcher, apart > from the wait_event field, which is likely to be LogicalLauncherMain > fairly often if you've got the launcher. I

[HACKERS] Notes on testing Postgres 10b1

2017-06-06 Thread Josh Berkus
Folks, I've put together some demos on PostgreSQL 10beta1. Here's a few feedback notes based on my experience with it. Things I tested * Logical replication pub/sub with replicating only two tables out of a 12-table FK heirarchy, including custom data types * Partitioning a

Re: [HACKERS] Notes on testing Postgres 10b1

2017-06-06 Thread Andres Freund
On 2017-06-07 14:29:04 +0900, Michael Paquier wrote: > On Wed, Jun 7, 2017 at 2:01 PM, Josh Berkus wrote: > > Q1. Why does wal_level default to "replica" and not "logical"? > > The difference of WAL generated is way higher between > archive->hot_standby than

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

2017-06-06 Thread amul sul
On Wed, Jun 7, 2017 at 2:08 AM, Jeevan Ladhe wrote: [...] >> >> The code in check_default_allows_bound() to check whether the default >> partition >> has any rows that would fit new partition looks quite similar to the code >> in >> ATExecAttachPartition() checking

Re: [HACKERS] PG 10 release notes

2017-06-06 Thread Neha Khatri
On Mon, May 15, 2017 at 12:45 PM, Bruce Momjian wrote: > On Thu, May 11, 2017 at 11:50:03PM -0400, Tom Lane wrote: > > Michael Paquier writes: > > > Bruce, the release notes do not mention yet that support for cleartext > > > passwords is removed.

Re: [HACKERS] Fix tab-completion of ALTER SUBSCRIPTION SET PUBLICATION

2017-06-06 Thread Peter Eisentraut
On 6/6/17 04:17, Masahiko Sawada wrote: > With this patch, ALTER SUBSCRIPTION SET PUBLICATION [TAB] > completes with "REFRESH" and "SKIP REFRESH". > Specifying either REFRESH or SKIP REFRESH is mandatory after ALTER > SUBSCRIPTION SET PUBLICATION, so i think it's good to add this. That syntax

Re: [HACKERS] Fix tab-completion of ALTER SUBSCRIPTION SET PUBLICATION

2017-06-06 Thread Masahiko Sawada
On Wed, Jun 7, 2017 at 12:41 PM, Peter Eisentraut wrote: > On 6/6/17 04:17, Masahiko Sawada wrote: >> With this patch, ALTER SUBSCRIPTION SET PUBLICATION [TAB] >> completes with "REFRESH" and "SKIP REFRESH". >> Specifying either REFRESH or SKIP REFRESH is

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

2017-06-06 Thread Andres Freund
On 2017-06-06 19:36:13 +0200, Petr Jelinek wrote: > So the fact that we moved workers to standard interrupt handling broke > launcher in subtle ways because it still uses it's own SIGTERM handling > but some function it calls are using CHECK_FOR_INTERRUPTS (they are used > by worker as well). I

Re: [HACKERS] Parallel Aggregation support for aggregate functions that use transitions not implemented for array_agg

2017-06-06 Thread Peter Eisentraut
On 6/6/17 13:52, Regina Obe wrote: > It seems CREATE AGGREGATE was expanded in 9.6 to support parallelization of > aggregate functions using transitions, with the addition of serialfunc and > deserialfunc to the aggregate definitions. > >

Re: [HACKERS] Is ECPG's SET CONNECTION really not thread-aware?

2017-06-06 Thread Tsunakawa, Takayuki
From: pgsql-hackers-ow...@postgresql.org > [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Michael Meskes > I'm pretty sure it is indeed thread-aware, although I didn't provide the > code for this feature myself. > > > So the doc seems to need fix. The patch is attached. > > Thanks,

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

2017-06-06 Thread Jeevan Ladhe
IIUC, default partition constraints is simply NOT IN ( other sibling partitions>). > If constraint on the default partition refutes the new partition's > constraints that means we have overlapping partition, and perhaps > error. > You are correct Amul, but this error will be thrown before we try

Re: [HACKERS] Parallel Aggregation support for aggregate functions that use transitions not implemented for array_agg

2017-06-06 Thread Andres Freund
On 2017-06-07 00:03:15 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2017-06-06 23:32:53 -0400, Peter Eisentraut wrote: > >> I'm not sure how you would parallelize these, since in most uses you > >> want to have a deterministic output order. > > > Unless you specify

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

2017-06-06 Thread Thomas Munro
On Wed, Jun 7, 2017 at 9:42 AM, Robert Haas wrote: > I think I'd like to walk back my earlier statements about reverting > this patch just a little bit. Although putting the tuplestore at the > wrong level does seem like a fairly significant design mistake, Thomas > more

Re: [HACKERS] tap tests on older branches fail if concurrency is used

2017-06-06 Thread Michael Paquier
On Wed, May 31, 2017 at 8:45 PM, Craig Ringer wrote: > On 1 June 2017 at 08:15, Andres Freund wrote: >> Hi, >> >> when using >> $ cat ~/.proverc >> -j9 >> >> some tests fail for me in 9.4 and 9.5. E.g. src/bin/script's tests >> yields a lot of fun

Re: [HACKERS] inconsistent application_name use in logical workers

2017-06-06 Thread Peter Eisentraut
On 6/6/17 13:24, Petr Jelinek wrote: > On 06/06/17 15:07, Peter Eisentraut wrote: >> On 6/6/17 06:51, Petr Jelinek wrote: >>> On 06/06/17 04:19, Peter Eisentraut wrote: The logical replication code is supposed to use the subscription name as the fallback_application_name, but in some

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

2017-06-06 Thread Amit Langote
On 2017/06/07 11:57, Amit Langote wrote: > How about we export ExecPartitionCheck() out of execMain.c and call it > just before ExecFindPartition() using the root table's ResultRelInfo? Turns out there wasn't a need to export ExecPartitionCheck after all. Instead of calling it from

Re: [HACKERS] tap tests on older branches fail if concurrency is used

2017-06-06 Thread Michael Paquier
On Thu, Jun 1, 2017 at 10:48 PM, Tom Lane wrote: > Andres Freund writes: >> when using >> $ cat ~/.proverc >> -j9 >> some tests fail for me in 9.4 and 9.5. > > Weren't there fixes specifically intended to make that safe, awhile ago? 60f826c has not been

Re: [HACKERS] Default Partition for Range

2017-06-06 Thread Beena Emerson
Hello Dilip, On Mon, Jun 5, 2017 at 8:44 PM, Dilip Kumar wrote: > On Mon, Jun 5, 2017 at 1:43 AM, Beena Emerson wrote: >> The new patch is rebased over default_partition_v18.patch >>

Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256

2017-06-06 Thread Michael Paquier
On Fri, Jun 2, 2017 at 10:25 AM, Robert Haas wrote: > On Thu, Jun 1, 2017 at 9:13 PM, Michael Paquier > wrote: >> It seems to me that any testing in this area won't fly high as long as >> there is no way to enforce the list of TLS implementations

Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256

2017-06-06 Thread Michael Paquier
On Fri, Jun 2, 2017 at 10:08 AM, Stephen Frost wrote: > I don't have any issue with asking that Michael, or someone, to go look > at other OpenSSL-using implementations which support channel binding. I don't see the implementation of other TLS/SSL as a requirement for channel

Re: [HACKERS] [POC] hash partitioning

2017-06-06 Thread amul sul
Hi Dilip, Thanks for review. On Sat, Jun 3, 2017 at 6:54 PM, Dilip Kumar wrote: > On Thu, May 25, 2017 at 9:59 AM, amul sul wrote: >> On Mon, May 22, 2017 at 2:23 PM, amul sul wrote: >>> >>> Updated patch attached. Thanks a lot for

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

2017-06-06 Thread Alvaro Herrera
Andres Freund wrote: > FWIW, allowing UNLOGGED tables, rather than just TEMPORARY ones, > increases the complexity of that project noticeably. For TEMPORARY you > basically don't need to do much but to recreate the structure inside the > tablespace at start - fairly simple. But for UNLOGGED you

Re: [HACKERS] [POC] hash partitioning

2017-06-06 Thread Dilip Kumar
On Tue, Jun 6, 2017 at 2:41 PM, Amit Langote wrote: > Consider an example using the partition hierarchy: > > root (a int, b char, c int) partition by range (a) > > -> level1 from (1) to (10) partition by list (b) > > -> level2 in ('a') parition by range (c) >

[HACKERS] Fix tab-completion of ALTER SUBSCRIPTION SET PUBLICATION

2017-06-06 Thread Masahiko Sawada
Hi, Attached patch for $subject. With this patch, ALTER SUBSCRIPTION SET PUBLICATION [TAB] completes with "REFRESH" and "SKIP REFRESH". Specifying either REFRESH or SKIP REFRESH is mandatory after ALTER SUBSCRIPTION SET PUBLICATION, so i think it's good to add this. Regards, -- Masahiko

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

2017-06-06 Thread Masahiko Sawada
On Sun, Jun 4, 2017 at 1:53 AM, Peter Eisentraut wrote: > On 6/2/17 14:52, Peter Eisentraut wrote: >> 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

Re: [HACKERS] [POC] hash partitioning

2017-06-06 Thread Amit Langote
On 2017/06/06 17:50, Dilip Kumar wrote: > On Tue, Jun 6, 2017 at 1:03 PM, amul sul wrote: >> May I ask you, how you sure about 8 is an unfit value for t1 relation? >> And what if the value other than 8, for e.g. 7? > > Well, First I created t1 as a leaf relation like below,

Re: [HACKERS] Proposal : For Auto-Prewarm.

2017-06-06 Thread Neha Sharma
Hi, I have been testing this feature for a while and below are the observations for few scenarios. *Observation:* scenario 1: If we set pg_prewarm.dump_interval = -1.0,we get an additional warning message in logfile and instead of ending the task of auto-dump it executes successfully.

Re: [HACKERS] [POC] hash partitioning

2017-06-06 Thread Dilip Kumar
On Tue, Jun 6, 2017 at 1:03 PM, amul sul wrote: > May I ask you, how you sure about 8 is an unfit value for t1 relation? > And what if the value other than 8, for e.g. 7? Well, First I created t1 as a leaf relation like below, and I tested insert into t1 with value 8 and it

Re: [HACKERS] question about replication docs

2017-06-06 Thread Peter Eisentraut
On 5/29/17 09:11, Dave Cramer wrote: > The following makes an explicit reference to the simple query protocol > being the only protocol allowed in walsender mode. It is my > understanding this is true for logical replication as well ?? It's the same thing (for this purpose). -- Peter Eisentraut

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

2017-06-06 Thread Sven R. Kunze
On 06.06.2017 14:31, Bruce Momjian wrote: On Tue, Jun 6, 2017 at 04:39:50AM -0300, Alvaro Herrera wrote: I was thinking that you could create the init fork for each unlogged table in a permanent tablespace (probably the default one for the database). FWIW I don't think calling these

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

2017-06-06 Thread Peter Eisentraut
On 6/6/17 03:39, Alvaro Herrera wrote: > FWIW I don't think calling these tablespaces "temporary" is the right > word. It's not the tablespaces that are temporary. The SQL standard meaning of temporary is that the content goes away. It is only in PostgreSQL that it also means that the object

Re: [HACKERS] Challenges preventing us moving to 64 bit transaction id (XID)?

2017-06-06 Thread Peter Eisentraut
On 6/6/17 08:29, Bruce Momjian wrote: > On Tue, Jun 6, 2017 at 06:00:54PM +0800, Craig Ringer wrote: >> Tom's point is, I think, that we'll want to stay pg_upgrade >> compatible. So when we see a pg10 tuple and want to add a new page >> with a new page header that has an epoch, but the whole page

Re: [HACKERS] inconsistent application_name use in logical workers

2017-06-06 Thread Peter Eisentraut
On 6/6/17 06:51, Petr Jelinek wrote: > On 06/06/17 04:19, Peter Eisentraut wrote: >> The logical replication code is supposed to use the subscription name as >> the fallback_application_name, but in some cases it uses the slot name, >> which could be different. See attached patch to correct this.

Re: [HACKERS] Challenges preventing us moving to 64 bit transaction id (XID)?

2017-06-06 Thread Bruce Momjian
On Tue, Jun 6, 2017 at 09:05:03AM -0400, Peter Eisentraut wrote: > On 6/6/17 08:29, Bruce Momjian wrote: > > On Tue, Jun 6, 2017 at 06:00:54PM +0800, Craig Ringer wrote: > >> Tom's point is, I think, that we'll want to stay pg_upgrade > >> compatible. So when we see a pg10 tuple and want to add

Re: [HACKERS] sketchy partcollation handling

2017-06-06 Thread Robert Haas
On Sun, Jun 4, 2017 at 10:18 PM, Amit Langote wrote: > I think we can call it a bug of StorePartitionKey(). I looked at the > similar code in index_create() (which actually I had originally looked at > for reference when writing the partitioning code in question)

Re: [HACKERS] Extra Vietnamese unaccent rules

2017-06-06 Thread Dang Minh Huong
On Jun 4, 29 Heisei, at 00:48, Bruce Momjian wrote:On Sun, Jun  4, 2017 at 12:43:17AM +0900, Dang Minh Huong wrote:On May 30, 29 Heisei, at 00:22, Dang Minh Huong wrote:On May 29, 29 Heisei, at 10:47, Thomas Munro

Re: [HACKERS] Minor fix for EventCacheLookup()

2017-06-06 Thread Robert Haas
On Tue, Jun 6, 2017 at 12:24 AM, Amit Langote wrote: > It should return NIL when no entry is found in the cache, not NULL. > > Attached patch fixes that. I'm not sure how much value neatnik-ism has in cases like this, but committed. -- Robert Haas EnterpriseDB:

Re: [HACKERS] Update comments in nodeModifyTable.c

2017-06-06 Thread Robert Haas
On Mon, Jun 5, 2017 at 4:45 AM, Etsuro Fujita wrote: > While working on [1], I noticed that the comment in ExecModifyTable: > > * Foreign table updates have a wholerow attribute when the > * relation has an AFTER ROW trigger. > > is

Re: [HACKERS] Extra Vietnamese unaccent rules

2017-06-06 Thread Bruce Momjian
On Wed, Jun 7, 2017 at 12:10:25AM +0900, Dang Minh Huong wrote: > > On Jun 4, 29 Heisei, at 00:48, Bruce Momjian wrote: > Shouldn't you use "or is_letter_with_marks()", instead of "or len(...) > > 1"? Your test might catch something that isn't based on a 'letter' >

Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256

2017-06-06 Thread Robert Haas
On Tue, Jun 6, 2017 at 2:32 AM, Michael Paquier wrote: >>> At the end, >>> everything has been rejected as Postgres enforces the use of the >>> newest one when doing the SSL handshake. >> >> TLS implementations, or TLS versions? What does the TLS version have >> to do

Re: [HACKERS] sketchy partcollation handling

2017-06-06 Thread Kevin Hale Boyes
On 6 June 2017 at 09:19, Robert Haas wrote: > > Thanks. Committed. > The changes to catalogs.sgml has introduced a double "the" in this part of the sentence "this contains the OID of the the collation". The other section already had the double "the".

Re: [HACKERS] Extra Vietnamese unaccent rules

2017-06-06 Thread Man Trieu
2017-06-07 0:31 GMT+09:00 Bruce Momjian : > On Wed, Jun 7, 2017 at 12:10:25AM +0900, Dang Minh Huong wrote: > > > On Jun 4, 29 Heisei, at 00:48, Bruce Momjian wrote: > > Shouldn't you use "or is_letter_with_marks()", instead of "or > len(...) > > >

Re: [HACKERS] sketchy partcollation handling

2017-06-06 Thread Tom Lane
Robert Haas writes: > On Sun, Jun 4, 2017 at 10:18 PM, Amit Langote > wrote: >> BTW, the places which check whether the collation to store a dependency >> for is the database default collation don't need to do that. I mean the >> following

Re: [HACKERS] Extra Vietnamese unaccent rules

2017-06-06 Thread Tom Lane
Bruce Momjian writes: > There seems to be a problem. I can't see a patch dated 2017-06-07 on > the commitfest page: > https://commitfest.postgresql.org/14/1161/ It looks to me like the patch is buried inside a multipart/alternative MIME section. That's evidently causing

Re: [HACKERS] sketchy partcollation handling

2017-06-06 Thread Robert Haas
On Tue, Jun 6, 2017 at 11:37 AM, Kevin Hale Boyes wrote: > On 6 June 2017 at 09:19, Robert Haas wrote: >> Thanks. Committed. > > The changes to catalogs.sgml has introduced a double "the" in this part of > the sentence "this contains the OID of the the

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

2017-06-06 Thread Tom Lane
Robert Haas writes: > I think the idea of retrying process creation (and I definitely agree > with Tom and Magnus that we have to retry process creation, not just > individual mappings) is a good place to start. Now if we find that we > are having to retry frequently, then

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-06 Thread Robert Haas
On Mon, Jun 5, 2017 at 10:40 AM, Andrew Dunstan wrote: > Buildfarm member lorikeet is failing occasionally with a failed > assertion during the select_parallel regression tests like this: > > > 2017-06-03 05:12:37.382 EDT [59327d84.1160:38] LOG: statement:

Re: [HACKERS] Should we standardize on a type for signal handler flags?

2017-06-06 Thread Robert Haas
On Sun, Jun 4, 2017 at 7:21 PM, Andres Freund wrote: > Well, we already have some variables that aren't actually booleans, > although I think all of them are only read not manipulated in signal > handlers (InterruptHoldoffCount etc). So one could argue that there's > no

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

2017-06-06 Thread Peter Geoghegan
On Mon, Jun 5, 2017 at 6:40 PM, Thomas Munro wrote: > After sleeping on it, I don't think we need to make that decision here > though. I think it's better to just move the tuplestores into > ModifyTableState so that each embedded DML statement has its own, and >

Re: [HACKERS] HACKERS[PROPOSAL] split ProcArrayLock into multiple parts

2017-06-06 Thread Jim Van Fleet
Hi Sokolov -- I tried your patch. I only had time for doing a few points on power8. pgbench rw on two sockets is awesome! Keeps getting more throughput as threads are added -- in contrast to base and my prototype. I did not run single socket pgbench. Hammerdb, 1 socket was in the same

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

2017-06-06 Thread Andres Freund
On 2017-06-06 12:53:21 -0700, Andres Freund wrote: > On 2017-06-06 15:48:42 -0400, Robert Haas wrote: > > On Fri, Jun 2, 2017 at 3:24 PM, Andres Freund wrote: > > > Latches work in single user mode, it's just that the new code for some > > > reason uses uninitialized memory as

[HACKERS] Re: [BUGS] BUG #14682: row level security not work with partitioned table

2017-06-06 Thread Joe Conway
On 06/06/2017 02:44 PM, Mike Palmiotto wrote: > On Tue, Jun 6, 2017 at 4:07 PM, Joe Conway wrote: >> On 06/06/2017 11:57 AM, Mike Palmiotto wrote: >>> On Mon, Jun 5, 2017 at 10:36 AM, Robert Haas wrote: On Mon, Jun 5, 2017 at 10:20 AM, Joe Conway

Re: [HACKERS] Parallel Aggregation support for aggregate functions that use transitions not implemented for array_agg

2017-06-06 Thread Regina Obe
> On 6/6/17 13:52, Regina Obe wrote: >> It seems CREATE AGGREGATE was expanded in 9.6 to support >> parallelization of aggregate functions using transitions, with the >> addition of serialfunc and deserialfunc to the aggregate definitions. >> >>

Re: [HACKERS] Notes on testing Postgres 10b1

2017-06-06 Thread Michael Paquier
On Wed, Jun 7, 2017 at 2:01 PM, Josh Berkus wrote: > Q1. Why does wal_level default to "replica" and not "logical"? The difference of WAL generated is way higher between archive->hot_standby than hot_standby->logical. And unlike replica, logical decoding is not something that is

Re: [HACKERS] libpqrcv_PQexec() seems to violate latch protocol

2017-06-06 Thread Petr Jelinek
On 06/06/17 23:17, Andres Freund wrote: > On 2017-06-06 17:14:59 -0400, Tom Lane wrote: >> Andres Freund writes: >>> The function in $subject does: >> >>> ResetLatch(>procLatch); >>> rc = WaitLatchOrSocket(>procLatch, >>>

Re: [HACKERS] libpqrcv_PQexec() seems to violate latch protocol

2017-06-06 Thread Andres Freund
On 2017-06-06 23:24:50 +0200, Petr Jelinek wrote: > On 06/06/17 23:17, Andres Freund wrote: > > Right. I found a couple more instance of similarly iffy, although not > > quite as broken, patterns in launcher.c. It's easy to get this wrong, > > but it's a lot easy if you do it differently

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

2017-06-06 Thread Robert Haas
On Tue, Jun 6, 2017 at 4:25 PM, Kevin Grittner wrote: > Nice as it would be to add a SQL standard feature and advance the > effort to get to incremental maintenance of materialized views, and > much as I really appreciate the efforts Thomas has put into trying > to solve these

Re: [HACKERS] libpqrcv_PQexec() seems to violate latch protocol

2017-06-06 Thread Petr Jelinek
On 06/06/17 23:42, Andres Freund wrote: > On 2017-06-06 23:24:50 +0200, Petr Jelinek wrote: >> On 06/06/17 23:17, Andres Freund wrote: >>> Right. I found a couple more instance of similarly iffy, although not >>> quite as broken, patterns in launcher.c. It's easy to get this wrong, >>> but it's

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

2017-06-06 Thread Petr Jelinek
On 06/06/17 21:09, Robert Haas wrote: > On Tue, Jun 6, 2017 at 3:01 PM, Erik Rijkers wrote: >> Belated apologies all round for the somewhat provocative $subject; but I >> felt at that moment that this item needed some extra attention. > > FWIW, it seemed like a pretty fair

Re: [HACKERS] [BUGS] BUG #14682: row level security not work with partitioned table

2017-06-06 Thread Mike Palmiotto
On Tue, Jun 6, 2017 at 4:07 PM, Joe Conway wrote: > On 06/06/2017 11:57 AM, Mike Palmiotto wrote: >> On Mon, Jun 5, 2017 at 10:36 AM, Robert Haas wrote: >>> On Mon, Jun 5, 2017 at 10:20 AM, Joe Conway wrote: Unless Robert

[HACKERS] Re: GSoC 2017 weekly progress reports ("Explicitly support predicate locks in index access methods besides b-tree")

2017-06-06 Thread Kevin Grittner
On Mon, Jun 5, 2017 at 12:40 PM, Shubham Barai wrote: > GSoC (week 1) > 4. went through source code of gist index to understand its implementation > > 5. found appropriate places in gist index AM to insert calls to existing > functions (PredicateLockPage(),

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

2017-06-06 Thread Peter Geoghegan
On Tue, Jun 6, 2017 at 3:47 PM, Peter Geoghegan wrote: > I suppose you'll need two tuplestores for the ON CONFLICT DO UPDATE > case -- one for updated tuples, and the other for inserted tuples. Also, ISTM that the code within ENRMetadataGetTupDesc() probably requires more

Re: [HACKERS] GSoC 2017 : Proposal for predicate locking in gist index

2017-06-06 Thread Kevin Grittner
On Thu, Jun 1, 2017 at 12:49 AM, Andrew Borodin wrote: > First, I just do not know, can VACUUM erase page with predicate lock? For handling in btree, see:

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

2017-06-06 Thread Peter Geoghegan
On Tue, Jun 6, 2017 at 5:01 PM, Peter Geoghegan wrote: > Also, ISTM that the code within ENRMetadataGetTupDesc() probably > requires more explanation, resource management wise. Also, it's not clear why it should be okay that the new type of ephemeral RTEs introduced don't have

[HACKERS] Coverage improvements of src/bin/pg_basebackup and pg_receivewal --endpos

2017-06-06 Thread Michael Paquier
Hi all, The coverage of pg_basebackup is reaching 50%, which is not bad: https://coverage.postgresql.org/src/bin/pg_basebackup/index.html In this set pg_receivewal.c is the bad student with less than 20%. There are a couple of causes behind that, with no tests like: - option interactions like

Re: [HACKERS] sketchy partcollation handling

2017-06-06 Thread Amit Langote
On 2017/06/07 1:08, Tom Lane wrote: > Robert Haas writes: >> On Sun, Jun 4, 2017 at 10:18 PM, Amit Langote >> wrote: >>> BTW, the places which check whether the collation to store a dependency >>> for is the database default collation don't

Re: [HACKERS] sketchy partcollation handling

2017-06-06 Thread Amit Langote
On 2017/06/07 0:19, Robert Haas wrote: > On Sun, Jun 4, 2017 at 10:18 PM, Amit Langote > wrote: >> I think we can call it a bug of StorePartitionKey(). I looked at the >> similar code in index_create() (which actually I had originally looked at >> for reference

Re: [HACKERS] Parallel Aggregation support for aggregate functions that use transitions not implemented for array_agg

2017-06-06 Thread Andres Freund
On 2017-06-06 23:32:53 -0400, Peter Eisentraut wrote: > On 6/6/17 13:52, Regina Obe wrote: > > It seems CREATE AGGREGATE was expanded in 9.6 to support parallelization of > > aggregate functions using transitions, with the addition of serialfunc and > > deserialfunc to the aggregate definitions.

Re: [HACKERS] Parallel Aggregation support for aggregate functions that use transitions not implemented for array_agg

2017-06-06 Thread Tom Lane
Andres Freund writes: > On 2017-06-06 23:32:53 -0400, Peter Eisentraut wrote: >> I'm not sure how you would parallelize these, since in most uses you >> want to have a deterministic output order. > Unless you specify ORDER BY you don't really have that anyway, consider >

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

2017-06-06 Thread Adam Brusselback
> > I'll give it a few days for objections before reverting. >> > > I can only say that the lack of this feature comes up on a weekly basis on > IRC, and a lot of people would be disappointed to see it reverted. > Not that my opinion matters, but I was very much looking forward to this feature in

Re: [HACKERS] [BUGS] BUG #14682: row level security not work with partitioned table

2017-06-06 Thread Michael Paquier
On Wed, Jun 7, 2017 at 9:52 AM, Joe Conway wrote: > On 06/06/2017 02:44 PM, Mike Palmiotto wrote: >> On Tue, Jun 6, 2017 at 4:07 PM, Joe Conway wrote: >>> On 06/06/2017 11:57 AM, Mike Palmiotto wrote: On Mon, Jun 5, 2017 at 10:36 AM, Robert Haas

Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256

2017-06-06 Thread Stephen Frost
Michael, * Michael Paquier (michael.paqu...@gmail.com) wrote: > On Fri, Jun 2, 2017 at 10:25 AM, Robert Haas wrote: > > On Thu, Jun 1, 2017 at 9:13 PM, Michael Paquier > > wrote: > >> It seems to me that any testing in this area won't fly high

Re: [HACKERS] Challenges preventing us moving to 64 bit transaction id (XID)?

2017-06-06 Thread Bruce Momjian
On Tue, Jun 6, 2017 at 06:00:54PM +0800, Craig Ringer wrote: > On 6 June 2017 at 12:38, Ashutosh Bapat > wrote: > > On Tue, Jun 6, 2017 at 10:00 AM, Tom Lane wrote: > >> In my mind the harder problem is where to find another 32 bits for the

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

2017-06-06 Thread Bruce Momjian
On Tue, Jun 6, 2017 at 04:39:50AM -0300, Alvaro Herrera wrote: > Andres Freund wrote: > > > FWIW, allowing UNLOGGED tables, rather than just TEMPORARY ones, > > increases the complexity of that project noticeably. For TEMPORARY you > > basically don't need to do much but to recreate the

Re: [HACKERS] Is ECPG's SET CONNECTION really not thread-aware?

2017-06-06 Thread Michael Meskes
Dear Tsunakawa-san, sorry for the late reply, I've been traveling all of last week and only just came back. >> What does this mean by "not thread-aware?" Does SET CONNECTION in one >> thread change the current connection in another thread? >> It doesn't look so, because the connection

Re: [HACKERS] Proposal : For Auto-Prewarm.

2017-06-06 Thread Rafia Sabih
On Mon, Jun 5, 2017 at 8:06 PM, Robert Haas wrote: > > Many of these seem worse, like these ones: > > - * Quit if we've reached records for another database. Unless the > + * Quit if we've reached records of another database. Unless the > Why is it worse?

Re: [HACKERS] Challenges preventing us moving to 64 bit transaction id (XID)?

2017-06-06 Thread Craig Ringer
On 6 June 2017 at 12:38, Ashutosh Bapat wrote: > On Tue, Jun 6, 2017 at 10:00 AM, Tom Lane wrote: >> Ashutosh Bapat writes: >>> On Tue, Jun 6, 2017 at 9:48 AM, Craig Ringer wrote:

Re: [HACKERS] inconsistent application_name use in logical workers

2017-06-06 Thread Petr Jelinek
On 06/06/17 04:19, Peter Eisentraut wrote: > The logical replication code is supposed to use the subscription name as > the fallback_application_name, but in some cases it uses the slot name, > which could be different. See attached patch to correct this. > Hmm, well the differentiation has a

Re: [HACKERS] Index created in BEFORE trigger not updated during INSERT

2017-06-06 Thread Albe Laurenz
Tom Lane wrote: >> Andres Freund writes: >>> Hm, strategically sprinkled CheckTableNotInUse() might do the trick? > > Attached is a proposed patch that closes off this problem. I've tested > it to the extent that it blocks Albe's example and passes check-world. I tested it,

Re: [HACKERS] Extra Vietnamese unaccent rules

2017-06-06 Thread Bruce Momjian
On Wed, Jun 7, 2017 at 01:06:22AM +0900, Man Trieu wrote: > 2017-06-07 0:31 GMT+09:00 Bruce Momjian : > I added the thread but there was no change.  (I think the thread was > already present.)  It appears it is not seeing this patch as the latest > patch. > >

Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256

2017-06-06 Thread Tom Lane
Robert Haas writes: > I don't think it's true that we force the latest TLS version to be > used. The comment says: > /* > * We use SSLv23_method() because it can negotiate use of the highest > * mutually supported protocol version, while

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

2017-06-06 Thread Robert Haas
On Mon, Jun 5, 2017 at 1:02 AM, Amit Langote wrote: > On 2017/06/03 1:56, Robert Haas wrote: >> On Fri, Jun 2, 2017 at 12:51 AM, Amit Langote >> wrote: >>> Attached patch makes InitResultRelInfo() *always* initialize the >>>

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

2017-06-06 Thread Tom Lane
Robert Haas writes: > On Tue, Jun 6, 2017 at 12:44 PM, Tom Lane wrote: >> By definition, the address range we're trying to reuse worked successfully >> in the postmaster process. I don't see how forcing a specific address >> could do anything but

[HACKERS] Parallel Aggregation support for aggregate functions that use transitions not implemented for array_agg

2017-06-06 Thread Regina Obe
It seems CREATE AGGREGATE was expanded in 9.6 to support parallelization of aggregate functions using transitions, with the addition of serialfunc and deserialfunc to the aggregate definitions. https://www.postgresql.org/docs/10/static/sql-createaggregate.html I was looking at the PostgreSQL 10

Re: [HACKERS] Extra Vietnamese unaccent rules

2017-06-06 Thread Bruce Momjian
On Tue, Jun 6, 2017 at 12:15:13PM -0400, Tom Lane wrote: > Bruce Momjian writes: > > There seems to be a problem. I can't see a patch dated 2017-06-07 on > > the commitfest page: > > https://commitfest.postgresql.org/14/1161/ > > It looks to me like the patch is buried

Re: [HACKERS] Tweaking tab completion for some backslash commands

2017-06-06 Thread Masahiko Sawada
On Sun, Jun 4, 2017 at 6:10 AM, Tom Lane wrote: > Masahiko Sawada writes: >> Attached patch tweaks tab completion for some backslash commands. > > Pushed, thanks! > Thank you! Regards, -- Masahiko Sawada NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT

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

2017-06-06 Thread Robert Haas
On Tue, Jun 6, 2017 at 12:44 PM, Tom Lane wrote: > By definition, the address range we're trying to reuse worked successfully > in the postmaster process. I don't see how forcing a specific address > could do anything but create an additional risk of postmaster startup >

Re: [HACKERS] sketchy partcollation handling

2017-06-06 Thread Robert Haas
On Tue, Jun 6, 2017 at 11:37 AM, Kevin Hale Boyes wrote: > On 6 June 2017 at 09:19, Robert Haas wrote: >> Thanks. Committed. > > The changes to catalogs.sgml has introduced a double "the" in this part of > the sentence "this contains the OID of the the

Re: [HACKERS] inconsistent application_name use in logical workers

2017-06-06 Thread Petr Jelinek
On 06/06/17 15:07, Peter Eisentraut wrote: > On 6/6/17 06:51, Petr Jelinek wrote: >> On 06/06/17 04:19, Peter Eisentraut wrote: >>> The logical replication code is supposed to use the subscription name as >>> the fallback_application_name, but in some cases it uses the slot name, >>> which could

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

2017-06-06 Thread Mengxing Liu
Hi, Kevin and Alvaro. I think disk I/O is not the bottleneck in our experiment, but the global lock is. For disk I/O, there are two evidences: 1) The total throughput is not more than 10 Ktps. Only a half are update transactions. An update transaction modifies 20 tuples; each tuple's size is

Re: [HACKERS] Should we standardize on a type for signal handler flags?

2017-06-06 Thread Andres Freund
On 2017-06-06 13:07:57 -0400, Robert Haas wrote: > > We also already rely on int32 stores being atomic in other > > parts of the code, although that's between processes not between signal > > / normal path of execution. > > I don't think the issues are much different. Presumably no CPU >

Re: [HACKERS] Should we standardize on a type for signal handler flags?

2017-06-06 Thread Tom Lane
Robert Haas writes: > On Sun, Jun 4, 2017 at 7:21 PM, Andres Freund wrote: >> Well, we already have some variables that aren't actually booleans, >> although I think all of them are only read not manipulated in signal >> handlers (InterruptHoldoffCount

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

2017-06-06 Thread Robert Haas
On Mon, Jun 5, 2017 at 10:10 PM, Amit Kapila wrote: > Agreed. By the way, while browsing about this problem, I found that > one other open source (nginx) has used a solution similar to what > Andres was proposing upthread to solve this problem. Refer: >

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

2017-06-06 Thread Petr Jelinek
On 03/06/17 18:53, Peter Eisentraut wrote: > On 6/2/17 14:52, Peter Eisentraut wrote: >> 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

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

2017-06-06 Thread Robert Haas
On Tue, Jun 6, 2017 at 1:27 PM, Tom Lane wrote: > Robert Haas writes: >> On Tue, Jun 6, 2017 at 12:44 PM, Tom Lane wrote: >>> By definition, the address range we're trying to reuse worked successfully >>> in the postmaster process.

Re: [HACKERS] Should we standardize on a type for signal handler flags?

2017-06-06 Thread Robert Haas
On Tue, Jun 6, 2017 at 1:33 PM, Tom Lane wrote: >> I think that's a pretty good argument, really. If there exists a >> platform where only sig_atomic_t is safe to read from a signal >> handler, then we already don't work on that platform. Even saving and >> restoring errno

Re: [HACKERS] UPDATE of partition key

2017-06-06 Thread Robert Haas
On Fri, Jun 2, 2017 at 7:07 AM, Amit Khandekar wrote: > So, according to that, below would be the logic : > > Run partition constraint check on the original NEW row. > If it succeeds : > { > Fire BR UPDATE trigger on the original partition. > Run partition

Re: [HACKERS] Should we standardize on a type for signal handler flags?

2017-06-06 Thread Robert Haas
On Tue, Jun 6, 2017 at 2:24 PM, Andres Freund wrote: > Don't think it's actually clear that errno is an integer - might very > well be just a sig_atomic_t, which can contain values up to like 127 or > so. I think the bigger point Tom was making is that we actually know > an

Re: [HACKERS] Should we standardize on a type for signal handler flags?

2017-06-06 Thread Tom Lane
Robert Haas writes: > On Tue, Jun 6, 2017 at 1:33 PM, Tom Lane wrote: >> That's an argument from false premises. The question here is what types >> are safe for an interrupt handler to *change*, not what can it read. > OK, but we certainly have code

  1   2   >