Re: [HACKERS] logical decoding of two-phase transactions

2017-02-01 Thread Craig Ringer
On 2 Feb. 2017 08:32, "Tom Lane" wrote: Robert Haas writes: > Also, including the GID in the WAL for each COMMIT/ABORT PREPARED > doesn't seem inordinately expensive to me. I'm confused ... isn't it there already? If not, how do we handle

Re: [HACKERS] Vacuum: allow usage of more than 1GB of work mem

2017-02-01 Thread Claudio Freire
On Wed, Feb 1, 2017 at 6:13 PM, Masahiko Sawada wrote: > On Wed, Feb 1, 2017 at 10:02 PM, Claudio Freire > wrote: >> On Wed, Feb 1, 2017 at 5:47 PM, Masahiko Sawada >> wrote: >>> Thank you for updating the patch. >>> >>>

Re: [HACKERS] Time to up bgwriter_lru_maxpages?

2017-02-01 Thread Michael Paquier
On Thu, Feb 2, 2017 at 9:17 AM, Jim Nasby wrote: > Speaking of which... I have a meeting in 15 minutes to discuss moving to a > server with 4TB of memory. With current limits shared buffers maxes at 16TB, > which isn't all that far in the future. While 16TB of shared

Re: [HACKERS] ICU integration

2017-02-01 Thread Tom Lane
I wrote: > Evidently collateral damage from 2f5c9d9c9. But I'd suggest waiting > to fix it until you can also do s/simple_heap_delete/CatalogTupleDelete/ > as I proposed in > https://www.postgresql.org/message-id/462.1485902...@sss.pgh.pa.us > I'll go make that happen right now, now that I

Re: [HACKERS] Patch: Write Amplification Reduction Method (WARM)

2017-02-01 Thread Alvaro Herrera
Tom Lane wrote: > The source of both of those problems is that in some places, we > did CatalogOpenIndexes and then used the CatalogIndexState for > multiple tuple inserts/updates before doing CatalogCloseIndexes. > The patch dealt with these either by not touching them, just > leaving the

Re: [HACKERS] Patch: Write Amplification Reduction Method (WARM)

2017-02-01 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> I think what we ought to do about this is invent additional API >> functions, say >> >> Oid CatalogTupleInsertWithInfo(Relation heapRel, HeapTuple tup, >> CatalogIndexState indstate); >> void

Re: [HACKERS] Cast jsonb to numeric, int, float, bool

2017-02-01 Thread Jim Nasby
On 2/1/17 8:26 AM, Nikita Glukhov wrote: If you find it useful, I can also add support of json and other types, such as smallint and bigint. Yes, I'd like to have support for other types and maybe for json. There's been previous discussion about something similar, which would be better

Re: [HACKERS] Cast jsonb to numeric, int, float, bool

2017-02-01 Thread Nikita Glukhov
On 02.02.2017 01:07, Jim Nasby wrote: On 2/1/17 8:26 AM, Nikita Glukhov wrote: Some comments about the code: I think it would be better to * add function for extraction of scalars from pseudo-arrays * iterate until WJB_DONE to pfree iterator I'm not sure what your intent here is, but if the

Re: [HACKERS] Time to up bgwriter_lru_maxpages?

2017-02-01 Thread Michael Paquier
On Thu, Feb 2, 2017 at 7:01 AM, Jim Nasby wrote: > On 2/1/17 10:27 AM, Robert Haas wrote: >> This looks fine to me. This could go without the comments, they are likely going to be forgotten if any updates happen in the future. > If someone wants to proactively commit

Re: [HACKERS] PoC plpgsql - possibility to force custom or generic plan

2017-02-01 Thread Jim Nasby
On 1/27/17 4:14 AM, Greg Stark wrote: On 25 January 2017 at 20:06, Jim Nasby wrote: GUCs support SET LOCAL, but that's not the same as local scoping because the setting stays in effect unless the substrans aborts. What I'd like is the ability to set a GUC in a plpgsql

Re: [HACKERS] Refactoring of replication commands using printsimple

2017-02-01 Thread Michael Paquier
On Thu, Feb 2, 2017 at 4:05 AM, Robert Haas wrote: > On Tue, Jan 31, 2017 at 8:26 PM, Michael Paquier > wrote: >> pq_sendcountedtext() does some encoding conversion, which is why I >> haven't used because we deal only with integers in this

Re: [HACKERS] multivariate statistics (v19)

2017-02-01 Thread Alvaro Herrera
Still looking at 0002. pg_ndistinct_in disallows input, claiming that pg_node_tree does the same thing. But pg_node_tree does it for security reasons: you could crash the backend if you supplied a malicious value. I don't think that applies to pg_ndistinct_in. Perhaps it will be useful to

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-02-01 Thread Robert Haas
On Mon, Jan 2, 2017 at 7:32 AM, Ashutosh Bapat wrote: > PFA the patch (pg_dp_join_v6.patch) with some bugs fixed and rebased > on the latest code. Maybe not surprisingly given how fast things are moving around here these days, this needs a rebase. Apart from

Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands: \quit_if, \quit_unless)

