Re: TRUNCATE tables referenced by FKs on partitioned tables

2018-07-11 Thread Michael Paquier
On Tue, Jul 10, 2018 at 08:06:24PM -0400, Alvaro Herrera wrote: > You can't truncate prim on its own. This is expected. > alvherre=# truncate table prim, partfk; > ERROR: cannot truncate a table referenced in a foreign key constraint > DETALLE: Table "partfk" references "prim". > SUGERENCIA:

Re: automatic restore point

2018-07-11 Thread Michael Paquier
On Wed, Jul 11, 2018 at 06:11:01AM +, Yotsunaga, Naoki wrote: > I want to hear about the following in addition to the previous > comment. What would you do if your customer dropped the table and asked you > to > restore it? I can think of 4 reasons on top of my mind: 1) Don't do that. 2)

Re: In pageinspect, perform clean-up after testing gin-related functions

2018-07-11 Thread Amit Kapila
On Wed, Jul 11, 2018 at 12:37 PM, Kuntal Ghosh wrote: > Hello all, > > In pageinspect/sql/gin.sql, we don't drop the table test1 at the end > of the test. IMHO, we should clean-up at the end of a test. > Yeah, it is good practice to drop the objects at the end. It is strange that original

Re: [HACKERS] Restricting maximum keep segments by repslots

2018-07-11 Thread Masahiko Sawada
On Mon, Jul 9, 2018 at 2:47 PM, Kyotaro HORIGUCHI wrote: > Hello. Sawada-san. > > Thank you for the comments. > Thank you for updating the patch! > At Thu, 5 Jul 2018 15:43:56 +0900, Masahiko Sawada > wrote in >> On Wed, Jul 4, 2018 at 5:28 PM, Kyotaro HORIGUCHI >> --- >> +

RE: automatic restore point

2018-07-11 Thread Yotsunaga, Naoki
>-Original Message- >From: Yotsunaga, Naoki [mailto:yotsunaga.na...@jp.fujitsu.com] >Sent: Friday, July 6, 2018 5:05 PM >Does that mean that the application (user) is interested in which table? >For example, there are two tables A. It is ok even if one table disappears, >but it is

Re: Problem with tupdesc in jsonb_to_recordset

2018-07-11 Thread Michael Paquier
On Tue, Jul 10, 2018 at 10:39:28PM +0200, Dmitry Dolgov wrote: > I've found out that currently in some situations jsonb_to_recordset can lead > to > a crash. Minimal example that I've managed to create looks like this: It would be better not to send the same email across multiple mailing lists.

In pageinspect, perform clean-up after testing gin-related functions

2018-07-11 Thread Kuntal Ghosh
Hello all, In pageinspect/sql/gin.sql, we don't drop the table test1 at the end of the test. IMHO, we should clean-up at the end of a test. I've attached the patch to perform the same. -- Thanks & Regards, Kuntal Ghosh EnterpriseDB: http://www.enterprisedb.com From

Re: How can we submit code patches that implement our (pending) patents?

2018-07-11 Thread Dave Page
On Wed, Jul 11, 2018 at 1:34 AM, Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > From: Dave Page [mailto:dp...@pgadmin.org] > > SFLC have acted as the projects counsel in the past, so I'm not surprised > > they aren't talking to you; you won't be a known contact to them as a PG > >

partition pruning doesn't work with IS NULL clause in multikey range partition case

2018-07-11 Thread Ashutosh Bapat
Hi, Consider following test case. create table prt (a int, b int, c int) partition by range(a, b); create table prt_p1 partition of prt for values (0, 0) to (100, 100); create table prt_p1 partition of prt for values from (0, 0) to (100, 100); create table prt_p2 partition of prt for values from

Re: Negotiating the SCRAM channel binding type

2018-07-11 Thread Bruce Momjian
On Wed, Jul 11, 2018 at 12:27:33PM +0300, Heikki Linnakangas wrote: > Currently, there is no negotiation of the channel binding type between > client and server. The server advertises that it supports channel binding, > or not, and the client decides what channel binding to use. If the server >

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

2018-07-11 Thread Etsuro Fujita
(2018/07/10 19:58), Ashutosh Bapat wrote: On Tue, Jul 10, 2018 at 9:08 AM, Etsuro Fujita wrote: (2018/07/09 20:43), Ashutosh Bapat wrote: At the cost of having targetlist being type inconsistent. I don't have any testcase either to show that that's a problem in practice. As I said before,

Re: Libpq support to connect to standby server as priority

2018-07-11 Thread Haribabu Kommi
On Wed, Jul 4, 2018 at 11:14 PM Laurenz Albe wrote: > Haribabu Kommi wrote: > > On Wed, Jan 24, 2018 at 9:01 AM Jing Wang wrote: > > > Hi All, > > > > > > Recently I put a proposal to support 'prefer-read' parameter in > target_session_attrs in libpq. Now I updated the patch with adding content

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