2017-02-01 Thread Jim Nasby
On 2/1/17 12:03 PM, Fabien COELHO wrote: I'm unsure whether it is a good idea, I like terse interfaces, but this is just an opinion. I think the issue here is that the original case for this is a user accidentally getting into an \if and then having no clue what's going on. That's similar to

[HACKERS] TRAP: FailedAssertion("!(hassrf)", File: "nodeProjectSet.c", Line: 180)

2017-02-01 Thread Erik Rijkers
Something is broken in HEAD: drop table if exists t; create table t(c text); insert into t (c) values ( 'abc' ) ; select regexp_split_to_array( regexp_split_to_table( c , chr(13) || chr(10) ) , '","' )

Re: [HACKERS] Time to up bgwriter_lru_maxpages?

2017-02-01 Thread Andres Freund
On 2017-02-02 09:22:46 +0900, Michael Paquier wrote: > On Thu, Feb 2, 2017 at 9:17 AM, Jim Nasby wrote: > > Speaking of which... I have a meeting in 15 minutes to discuss moving to a > > server with 4TB of memory. With current limits shared buffers maxes at 16TB, > >

Re: [HACKERS] Time to up bgwriter_lru_maxpages?

2017-02-01 Thread Jim Nasby
On 2/1/17 10:27 AM, Robert Haas wrote: On Tue, Jan 31, 2017 at 5:07 PM, Jim Nasby wrote: On 11/29/16 9:58 AM, Jeff Janes wrote: Considering a single SSD can do 70% of that limit, I would say yes. Next question becomes... should there even be an upper

Re: [HACKERS] TRAP: FailedAssertion("!(hassrf)", File: "nodeProjectSet.c", Line: 180)

2017-02-01 Thread Andres Freund
Hi, On 2017-02-02 00:09:03 +0100, Erik Rijkers wrote: > Something is broken in HEAD: Hm. Indeed. > drop table if exists t; > create table t(c text); > insert into t (c) values ( 'abc' ) ; > > select > regexp_split_to_array( > regexp_split_to_table( > c >

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-01 Thread Michael Paquier
On Thu, Feb 2, 2017 at 2:14 AM, Fujii Masao wrote: > The lwlock would be released when an exception occurs, so I don't think > that TRY-CATCH is necessary here. Or it's necessary for another reason? +PG_CATCH(); +{ +LWLockRelease(LogicalRepLauncherLock); +

Re: [HACKERS] Time to up bgwriter_lru_maxpages?

2017-02-01 Thread Jim Nasby
On 2/1/17 3:36 PM, Michael Paquier wrote: On Thu, Feb 2, 2017 at 7:01 AM, Jim Nasby wrote: On 2/1/17 10:27 AM, Robert Haas wrote: This looks fine to me. This could go without the comments, they are likely going to be forgotten if any updates happen in the future.

Re: [HACKERS] Vacuum: allow usage of more than 1GB of work mem

2017-02-01 Thread Masahiko Sawada
On Wed, Feb 1, 2017 at 10:02 PM, Claudio Freire wrote: > On Wed, Feb 1, 2017 at 5:47 PM, Masahiko Sawada wrote: >> Thank you for updating the patch. >> >> Whole patch looks good to me except for the following one comment. >> This is the final

Re: [HACKERS] [COMMITTERS] pgsql: Make psql's \set display variables in alphabetical order.

2017-02-01 Thread Robert Haas
On Wed, Feb 1, 2017 at 1:08 PM, Andres Freund wrote: > On 2017-02-01 12:59:36 -0500, Tom Lane wrote: >> David Fetter writes: >> > On Wed, Feb 01, 2017 at 04:25:25PM +, Tom Lane wrote: >> >> Make psql's \set display variables in alphabetical order. >> >>

Re: [HACKERS] [COMMITTERS] pgsql: Make psql's \set display variables in alphabetical order.

2017-02-01 Thread David Fetter
On Wed, Feb 01, 2017 at 04:38:59PM -0500, Robert Haas wrote: > On Wed, Feb 1, 2017 at 1:08 PM, Andres Freund wrote: > > On 2017-02-01 12:59:36 -0500, Tom Lane wrote: > >> David Fetter writes: > >> > On Wed, Feb 01, 2017 at 04:25:25PM +, Tom Lane wrote: >

Re: [HACKERS] Time to up bgwriter_lru_maxpages?

2017-02-01 Thread Andres Freund
On 2016-11-28 11:40:53 -0800, Jim Nasby wrote: > With current limits, the most bgwriter can do (with 8k pages) is 1000 pages > * 100 times/sec = 780MB/s. It's not hard to exceed that with modern > hardware. Should we increase the limit on bgwriter_lru_maxpages? FWIW, I think working on replacing

Re: [HACKERS] Time to up bgwriter_lru_maxpages?

2017-02-01 Thread Andres Freund
On 2017-02-01 20:38:58 -0500, Robert Haas wrote: > On Wed, Feb 1, 2017 at 8:35 PM, Andres Freund wrote: > > On 2017-02-01 20:30:30 -0500, Robert Haas wrote: > >> On Wed, Feb 1, 2017 at 7:28 PM, Andres Freund wrote: > >> > On 2016-11-28 11:40:53 -0800, Jim

Re: [HACKERS] parallelize queries containing subplans

2017-02-01 Thread Amit Kapila
On Wed, Feb 1, 2017 at 10:04 PM, Robert Haas wrote: > On Tue, Jan 31, 2017 at 6:01 AM, Amit Kapila wrote: >> Moved this patch to next CF. > > So here is what seems to be the key hunk from this patch: > > /* > - * Since we don't have the

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Ashutosh Bapat
On Thu, Feb 2, 2017 at 8:11 AM, Higuchi, Daisuke wrote: > From: Ashutosh Bapat [mailto:ashutosh.ba...@enterprisedb.com] >> Per the documentation [1], "PQgetResult must be called repeatedly >> until it returns a null pointer, indicating that the command is >>

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Ashutosh Bapat
Sorry, attached wrong patch. Here's the right one. On Thu, Feb 2, 2017 at 10:04 AM, Ashutosh Bapat wrote: > On Thu, Feb 2, 2017 at 8:11 AM, Higuchi, Daisuke > wrote: >> From: Ashutosh Bapat [mailto:ashutosh.ba...@enterprisedb.com]

Re: [HACKERS] WAL consistency check facility

2017-02-01 Thread Robert Haas
On Tue, Jan 31, 2017 at 9:31 PM, Michael Paquier wrote: > On Wed, Feb 1, 2017 at 1:06 AM, Robert Haas wrote: >> On Thu, Jan 5, 2017 at 12:54 AM, Kuntal Ghosh >> wrote: >>> I've attached the patch with the modified

Re: [HACKERS] sequence data type

2017-02-01 Thread Michael Paquier
On Wed, Feb 1, 2017 at 10:02 AM, Michael Paquier wrote: > On Wed, Feb 1, 2017 at 1:11 AM, Peter Eisentraut > wrote: >> And here is a rebased patch for the original feature. I think this >> addresses all raised concerns and suggestions

Re: [HACKERS] Logical Replication and Character encoding

2017-02-01 Thread Kyotaro HORIGUCHI
Hello. This version makes subscriber automatically set its database encoding to clinet_encoding (if not explicitly set). And changed the behavior when pg_server_to_client returns NULL to ERROR from sending original string. At Wed, 1 Feb 2017 08:39:41 +, "Shinoda, Noriyoshi"

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-01 Thread Tom Lane
Kyotaro HORIGUCHI writes: > Then, the reason for the TRY-CATCH cluase is that I found that > some functions called from there can throw exceptions. Yes, but all LWLocks should be released by normal error recovery. It should not be necessary for this code to clean

Re: [HACKERS] [BUGS] Bug in Physical Replication Slots (at least 9.5)?

2017-02-01 Thread Kyotaro HORIGUCHI
Thank you for the comment. At Thu, 2 Feb 2017 01:26:03 +0900, Fujii Masao wrote in

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Higuchi, Daisuke
From: Ashutosh Bapat [mailto:ashutosh.ba...@enterprisedb.com] > Per the documentation [1], "PQgetResult must be called repeatedly > until it returns a null pointer, indicating that the command is > done.". The code in PQgetResult() under CONNECTION_CHECK_WRITABLE > case, violates that. The patch

Re: [HACKERS] autonomous transactions

2017-02-01 Thread Michael Paquier
On Sat, Jan 7, 2017 at 5:30 PM, Andrey Borodin wrote: > The new status of this patch is: Ready for Committer I don't think that this thread has reached a conclusion yet. From what I can see the last patch does not apply, so I have moved the patch to next CF with "waiting on

Re: [HACKERS] Parallel Index Scans

2017-02-01 Thread Michael Paquier
On Wed, Feb 1, 2017 at 10:20 PM, Amit Kapila wrote: > makes sense, so changed accordingly. I have moved this patch to CF 2017-03. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] Performance improvement for joins where outer side is unique

2017-02-01 Thread Michael Paquier
On Tue, Jan 31, 2017 at 9:13 AM, David Rowley wrote: > On 31 January 2017 at 13:10, David Rowley > wrote: >> I've attached a patch which implements this. > > Please disregards previous patch. (I forgot git commit before git diff > to

Re: [HACKERS] TRAP: FailedAssertion("!(hassrf)", File: "nodeProjectSet.c", Line: 180)

2017-02-01 Thread Tom Lane
Andres Freund writes: > On 2017-02-02 00:09:03 +0100, Erik Rijkers wrote: >> Something is broken in HEAD: > Hm. Indeed. > The issue is that we're generating ProjectSet nodes instead of Result > for the top-level nodes - but we currently assume that ProjectSet nodes >

Re: [HACKERS] Commit fest 2017-01 will begin soon!

2017-02-01 Thread Amit Kapila
On Thu, Feb 2, 2017 at 8:50 AM, Michael Paquier wrote: > On Tue, Jan 31, 2017 at 4:01 PM, Michael Paquier > wrote: >> The CF finishing soon, I have done a first pass on the patches >> remaining on it, moving patches to the next CF or updating

Re: [HACKERS] Enabling replication connections by default in pg_hba.conf

2017-02-01 Thread Peter Eisentraut
On 1/22/17 10:29 PM, Michael Paquier wrote: > As now wal_level = replica has become the default for Postgres 10, > could we consider as well making replication connections enabled by > default in pg_hba.conf? This requires just uncommenting a couple of > lines in pg_hba.conf.sample. Yes, I think

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-01 Thread Michael Paquier
On Thu, Feb 2, 2017 at 2:13 PM, Tom Lane wrote: > Kyotaro HORIGUCHI writes: >> Then, the reason for the TRY-CATCH cluase is that I found that >> some functions called from there can throw exceptions. > > Yes, but all LWLocks should be released

[HACKERS] Provide list of subscriptions and publications in psql's completion

2017-02-01 Thread Michael Paquier
Hi all, While testing a bit the logical replication facility, I have bumped on the fast that psql's completion does not show the list of things already created. Attached is a patch. Thanks, -- Michael subs-psql-completion.patch Description: Binary data -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Time to up bgwriter_lru_maxpages?

2017-02-01 Thread Robert Haas
On Wed, Feb 1, 2017 at 7:28 PM, Andres Freund wrote: > On 2016-11-28 11:40:53 -0800, Jim Nasby wrote: >> With current limits, the most bgwriter can do (with 8k pages) is 1000 pages >> * 100 times/sec = 780MB/s. It's not hard to exceed that with modern >> hardware. Should we

Re: [HACKERS] Add pgstathashindex() to get hash index table statistics.

2017-02-01 Thread Michael Paquier
On Tue, Jan 24, 2017 at 8:36 PM, Kuntal Ghosh wrote: > Nothing else to add from my side. I'm marking this 'Ready for commiter'. Moved to CF 2017-03 with the same status. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make

Re: [HACKERS] TRAP: FailedAssertion("!(hassrf)", File: "nodeProjectSet.c", Line: 180)

2017-02-01 Thread Tom Lane
I wrote: > Andres Freund writes: >> Tom, do you have an opinion? > Yes, it's broken. split_pathtarget_at_srfs seems to be doing the right > thing, but then something later is recombining the last two steps. Ah, no, I take that back: split_pathtarget_at_srfs is doing the

Re: [HACKERS] Time to up bgwriter_lru_maxpages?

2017-02-01 Thread Andres Freund
On 2017-02-01 20:30:30 -0500, Robert Haas wrote: > On Wed, Feb 1, 2017 at 7:28 PM, Andres Freund wrote: > > On 2016-11-28 11:40:53 -0800, Jim Nasby wrote: > >> With current limits, the most bgwriter can do (with 8k pages) is 1000 pages > >> * 100 times/sec = 780MB/s. It's not

Re: [HACKERS] [PATCH] Add GUCs for predicate lock promotion thresholds

2017-02-01 Thread Michael Paquier
On Tue, Jan 24, 2017 at 3:32 AM, Kevin Grittner wrote: > I will need some time to consider that Moved to CF 2017-03 for now. The last patch sent still applies. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] TRAP: FailedAssertion("!(hassrf)", File: "nodeProjectSet.c", Line: 180)

2017-02-01 Thread Andres Freund
On 2017-02-01 23:27:36 -0500, Tom Lane wrote: > I wrote: > > Andres Freund writes: > >> Tom, do you have an opinion? > > > Yes, it's broken. split_pathtarget_at_srfs seems to be doing the right > > thing, but then something later is recombining the last two steps. > > Ah,

Re: [HACKERS] Commit fest 2017-01 will begin soon!

2017-02-01 Thread Michael Paquier
On Thu, Feb 2, 2017 at 1:23 PM, Amit Kapila wrote: > Many thanks to you for running the show. I think it might be okay if > one consolidated mail is sent for all the patches that are marked > "Returned with Feedback" or "Rejected" or "Moved to next CF". OTOH, > there is

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Higuchi, Daisuke
From: Michael Paquier [mailto:michael.paqu...@gmail.com] >This has not been added yet to the next CF. As Ashutosh mentioned >things tend to be easily forgotten. So I have added it here: >https://commitfest.postgresql.org/13/982/ Thank you for adding this problem to CF. > I have noticed this

Re: [HACKERS] Speedup twophase transactions

2017-02-01 Thread Nikhil Sontakke
>> Yeah. Was thinking about this yesterday. How about adding entries in >> TwoPhaseState itself (which become valid later)? Only if it does not >> cause a lot of code churn. > > That's possible as well, yes. PFA a patch which does the above. It re-uses the TwoPhaseState gxact entries to track 2PC

Re: [HACKERS] Time to up bgwriter_lru_maxpages?

2017-02-01 Thread Robert Haas
On Wed, Feb 1, 2017 at 8:35 PM, Andres Freund wrote: > On 2017-02-01 20:30:30 -0500, Robert Haas wrote: >> On Wed, Feb 1, 2017 at 7:28 PM, Andres Freund wrote: >> > On 2016-11-28 11:40:53 -0800, Jim Nasby wrote: >> >> With current limits, the most bgwriter

Re: [HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-01 Thread Kyotaro HORIGUCHI
At Thu, 2 Feb 2017 08:46:11 +0900, Michael Paquier wrote in > On Thu, Feb 2, 2017 at 2:14 AM, Fujii Masao wrote: > > The lwlock would be released when an exception occurs, so I

Re: [HACKERS] pg_background contrib module proposal

2017-02-01 Thread Michael Paquier
On Fri, Jan 27, 2017 at 11:38 PM, Robert Haas wrote: > On Fri, Jan 27, 2017 at 9:14 AM, Peter Eisentraut > wrote: >> On 1/19/17 12:47 PM, Andrey Borodin wrote: >>> 4. There is some controversy on where implemented feature shall be: in >>>

Re: pg_authid.rolpassword format (was Re: [HACKERS] Password identifiers, protocol aging and SCRAM protocol)

2017-02-01 Thread David Rowley
On 2 February 2017 at 00:13, Heikki Linnakangas wrote: > Ok, I'll drop the second patch for now. I committed the first patch after > fixing the things you and Michael pointed out. Thanks for the review! dbd69118 caused small compiler warning for me. The attached fixed it. --

Re: [HACKERS] WIP: [[Parallel] Shared] Hash

2017-02-01 Thread Thomas Munro
On Thu, Feb 2, 2017 at 4:57 PM, Rafia Sabih wrote: > Apart from the previously reported regression, there appear one more > issue in this set of patches. At times, running a query using parallel > hash it hangs up and all the workers including the master shows the >

Re: [HACKERS] Patch: Write Amplification Reduction Method (WARM)

2017-02-01 Thread Pavan Deolasee
On Thu, Feb 2, 2017 at 3:49 AM, Tom Lane wrote: > Alvaro Herrera writes: > > Tom Lane wrote: > >> I think what we ought to do about this is invent additional API > >> functions, say > >> > >> Oid CatalogTupleInsertWithInfo(Relation heapRel,

Re: [HACKERS] Time to up bgwriter_lru_maxpages?

2017-02-01 Thread Jim Nasby
On 2/1/17 4:27 PM, Andres Freund wrote: On 2017-02-02 09:22:46 +0900, Michael Paquier wrote: On Thu, Feb 2, 2017 at 9:17 AM, Jim Nasby wrote: Speaking of which... I have a meeting in 15 minutes to discuss moving to a server with 4TB of memory. With current limits

Re: [HACKERS] Commit fest 2017-01 will begin soon!

2017-02-01 Thread Michael Paquier
On Tue, Jan 31, 2017 at 4:01 PM, Michael Paquier wrote: > The CF finishing soon, I have done a first pass on the patches > remaining on it, moving patches to the next CF or updating them. There > are still 48 patches still on the tracker when writing this email: > Needs

Re: [HACKERS] Logical Replication and Character encoding

2017-02-01 Thread Euler Taveira
On 01-02-2017 00:05, Kyotaro HORIGUCHI wrote: > - Subscriber connects with client_encoding specification and the > output plugin pgoutput decide whether it accepts the encoding > or not. If the subscriber doesn't, pgoutput send data without > conversion. > I don't think storage without

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Higuchi, Daisuke
From: Ashutosh Bapat [mailto:ashutosh.ba...@enterprisedb.com] >Sorry, attached wrong patch. Here's the right one. > The code expects that there will be two PQgetResult() calls required. > One to fetch the result of SHOW command and the other to extract NULL. > If we require more calls or

Re: [HACKERS] [BUGS] Bug in Physical Replication Slots (at least 9.5)?

2017-02-01 Thread Michael Paquier
On Thu, Feb 2, 2017 at 1:26 AM, Fujii Masao wrote: > I'm afraid that many WAL segments would start with a continuation record > when there are the workload of short transactions (e.g., by pgbench), and > which would make restart_lsn go behind very much. No? I don't quite

Re: [HACKERS] WIP: [[Parallel] Shared] Hash

2017-02-01 Thread Rafia Sabih
On Thu, Feb 2, 2017 at 1:19 AM, Thomas Munro wrote: > On Thu, Feb 2, 2017 at 3:34 AM, Rafia Sabih > wrote: >> 9 | 62928.88 | 59077.909 > > Thanks Rafia. At first glance this plan is using the Parallel Shared > Hash in one

Re: [HACKERS] Parallel bitmap heap scan

2017-02-01 Thread Dilip Kumar
On Wed, Feb 1, 2017 at 11:09 PM, Robert Haas wrote: Hi Robert, Thanks for the review. > When Andres wrote in > https://www.postgresql.org/message-id/20161017201558.cr34stc6zvxy3...@alap3.anarazel.de > that you should try to share only the iteration arrays, I believe that

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Michael Paquier
On Thu, Feb 2, 2017 at 1:34 PM, Ashutosh Bapat wrote: > On Thu, Feb 2, 2017 at 10:04 AM, Ashutosh Bapat > wrote: >> [1] https://www.postgresql.org/docs/devel/static/libpq-exec.html: >> PQgetvalue(). > The code expects that there

Re: [HACKERS] Should `pg_upgrade --check` check relation filenodes are present?

2017-02-01 Thread Peter Eisentraut
On 1/31/17 4:57 PM, Craig de Stigter wrote: > However, this problem was not caught by the `--check` command. I'm > looking at the source code and it appears that pg_upgrade does not > attempt to verify relation filenodes actually exist before proceeding, > whether using --check or not. The

[HACKERS] Cannot shutdown subscriber after DROP SUBSCRIPTION

2017-02-01 Thread Kyotaro HORIGUCHI
Hello, while looking another bug, I found that standby cannot shutdown after DROP SUBSCRIPTION. standby=# CREATE SUBSCRPTION sub1 ... standby=# standby=# DROP SUBSCRIPTION sub1; Ctrl-C to the standby fails to work. ApplyLauncherMain is waiting LogicalRepLauncherLock forever. The culprit is

Re: [HACKERS] Deployment of an output plugin in Unix-like environment

2017-02-01 Thread valeriof
Anyone? -- View this message in context: http://postgresql.nabble.com/Deployment-of-an-output-plugin-in-Unix-like-environment-tp5940384p5942038.html Sent from the PostgreSQL - hackers mailing list archive at Nabble.com. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)

Re: [HACKERS] CONNECTION LIMIT and Parallel Query don't play well together

2017-02-01 Thread Albe Laurenz
Andrew Dunstan wrote: > On 01/29/2017 04:07 PM, David Rowley wrote: >> Looks like there's a few other usages of CountDBBackends() which >> require background workers to be counted too, so I ended up creating >> CountDBConnections() as I didn't really think adding a bool flag to >> CountDBBackends

Re: [HACKERS] CONNECTION LIMIT and Parallel Query don't play well together

2017-02-01 Thread Andrew Dunstan
On 01/29/2017 04:07 PM, David Rowley wrote: > On 27 January 2017 at 03:53, Robert Haas wrote: >> Sorry, this had slipped through the cracks -- I'm having a very hard >> time keeping up with the flow of patches and emails. But it looks >> good to me, except that it seems

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Ashutosh Bapat
Please add this to the next commitfest, so that we don't forget it. On Wed, Feb 1, 2017 at 3:58 PM, Ashutosh Bapat wrote: > On Tue, Jan 31, 2017 at 9:53 AM, Higuchi, Daisuke > wrote: >> Hello, >> >> This this is my first posting

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Ashutosh Bapat
On Tue, Jan 31, 2017 at 9:53 AM, Higuchi, Daisuke wrote: > Hello, > > This this is my first posting to the mailing list. > > I am interested in multiple hosts of libpq [1], then I found the bug in this > feature. > When I set "target_session_attrs" to "any" and

Re: [HACKERS] Deadlock in XLogInsert at AIX

2017-02-01 Thread Heikki Linnakangas
On 01/31/2017 05:03 PM, Konstantin Knizhnik wrote: One more assertion failure: ExceptionalCondition(conditionName = "!(OldPageRqstPtr <= XLogCtl->InitializedUpTo)", errorType = "FailedAssertion", fileName = "xlog.c", lineNumber = 1887), line 54 in "assert.c" (dbx) p OldPageRqstPtr

Re: [HACKERS] IF (NOT) EXISTS in psql-completion

2017-02-01 Thread Kyotaro HORIGUCHI
Thank you for reviewing. At Tue, 31 Jan 2017 11:28:17 +0100, Pavel Stehule wrote in

Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands: \quit_if, \quit_unless)

2017-02-01 Thread Fabien COELHO
Hello Corey, Some comments about v4: Patch applies. "git apply" complained about a space or line somewhere, not sure why. make check ok. - rebased on post-psql hooks master Good. - took nearly every suggestion for change to documentation Indeed. Looks ok to me. - \if ERROR will

Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands: \quit_if, \quit_unless)

2017-02-01 Thread Corey Huinker
> > > I think ParseVariableBool is only likely to change to reject a NULL value > rather than silently interpreting it as FALSE, which is the way it is in > HEAD right now. That behavior is a leftover hack, really, and moving the > treatment of unset values upstream seems a lot cleaner. See my

Re: [HACKERS] Speedup twophase transactions

2017-02-01 Thread Nikhil Sontakke
>> Shouldn’t the singular part of the message above be: >> "%u two-phase state file was written for a long-running prepared transaction" >> >> But, then, English is not my native language, so I might be off here :-) > > If there's one file per long-running prepared transaction, which I > think is

Re: [HACKERS] IF (NOT) EXISTS in psql-completion

2017-02-01 Thread Pavel Stehule
2017-02-01 9:37 GMT+01:00 Kyotaro HORIGUCHI : > Thank you for reviewing. > > At Tue, 31 Jan 2017 11:28:17 +0100, Pavel Stehule > wrote in

Re: [HACKERS] Logical Replication and Character encoding

2017-02-01 Thread Shinoda, Noriyoshi
Thank you for creating patches. I strongly hope that your patch will be merged into the new version. Since all databases are not yet based on UTF - 8, I think conversion of character codes is still necessary. -Original Message- From: Kyotaro HORIGUCHI

Re: [HACKERS] Deadlock in XLogInsert at AIX

2017-02-01 Thread Heikki Linnakangas
Oh, you were one step ahead of me, I didn't understand it on first read of your email. Need more coffee.. On 01/31/2017 05:03 PM, Konstantin Knizhnik wrote: I inspected code of pg_atomic_compare_exchange_u32_impl and didn't sync in prologue: (dbx) listi pg_atomic_compare_exchange_u32_impl >

Re: [HACKERS] Subtle bug in "Simplify tape block format" commit

2017-02-01 Thread Heikki Linnakangas
On 01/31/2017 01:51 AM, Peter Geoghegan wrote: * If you're writing out any old bit pattern, I suggest using 0x7F bytes rather than nul bytes (I do agree that it does seem worth making this some particular bit pattern, so as to not have to bother with Valgrind suppressions and so on). That

Re: [HACKERS] Reporting planning time with EXPLAIN

2017-02-01 Thread Stephen Frost
* Michael Paquier (michael.paqu...@gmail.com) wrote: > On Wed, Jan 4, 2017 at 7:59 PM, Ashutosh Bapat > wrote: > > Here are patches for following > > Those patches have received no code-level reviews, so moved to CF 2017-03. Yeah, I've been rather busy with

Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands: \quit_if, \quit_unless)

2017-02-01 Thread Corey Huinker
On Wed, Feb 1, 2017 at 6:31 AM, Erik Rijkers wrote: > On 2017-02-01 09:27, Corey Huinker wrote: > >> 0001.if_endif.v4.diff >> > > A few thoughts after a quick try: > > I dislike the ease with which one gets stuck inside an \if block, in > interactive mode. > > (for instance, in

Re: pg_authid.rolpassword format (was Re: [HACKERS] Password identifiers, protocol aging and SCRAM protocol)

2017-02-01 Thread Heikki Linnakangas
On 01/17/2017 11:51 PM, Peter Eisentraut wrote: On 1/3/17 9:09 AM, Heikki Linnakangas wrote: Since not everyone agrees with this approach, I split this patch into two. The first patch refactors things, replacing the isMD5() function with get_password_type(), without changing the representation

Re: [HACKERS] Deadlock in XLogInsert at AIX

2017-02-01 Thread Konstantin Knizhnik
Attached please find my patch for XLC/AIX. The most critical fix is adding __sync to pg_atomic_fetch_add_u32_impl. The comment in this file says that: * __fetch_and_add() emits a leading "sync" and trailing "isync", thereby * providing sequential consistency. This is undocumented.

Re: [HACKERS] Floating point comparison inconsistencies of the geometric types

2017-02-01 Thread Emre Hasegeli
> Got it, but if other people don't agree then this is going nowhere. Yes. As I wrote, I don't particularly care about functions like "is point on line". I can prepare a patch to fix as many problems as possible around those operators by preserving the current epsilon. I though we were arguing

Re: [HACKERS] Deadlock in XLogInsert at AIX

2017-02-01 Thread Heikki Linnakangas
On 02/01/2017 01:07 PM, Konstantin Knizhnik wrote: Attached please find my patch for XLC/AIX. The most critical fix is adding __sync to pg_atomic_fetch_add_u32_impl. The comment in this file says that: * __fetch_and_add() emits a leading "sync" and trailing "isync", thereby *

Re: [HACKERS] Parallel Index Scans

2017-02-01 Thread Amit Kapila
On Wed, Feb 1, 2017 at 3:52 AM, Robert Haas wrote: > On Tue, Jan 24, 2017 at 4:51 PM, Robert Haas wrote: >> On Mon, Jan 23, 2017 at 1:03 AM, Amit Kapila wrote: >>> In spite of being careful, I missed reorganizing the

Re: [HACKERS] [PATCH]: fix bug in SP-GiST box_ops

2017-02-01 Thread Emre Hasegeli
> I think this patch is already in a good shape. I am sorry for introducing this bug. This fix looks good to me as well. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands: \quit_if, \quit_unless)

2017-02-01 Thread Corey Huinker
> > - wrote an intentionally failing TAP test to see if "make check" executes >> it. it does not. need help. >> > > A failing test expects code 3, not 0 as written in "t/001_if.pl". With > > is($retcode,'3','Invalid \if respects ON_ERROR_STOP'); > > instead, the tests succeeds because psql

Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands: \quit_if, \quit_unless)

2017-02-01 Thread Erik Rijkers
On 2017-02-01 09:27, Corey Huinker wrote: 0001.if_endif.v4.diff A few thoughts after a quick try: I dislike the ease with which one gets stuck inside an \if block, in interactive mode. (for instance, in my very first session, I tried '\? \if' to see if there is more info in that

Re: [HACKERS] Performance improvement for joins where outer side is unique

2017-02-01 Thread David Rowley
On 31 January 2017 at 10:43, Tom Lane wrote: > David Rowley writes: >> I don't think that's possible. The whole point that the current join >> removal code retries to remove joins which it already tried to remove, >> after a successful removal is

Re: [HACKERS] Gather Merge

2017-02-01 Thread Rushabh Lathia
I am sorry for the delay, here is the latest re-based patch. my colleague Neha Sharma, reported one regression with the patch, where explain output for the Sort node under GatherMerge was always showing cost as zero: explain analyze select '' AS "xxx" from pgbench_accounts where filler like

Re: [HACKERS] Deadlock in XLogInsert at AIX

2017-02-01 Thread Heikki Linnakangas
On 02/01/2017 01:07 PM, Konstantin Knizhnik wrote: Attached please find my patch for XLC/AIX. The most critical fix is adding __sync to pg_atomic_fetch_add_u32_impl. The comment in this file says that: * __fetch_and_add() emits a leading "sync" and trailing "isync", thereby *

Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands: \quit_if, \quit_unless)

2017-02-01 Thread Tom Lane
Corey Huinker writes: > Right. What I meant was, no matter how I changed that test, I could not get > it to fail, which made me think it was not executing at all. What do I need > to do to get TAP tests running? I must be missing something. configure --enable-tap-tests,

Re: [HACKERS] Deadlock in XLogInsert at AIX

2017-02-01 Thread REIX, Tony
Hi, I'm now working on the port of PostgreSQL on AIX. (RPMs can be found, as free OpenSource work, at http://http://bullfreeware.com/ . http://bullfreeware.com/search.php?package=postgresql ) I was not aware of any issue with XLC v12 on AIX for atomic operations. (XLC v13 generates at least 2

[HACKERS] Cast jsonb to numeric, int, float, bool

2017-02-01 Thread Anastasia Lubennikova
Now the simplest way to extract booleans and numbers from json/jsonb is to cast it to text and then cast to the appropriate type: postgres=# select 'true'::jsonb::text::bool; bool -- t postgres=# select '1.0'::jsonb::text::numeric; numeric - 1.0 This patch implements

Re: [HACKERS] Parallel Index Scans

2017-02-01 Thread tushar
On 02/01/2017 06:50 PM, Amit Kapila wrote: Used large table parallel index scans (both forward and backward scans). These tests have been done by Tushar and you can find detailed report up thread [2]. Apart from that, the patch has been tested with TPC-H queries at various scale factors and it

Re: [HACKERS] Deadlock in XLogInsert at AIX

2017-02-01 Thread Konstantin Knizhnik
Hi, We are using 13.1.3 version of XLC. All tests are passed. Please notice that is is synchronization bug which can be reproduced only under hard load. Our server has 64 cores and it is necessary to run pgbench with 100 connections during several minutes to reproduce the problem. So may be

Re: [HACKERS] Gather Merge

2017-02-01 Thread Rushabh Lathia
Due to recent below commit, patch not getting apply cleanly on master branch. commit d002f16c6ec38f76d1ee97367ba6af3000d441d0 Author: Tom Lane Date: Mon Jan 30 17:15:42 2017 -0500 Add a regression test script dedicated to exercising system views. Please find attached

  1   2   >