2018-07-11 Thread Ashutosh Bapat
On Wed, Jul 11, 2018 at 1:23 PM, Etsuro Fujita wrote: > > > Actually, even if we could create such an index on the child table and the > targetlist had the ConvertRowtypeExpr, the planner would still not be able > to use an index-only scan with that index; because check_index_only would > not

Re: Problem with tupdesc in jsonb_to_recordset

2018-07-11 Thread Michael Paquier
On Wed, Jul 11, 2018 at 03:27:13PM +0900, Michael Paquier wrote: > I don't think that your solution is correct. From my read of 37a795a6, > the tuple descriptor is moved from the query-lifespan memory context > (ecxt_per_query_memory) to a function-level context, which could cause > the

Allow to specify a index name as ANALYZE parameter

2018-07-11 Thread Yugo Nagata
Hi, When we specify column names for ANALYZE, only the statistics for those columns are collected. Similarly, is it useful if we have a option to specify an index for ANALYZE to collect only the statistics for expression in the specified index? A usecase I suppose is that when a new expression

Re: Problem with tupdesc in jsonb_to_recordset

2018-07-11 Thread Dmitry Dolgov
> On Wed, 11 Jul 2018 at 08:27, Michael Paquier wrote: > > On Tue, Jul 10, 2018 at 10:39:28PM +0200, Dmitry Dolgov wrote: > > I've found out that currently in some situations jsonb_to_recordset can > > lead to > > a crash. Minimal example that I've managed to create looks like this: > > It would

Re: partition pruning doesn't work with IS NULL clause in multikey range partition case

2018-07-11 Thread Dilip Kumar
On Wed, Jul 11, 2018 at 3:06 PM, Ashutosh Bapat wrote: > Hi, > Consider following test case. > create table prt (a int, b int, c int) partition by range(a, b); > create table prt_p1 partition of prt for values (0, 0) to (100, 100); > create table prt_p1 partition of prt for values from (0, 0) to

Re: Excessive PostmasterIsAlive calls slow down WAL redo

2018-07-11 Thread Heikki Linnakangas
On 11/07/18 04:16, Thomas Munro wrote: On Tue, Jul 10, 2018 at 11:39 PM, Heikki Linnakangas wrote: I don't have a FreeBSD machine at hand, so I didn't try fixing that patch. I updated the FreeBSD version to use the header test approach you showed, and pushed that too. FWIW the build farm

Re: Problem with tupdesc in jsonb_to_recordset

2018-07-11 Thread Andrew Gierth
> "Michael" == Michael Paquier writes: >> I don't think that your solution is correct. From my read of >> 37a795a6, the tuple descriptor is moved from the query-lifespan >> memory context (ecxt_per_query_memory) to a function-level context, >> which could cause the descriptor to become

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2018-07-11 Thread Marina Polyakova
On 09-07-2018 16:05, Fabien COELHO wrote: Hello Marina, Hello, Fabien! Here is a review for the last part of your v9 version. Thank you very much for this! Patch does not "git apply" (may anymore): error: patch failed: doc/src/sgml/ref/pgbench.sgml:513 error:

Negotiating the SCRAM channel binding type

2018-07-11 Thread Heikki Linnakangas
Currently, there is no negotiation of the channel binding type between client and server. The server advertises that it supports channel binding, or not, and the client decides what channel binding to use. If the server doesn't support the binding type that the client chose, authentication

Cannot dump foreign key constraints on partitioned table

2018-07-11 Thread amul sul
Hi, On the master head, getConstraints() function skips FK constraints for a partitioned table because of tbinfo->hastriggers is false. While creating FK constraints on the partitioned table, the FK triggers are only created on leaf partitions and skipped for the partitioned tables. To fix

Re: Jsonb transform for pl/python

2018-07-11 Thread Alexander Korotkov
On Wed, Jul 11, 2018 at 12:30 AM Tom Lane wrote: > Peter Eisentraut writes: > > On 6/23/18 01:44, Nikita Glukhov wrote: > >> We are simply trying first to convert numeric to int64 if is does not have > >> digits after the decimal point, and then construct Python Int instead of > >> Decimal.

Re: How can we submit code patches that implement our (pending) patents?

2018-07-11 Thread Nico Williams
On Tue, Jul 10, 2018 at 09:47:09AM -0400, Tom Lane wrote: > The core team has considered this matter, and has concluded that it's > time to establish a firm project policy that we will not accept any code > that is known to be patent-encumbered. The long-term legal risks and > complications

Re: Negotiating the SCRAM channel binding type

2018-07-11 Thread Bruce Momjian
On Wed, Jul 11, 2018 at 04:00:47PM +0300, Heikki Linnakangas wrote: > In a nutshell, to get the token for tls-server-end-point, you need to get > the peer's certificate from the TLS library, in raw DER format, and > calculate a hash over it. The hash algorithm depends on the > signatureAlgorithm

Re: How can we submit code patches that implement our (pending) patents?

2018-07-11 Thread Nico Williams
On Tue, Jul 10, 2018 at 08:20:53AM +, Tsunakawa, Takayuki wrote: > From: Nico Williams [mailto:n...@cryptonector.com] > > On Sat, Jul 07, 2018 at 10:20:35AM -0700, Andres Freund wrote: > > > It's entirely possible to dual license contributions and everything. Why > > > are you making such

Re: patch to allow disable of WAL recycling

2018-07-11 Thread Jerry Jelinek
Alvaro, I'll perform several test runs with various combinations and post the results. Thanks, Jerry On Tue, Jul 10, 2018 at 2:34 PM, Alvaro Herrera wrote: > On 2018-Jul-10, Jerry Jelinek wrote: > > > 2) Disabling WAL recycling reduces reliability, even on COW filesystems. > > I think the

Re: Preferring index-only-scan when the cost is equal

2018-07-11 Thread Tomas Vondra
On 07/11/2018 01:28 PM, Ashutosh Bapat wrote: On Wed, Jul 11, 2018 at 11:03 AM, Yugo Nagata wrote: Hi, I found that there is a situation that even when index only scan can be effective, the planner doesn't select this. The planner makes indexe paths in descending order of indexrelid, and

Re: [HACKERS] GnuTLS support

2018-07-11 Thread Heikki Linnakangas
On 05/06/18 00:44, Peter Eisentraut wrote: On 6/2/18 16:50, Heikki Linnakangas wrote: On 08/03/18 14:13, Peter Eisentraut wrote: There are two failures in the SSL tests that I cannot explain. The tests are for some rather obscure configurations, so the changed behaviors are not obviously

Re: How can we submit code patches that implement our (pending) patents?

2018-07-11 Thread Nico Williams
On Wed, Jul 11, 2018 at 01:03:44AM +, Tsunakawa, Takayuki wrote: > From: Tom Lane [mailto:t...@sss.pgh.pa.us] > > The core team has considered this matter, and has concluded that it's > > time to establish a firm project policy that we will not accept any code > > that is known to be

Re: In pageinspect, perform clean-up after testing gin-related functions

2018-07-11 Thread Andres Freund
On 2018-07-11 12:56:49 +0530, Amit Kapila wrote: > On Wed, Jul 11, 2018 at 12:37 PM, Kuntal Ghosh > wrote: > > Hello all, > > > > In pageinspect/sql/gin.sql, we don't drop the table test1 at the end > > of the test. IMHO, we should clean-up at the end of a test. > > > > Yeah, it is good practice

Re: [PATCH] btree_gist: fix union implementation for variable length columns

2018-07-11 Thread Tom Lane
Pavel Raiskup writes: > On Monday, July 9, 2018 7:41:59 PM CEST Tom Lane wrote: >> Hi Pavel! For patches that purport to resolve bugs, we usually like to >> add a regression test case that demonstrates the bug in unpatched code. >> Can you provide a small test case that does so? (The BZ you

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2018-07-11 Thread Alvaro Herrera
On 2018-Jul-11, Marina Polyakova wrote: > can we try something like this? > > PGBENCH_ERROR_START(DEBUG_FAIL) > { > PGBENCH_ERROR("client %d repeats the failed transaction (try %d", > st->id, st->retries + 1); > if (max_tries) >

Re: cursors with prepared statements

2018-07-11 Thread Heikki Linnakangas
On 07/06/18 22:42, Peter Eisentraut wrote: I have developed a patch that allows declaring cursors over prepared statements: DECLARE cursor_name CURSOR FOR prepared_statement_name [ USING param, param, ... ] This is an SQL standard feature. ECPG already

Costing bug in hash join logic for semi joins

2018-07-11 Thread RK Korlapati
There is a costing bug in hash join logic seems to have been introduced by the patch related to inner_unique enhancements(commit: 9c7f5229ad68d7e0e4dd149e3f80257893e404d4). Specifically, "hashjointuples" which tracks the number of matches for hash clauses is computed wrong for inner unique

Re: In pageinspect, perform clean-up after testing gin-related functions

2018-07-11 Thread Tom Lane
Andres Freund writes: > On 2018-07-11 12:56:49 +0530, Amit Kapila wrote: >> Yeah, it is good practice to drop the objects at the end. It is >> strange that original commit adfb81d9e1 has this at the end of the >> test, but a later commit 367b99bbb1 by Tom has removed the Drop >> statement.

Re: no partition pruning when partitioning using array type

2018-07-11 Thread Alvaro Herrera
On 2018-Jul-11, Amit Langote wrote: > On 2018/07/11 13:12, Alvaro Herrera wrote: > > On 2018-Jul-11, Amit Langote wrote: > > > >> What's the solution here then? Prevent domains as partition key? > > > > Maybe if a domain is used in a partition key somewhere, prevent > > constraints from being

Re: [PATCH] Add missing type conversion functions for PL/Python

2018-07-11 Thread Heikki Linnakangas
On 26/03/18 19:07, Nikita Glukhov wrote: Attached fixed 3th version of the patch: Thanks, I'm reviewing this now. Nice speedup! There is no test coverage for some of the added code. You can get a code coverage report with: ./configure --enable-coverage ... make make -C src/pl/plpython

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2018-07-11 Thread Alvaro Herrera
Just a quick skim while refreshing what were those error reporting API changes about ... On 2018-May-21, Marina Polyakova wrote: > v9-0001-Pgbench-errors-use-the-RandomState-structure-for-.patch > - a patch for the RandomState structure (this is used to reset a client's > random seed during the

Re: [PATCH] btree_gist: fix union implementation for variable length columns

2018-07-11 Thread Pavel Raiskup
On Wednesday, July 11, 2018 7:26:40 PM CEST Tom Lane wrote: > Pavel Raiskup writes: > > On Monday, July 9, 2018 7:41:59 PM CEST Tom Lane wrote: > >> Hi Pavel! For patches that purport to resolve bugs, we usually like to > >> add a regression test case that demonstrates the bug in unpatched code.

Re: Shared buffer access rule violations?

2018-07-11 Thread Asim R P
On Tue, Jul 10, 2018 at 8:33 PM, Tom Lane wrote: > Asim R P writes: > >> One can find several PageInit() calls with no content lock held. See, >> for example: > >> fill_seq_with_data() > > That would be for a relation that no one else can even see yet, no? Yes, when the sequence is being

Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints

2018-07-11 Thread Nico Williams
On Tue, Jun 26, 2018 at 04:54:13PM -0400, Robbie Harwood wrote: > Nico Williams writes: > > > [Re-send; first attempt appears to have hit /dev/null somewhere. My > > apologies if you get two copies.] > > > > I've finally gotten around to rebasing this patch and making the change > > that was

Shouldn't validateForeignKeyConstraint() reset memory context?

2018-07-11 Thread Andres Freund
Hi, while looking at the pluggable storage patch I noticed that validateForeignKeyConstraint() calls RI_FKey_check() for each row without resetting a memory / expression context. There's not too much leakage in the called code, but there's some I think. Greetings, Andres Freund

Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints

2018-07-11 Thread Alvaro Herrera
On 2018-Jun-06, Nico Williams wrote: > I've finally gotten around to rebasing this patch and making the change > that was requested, which was: merge the now-would-be-three deferral- > related bool columns in various pg_catalog tables into one char column. > > Instead of (deferrable,

Re: Allow to specify a index name as ANALYZE parameter

2018-07-11 Thread Alexander Korotkov
Hi! On Wed, Jul 11, 2018 at 12:04 PM Yugo Nagata wrote: > When we specify column names for ANALYZE, only the statistics for those > columns > are collected. Similarly, is it useful if we have a option to specify an index > for ANALYZE to collect only the statistics for expression in the

Re: Negotiating the SCRAM channel binding type

2018-07-11 Thread Heikki Linnakangas
On 11/07/18 12:27, Heikki Linnakangas wrote: Based on recent discussions, it looks like there's going to be differences in this area [1]. OpenSSL can support both tls-unique and tls-server-end-point. Java only supports tls-server-end-point, while GnuTLS only supports tls-unique. And Mac OS

Re: _isnan() on Windows

2018-07-11 Thread Alvaro Herrera
On 2018-Jul-11, Michael Paquier wrote: > On Tue, Jul 10, 2018 at 04:23:42PM -0400, Tom Lane wrote: > > Alvaro Herrera writes: > >> On 2018-Jul-10, Tom Lane wrote: > >>> I disagree --- including in c.h, as this would have us do, > >>> seems like a huge expansion of the visibility of that header.

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2018-07-11 Thread Fabien COELHO
Hello Marina, * -d/--debug: I'm not in favor in requiring a mandatory text argument on this option. As you wrote in [1], adding an additional option is also a bad idea: Hey, I'm entitled to some internal contradictions:-) I'm sceptical of the "--debug-fails" options. ISTM that --debug is

Re: Problem with tupdesc in jsonb_to_recordset

2018-07-11 Thread Michael Paquier
On Wed, Jul 11, 2018 at 11:38:46AM +0100, Andrew Gierth wrote: > My first approach - assuming that update_cached_tupdesc has good reason > to make a copy, which I'm not convinced is the case - would be to simply > make a per-query-context copy of the tupdesc to assign to rsi.setDesc in > order to

Re: partition pruning doesn't work with IS NULL clause in multikey range partition case

2018-07-11 Thread Dilip Kumar
On Wed, Jul 11, 2018 at 4:20 PM, Dilip Kumar wrote: > On Wed, Jul 11, 2018 at 3:06 PM, Ashutosh Bapat > wrote: >> Hi, >> Consider following test case. >> create table prt (a int, b int, c int) partition by range(a, b); >> create table prt_p1 partition of prt for values (0, 0) to (100, 100); >>

Re: partition pruning doesn't work with IS NULL clause in multikey range partition case

2018-07-11 Thread amul sul
On Wed, Jul 11, 2018 at 5:10 PM Dilip Kumar wrote: > > On Wed, Jul 11, 2018 at 4:20 PM, Dilip Kumar wrote: > > On Wed, Jul 11, 2018 at 3:06 PM, Ashutosh Bapat > > wrote: > >> Hi, > >> Consider following test case. > >> create table prt (a int, b int, c int) partition by range(a, b); > >> create

Re: Add function to release an allocated SQLDA

2018-07-11 Thread Thomas Munro
On Tue, Jun 19, 2018 at 9:11 PM, Kato, Sho wrote: >>This is not clear to me. ECPGfreeSQLDA() releases a whole chain, but >>free() only releases a single SQLDA(), so they are obviously not >>interchangeable. When exactly should a user prefer one over the other? > > If an application use FETCH

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-07-11 Thread Alvaro Herrera
On 2018-Jul-11, David Rowley wrote: > On 6 July 2018 at 21:25, Kato, Sho wrote: > > 2. 11beta2 + patch1 + patch2 > > > > patch1: Allow direct lookups of AppendRelInfo by child relid > > commit 7d872c91a3f9d49b56117557cdbb0c3d4c620687 > > patch2:

Re: Preferring index-only-scan when the cost is equal

2018-07-11 Thread Ashutosh Bapat
On Wed, Jul 11, 2018 at 11:03 AM, Yugo Nagata wrote: > Hi, > > I found that there is a situation that even when index only scan can be > effective, > the planner doesn't select this. The planner makes indexe paths in descending > order of indexrelid, and the new path is discarded if its cost is

Re: partition pruning doesn't work with IS NULL clause in multikey range partition case

2018-07-11 Thread Dilip Kumar
On Wed, Jul 11, 2018 at 5:36 PM, amul sul wrote: > On Wed, Jul 11, 2018 at 5:10 PM Dilip Kumar wrote: >> > I am not sure that I have understand the following comments > 11 +* Generate one prune step for the information derived from IS NULL, > 12 +* if any. To prune hash partitions,

Re: Concurrency bug in UPDATE of partition-key

2018-07-11 Thread Alvaro Herrera
On 2018-Jul-11, Amit Kapila wrote: > Attached, please find an updated patch based on comments by Alvaro. > See, if this looks okay to you guys. LGTM as far as my previous comments are concerned. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support,

Re: Negotiating the SCRAM channel binding type

2018-07-11 Thread Michael Paquier
On Wed, Jul 11, 2018 at 12:27:33PM +0300, Heikki Linnakangas wrote: > as the supported mechanisms, we change that into: > > SCRAM-SHA-256-PLUS tls-unique > SCRAM-SHA-256-PLUS tls-server-end-point > SCRAM-SHA-256 Can we say for sure that there won't be other options associated to a given SASL

Re: Negotiating the SCRAM channel binding type

2018-07-11 Thread Heikki Linnakangas
On 11/07/18 14:37, Michael Paquier wrote: On Wed, Jul 11, 2018 at 12:27:33PM +0300, Heikki Linnakangas wrote: as the supported mechanisms, we change that into: SCRAM-SHA-256-PLUS tls-unique SCRAM-SHA-256-PLUS tls-server-end-point SCRAM-SHA-256 Can we say for sure that there won't be other

Re: Accounting of zero-filled buffers in EXPLAIN (BUFFERS)

2018-07-11 Thread Haribabu Kommi
On Mon, Apr 30, 2018 at 1:38 PM Thomas Munro wrote: > On Mon, Apr 30, 2018 at 3:13 PM, Andres Freund wrote: > > On 2018-04-30 14:59:31 +1200, Thomas Munro wrote: > >> In EXPLAIN (BUFFERS), there are two kinds of cache misses that show up > >> as "reads" when in fact they are not reads at all: >

Re: [HACKERS] Two pass CheckDeadlock in contentent case

2018-07-11 Thread Ashutosh Bapat
The patch still applies and it's part of this commitfest. On Tue, Oct 3, 2017 at 8:36 PM, Sokolov Yura wrote: > On 2017-10-03 17:30, Sokolov Yura wrote: >> >> Good day, hackers. >> >> During hard workload sometimes process reaches deadlock timeout >> even if no real deadlock occurred. It is

Re: GiST VACUUM

2018-07-11 Thread Andrey Borodin
Hi, Heikki! Thanks for looking into the patch! > 11 июля 2018 г., в 0:07, Heikki Linnakangas написал(а): > > I'm now looking at the first patch in this series, to allow completely empty > GiST pages to be recycled. I've got some questions: > >> --- a/src/backend/access/gist/gist.c >> +++

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2018-07-11 Thread Marina Polyakova
On 11-07-2018 16:24, Fabien COELHO wrote: Hello Marina, * -d/--debug: I'm not in favor in requiring a mandatory text argument on this option. As you wrote in [1], adding an additional option is also a bad idea: Hey, I'm entitled to some internal contradictions:-) ... and discussions will

Re: [PATCH] btree_gist: fix union implementation for variable length columns

2018-07-11 Thread Pavel Raiskup
Hi Tom, On Monday, July 9, 2018 7:41:59 PM CEST Tom Lane wrote: > Pavel Raiskup writes: > > while I tried to debug 'gcc -fstack-protector -O3' problems in [1], I > > noticed > > that gbt_var_union() mistreats the first vector element. Patch is attached. > > Hi Pavel! For patches that purport

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2018-07-11 Thread Fabien COELHO
can we try something like this? PGBENCH_ERROR_START(DEBUG_FAIL) { PGBENCH_ERROR("client %d repeats the failed transaction (try %d", Argh, no? I was thinking of something much more trivial: pgbench_error(DEBUG, "message format %d %s...", 12, "hello world"); If you really need

Re: make installcheck-world in a clean environment

2018-07-11 Thread Tom Lane
Alexander Lakhin writes: > 06.07.2018 00:39, Peter Eisentraut wrote: >> Exactly what order of steps are you executing that doesn't work? > In Centos 7, using the master branch from git: > ./configure --enable-tap-tests > make install > make install -C contrib > chown -R postgres:postgres

Re: Allow to specify a index name as ANALYZE parameter

2018-07-11 Thread Yugo Nagata
On Wed, 11 Jul 2018 14:26:03 +0300 Alexander Korotkov wrote: > On Wed, Jul 11, 2018 at 12:04 PM Yugo Nagata wrote: > > When we specify column names for ANALYZE, only the statistics for those > > columns > > are collected. Similarly, is it useful if we have a option to specify an > > index >

Re: TRUNCATE tables referenced by FKs on partitioned tables

2018-07-11 Thread Michael Paquier
On Wed, Jul 11, 2018 at 06:59:16PM -0400, Alvaro Herrera wrote: > Anyway, this patch seems to fix it, and adds what I think is appropriate > test coverage. This looks good to me. I am noticing that the documentation of TRUNCATE does not mention that when running the command on a partitioned

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

2018-07-11 Thread Etsuro Fujita
(2018/07/11 20:02), Ashutosh Bapat wrote: On Wed, Jul 11, 2018 at 1:23 PM, Etsuro Fujita wrote: Actually, even if we could create such an index on the child table and the targetlist had the ConvertRowtypeExpr, the planner would still not be able to use an index-only scan with that index;

RE: How can we submit code patches that implement our (pending) patents?

2018-07-11 Thread Tsunakawa, Takayuki
From: Nico Williams [mailto:n...@cryptonector.com] > On Thu, Jul 12, 2018 at 12:29:12AM +, Tsunakawa, Takayuki wrote: > > How can one make defensive use of his patent if he allows everyone to > > use it royalty-free? Can he use his patent for cross-licensing > > negotiation if some commercial

Re: Accounting of zero-filled buffers in EXPLAIN (BUFFERS)

2018-07-11 Thread David Rowley
On 12 July 2018 at 12:19, Haribabu Kommi wrote: > Yes, I agree that we may need a new counter that counts the buffers that > are just allocated (no read or no write). But currently, may be the counter > value is very less, so people are not interested. The existing counters don't show up in

Re: [HACKERS] Replication status in logical replication

2018-07-11 Thread Masahiko Sawada
On Thu, Jul 12, 2018 at 10:22 AM, Michael Paquier wrote: > On Tue, Jul 10, 2018 at 10:14:35AM +0900, Michael Paquier wrote: >> Thanks. If there are no objections, then I will try to wrap this stuff >> on Thursday my time. > > And done down to 9.4. Thank you! Regards, -- Masahiko Sawada NIPPON

Re: Failure assertion in GROUPS mode of window function in current HEAD

2018-07-11 Thread Masahiko Sawada
On Wed, Jul 11, 2018 at 4:21 AM, Tom Lane wrote: > Masahiko Sawada writes: >> BTW, I found an another but related issue. We can got an assertion >> failure also by the following query. > >> =# select sum(c) over (partition by c order by c groups between 1 >> preceding and current row) from test;

bgworkers should share more of BackendRun / PostgresMain

2018-07-11 Thread Craig Ringer
Hi folks As I work on background workers almost exclusively at the moment, I keep on running into things that are just not initialized, or not supported, in bgworkers. Many are quite surprising. I think bgworkers should just share more of the main Pg startup path. My latest surprise is that we

Re: How can we submit code patches that implement our (pending) patents?

2018-07-11 Thread Nico Williams
On Thu, Jul 12, 2018 at 01:10:33AM +, Tsunakawa, Takayuki wrote: > From: Nico Williams [mailto:n...@cryptonector.com] > > On Thu, Jul 12, 2018 at 12:29:12AM +, Tsunakawa, Takayuki wrote: > > > How can one make defensive use of his patent if he allows everyone to > > > use it royalty-free?

Re: Negotiating the SCRAM channel binding type

2018-07-11 Thread Michael Paquier
On Wed, Jul 11, 2018 at 03:01:03PM +0300, Heikki Linnakangas wrote: > That would be more complicated to parse. Yeah, we might need further options > for some SASL mechanisms in the future, but we can cross that bridge when we > get there. I don't see any need to complicate this case for that.

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

2018-07-11 Thread Ashutosh Bapat
On Thu, Jul 12, 2018 at 9:02 AM, Etsuro Fujita wrote: > (2018/07/11 20:02), Ashutosh Bapat wrote: >> >> On Wed, Jul 11, 2018 at 1:23 PM, Etsuro Fujita >> wrote: >>> >>> Actually, even if we could create such an index on the child table and >>> the >>> targetlist had the ConvertRowtypeExpr, the

Re: partition pruning doesn't work with IS NULL clause in multikey range partition case

2018-07-11 Thread Amit Langote
Thanks Ashutosh for reporting and Dilip for the analysis and the patch. On 2018/07/11 21:39, Dilip Kumar wrote: > On Wed, Jul 11, 2018 at 5:36 PM, amul sul wrote: >> On Wed, Jul 11, 2018 at 5:10 PM Dilip Kumar wrote: > >>> >> I am not sure that I have understand the following comments >> 11 +

Re: partition pruning doesn't work with IS NULL clause in multikey range partition case

2018-07-11 Thread Amit Langote
On 2018/07/12 14:32, Amit Langote wrote: > Thanks Ashutosh for reporting and Dilip for the analysis and the patch. > > On 2018/07/11 21:39, Dilip Kumar wrote: >> On Wed, Jul 11, 2018 at 5:36 PM, amul sul wrote: >>> On Wed, Jul 11, 2018 at 5:10 PM Dilip Kumar wrote: >> >>> I am not sure

Re: How can we submit code patches that implement our (pending) patents?

2018-07-11 Thread Craig Ringer
On 12 July 2018 at 09:10, Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > From: Nico Williams [mailto:n...@cryptonector.com] > > On Thu, Jul 12, 2018 at 12:29:12AM +, Tsunakawa, Takayuki wrote: > > > How can one make defensive use of his patent if he allows everyone to > > >

Re: Preferring index-only-scan when the cost is equal

2018-07-11 Thread Yugo Nagata
On Wed, 11 Jul 2018 14:37:46 +0200 Tomas Vondra wrote: > > On 07/11/2018 01:28 PM, Ashutosh Bapat wrote: > > I don't think we should change add_path() for this. We will > > unnecessarily check that condition even for the cases where we do not > > create index paths. I think we should fix the

Re: How can we submit code patches that implement our (pending) patents?

2018-07-11 Thread Nico Williams
On Thu, Jul 12, 2018 at 09:33:21AM +0800, Craig Ringer wrote: > On 12 July 2018 at 09:10, Tsunakawa, Takayuki < > tsunakawa.ta...@jp.fujitsu.com> wrote: > > From: Nico Williams [mailto:n...@cryptonector.com] > > > On Thu, Jul 12, 2018 at 12:29:12AM +, Tsunakawa, Takayuki wrote: > > > > How can

Re: CVE-2017-7484-induced bugs, or, btree cmp functions are not leakproof?

2018-07-11 Thread Tom Lane
I wrote: > I propose to run through the system operator classes, find any for which > the comparison function isn't marked leakproof but the operators are, > and fix them. This is clearly appropriate for HEAD and maybe it's not > too late to force an initdb for v11 --- thoughts? I did that for

Re: patch to allow disable of WAL recycling

2018-07-11 Thread David Pacheco
On Tue, Jul 10, 2018 at 1:34 PM, Alvaro Herrera wrote: > On 2018-Jul-10, Jerry Jelinek wrote: > > > 2) Disabling WAL recycling reduces reliability, even on COW filesystems. > > I think the problem here is that WAL recycling in normal filesystems > helps protect the case where filesystem gets

Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints

2018-07-11 Thread Nico Williams
Attached is an additional patch, as well as a new, rebased patch. This includes changes responsive to Álvaro Herrera's commentary about the SET CONSTRAINTS manual page. Nico -- >From e7838b60dbf0a8cd7f35591db2f9aab78d8903cb Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Wed, 11 Jul 2018

Re: _isnan() on Windows

2018-07-11 Thread Michael Paquier
On Wed, Jul 11, 2018 at 09:13:40AM -0400, Alvaro Herrera wrote: > I just pushed it before seeing your message. Fine as well, thanks for picking this up. The buildfarm shows no failures about this patch. -- Michael signature.asc Description: PGP signature

Re: Cannot dump foreign key constraints on partitioned table

2018-07-11 Thread Michael Paquier
On Wed, Jul 11, 2018 at 03:49:59PM +0530, amul sul wrote: > On the master head, getConstraints() function skips FK constraints for > a partitioned table because of tbinfo->hastriggers is false. > > While creating FK constraints on the partitioned table, the FK triggers are > only > created on

Re: [HACKERS] Replication status in logical replication

2018-07-11 Thread Michael Paquier
On Tue, Jul 10, 2018 at 10:14:35AM +0900, Michael Paquier wrote: > Thanks. If there are no objections, then I will try to wrap this stuff > on Thursday my time. And done down to 9.4. -- Michael signature.asc Description: PGP signature

pread() and pwrite()

2018-07-11 Thread Thomas Munro
Hello hackers, A couple of years ago, Oskari Saarenmaa proposed a patch[1] to adopt $SUBJECT. Last year, Tobias Oberstein argued again that we should do that[2]. At the end of that thread there was a +1 from multiple committers in support of getting it done for PostgreSQL 12. Since Oskari

Re: Add SKIP LOCKED to VACUUM and ANALYZE

2018-07-11 Thread Michael Paquier
On Wed, Jun 13, 2018 at 08:29:12PM +, Bossart, Nathan wrote: > Previous thread: > https://postgr.es/m/4BC0F3CD-F4B5-4F23-AADB-80607F9E4B4E%40amazon.com > > This is a new thread for tracking the work to add SKIP LOCKED to > VACUUM and ANALYZE. I've attached a rebased set of patches. I am

RE: How can we submit code patches that implement our (pending) patents?

2018-07-11 Thread Tsunakawa, Takayuki
From: Nico Williams [mailto:n...@cryptonector.com] > On Wed, Jul 11, 2018 at 01:03:44AM +, Tsunakawa, Takayuki wrote: > > As a practical matter, when and where are you planning to post the > > project policy? How would you check and prevent patented code? > > PG may need a contributor

Re: Costing bug in hash join logic for semi joins

2018-07-11 Thread David Rowley
On 10 July 2018 at 22:21, David Rowley wrote: > I've done that in the attached. Also on reading the comment above, it > looks slightly incorrect. To me, it looks like it's applying a > twentieth of the cost and not a tenth as the comment claims. I > couldn't resist updating that too. I've added

Segfault logical replication PG 10.4

2018-07-11 Thread Mai Peng
We discovered our pg_wal partition was full few days after setting our first logical publication on a PG 10.4 instance. Then, we can not synchronise our slave to the master, it triggers a segfault on the slave. We had to drop manually the subscription on slave and the slot on master. Then, we

RE: How can we submit code patches that implement our (pending) patents?

2018-07-11 Thread Tsunakawa, Takayuki
From: Nico Williams [mailto:n...@cryptonector.com] > You're proposing to include code that implements patented ideas with a > suitable patent grant. I would be free to not read the patent, but what > if the code or documents mention the relevant patented algorithms? > > If I come across

Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints

2018-07-11 Thread Nico Williams
On Wed, Jul 11, 2018 at 01:41:12PM -0500, Nico Williams wrote: > > > @@ -5538,17 +5568,24 @@ ConstraintAttributeSpec: > > > int newspec = $1 | $2; > > > > > > /* special message for this case */ > > > -

Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints

2018-07-11 Thread Nico Williams
On Wed, Jul 11, 2018 at 03:13:30PM -0400, Alvaro Herrera wrote: > On 2018-Jun-06, Nico Williams wrote: > > I've finally gotten around to rebasing this patch and making the change > > that was requested, which was: merge the now-would-be-three deferral- > > related bool columns in various

Re: patch to allow disable of WAL recycling

2018-07-11 Thread Andres Freund
Hi, On 2018-07-10 14:15:30 -0600, Jerry Jelinek wrote: > Thanks to everyone who took the time to look at the patch and send me > feedback. I'm happy to work on improving the documentation of this new > tunable to clarify when it should be used and the implications. I'm trying > to understand

Re: Accounting of zero-filled buffers in EXPLAIN (BUFFERS)

2018-07-11 Thread Thomas Munro
On Thu, Jul 12, 2018 at 12:46 AM, Haribabu Kommi wrote: >> > On 2018-04-30 14:59:31 +1200, Thomas Munro wrote: >> >> In EXPLAIN (BUFFERS), there are two kinds of cache misses that show up >> >> as "reads" when in fact they are not reads at all: >> >> >> >> 1. Relation extension, which in fact

Re: TRUNCATE tables referenced by FKs on partitioned tables

2018-07-11 Thread Alvaro Herrera
On 2018-Jul-11, Michael Paquier wrote: > > alvherre=# truncate table prim, partfk; > > ERROR: cannot truncate a table referenced in a foreign key constraint > > DETALLE: Table "partfk" references "prim". > > SUGERENCIA: Truncate table "partfk" at the same time, or use TRUNCATE ... > >

Re: [HACKERS] autovacuum can't keep up, bloat just continues to rise

2018-07-11 Thread Peter Geoghegan
On Mon, Jul 24, 2017 at 11:12 AM, Peter Geoghegan wrote: > You can get about a 1/3 loss of space by inserting randomly, rather > than inserting in sorted order, which is what REINDEX will more or > less do for you. That's because random workloads almost entirely get > 50:50 page splits, whereas

Re: patch to allow disable of WAL recycling

2018-07-11 Thread David Pacheco
On Tue, Jul 10, 2018 at 10:32 PM, Thomas Munro < thomas.mu...@enterprisedb.com> wrote: > On Wed, Jul 11, 2018 at 8:25 AM, Joshua D. Drake > wrote: > > On 07/10/2018 01:15 PM, Jerry Jelinek wrote: > >> > >> Thanks to everyone who took the time to look at the patch and send me > >> feedback. I'm

  1   2   >