Re: Possible bug in logical replication.

2018-07-09 Thread Michael Paquier
On Tue, Jul 03, 2018 at 09:16:42AM +0300, Arseny Sher wrote: > Michael Paquier writes: >> On Thu, Jun 21, 2018 at 07:31:20PM +0900, Michael Paquier wrote: >>> Could it be possible to get a patch from all the feedback and exchange >>> gathered here? Petr, I think that it would not hurt if you use

RE: Typo in Japanese translation of psql.

2018-07-09 Thread Taiki Kondo
Hello, Nagata san. Thank you for your reply and sorry for late response. > However, I think you have to submit the whole po file to Patch Tracker[1] > instead of a patch according to the wiki [2]. > > [1] https://redmine.postgresql.org/projects/pgtranslation > [2] https://wiki.postgresql.org/

Re: Generating partitioning tuple conversion maps faster

2018-07-09 Thread David Rowley
On 7 July 2018 at 01:08, Alexander Kuzmenkov wrote: > Great. I think we can use the same approach for make_inh_translation_list, > as in the attached patch. It show some improvement on test 6. I got the > following tps, median of 11 runs (forgot to turn off fsync though): > > test masterv3

Re: Possible bug in logical replication.

2018-07-09 Thread Arseny Sher
Michael Paquier writes: > Okay, let's do as you suggest then. Do you find the attached adapted? Yes, thanks! -- Arseny Sher Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

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

2018-07-09 Thread Tsunakawa, Takayuki
From: davecra...@gmail.com [mailto:davecra...@gmail.com] On Behalf Of > Dave Cramer > Certainly there is history of people using PG code for non-PostgreSQL or > at least commercial derivative work. Greenplum for example. Yes, we would be glad if companies in the PostgreSQL community, including Gr

Re: Range phrase operator in tsquery

2018-07-09 Thread Aleksandr Parfenov
Hello hackers, Updated version of the patch in the attachment. -- Aleksandr Parfenov Postgres Professional: http://www.postgrespro.com Russian Postgres Company diff --git a/doc/src/sgml/textsearch.sgml b/doc/src/sgml/textsearch.sgml index 8075ea94e7..a661373d1b 100644 --- a/doc/src/sgml/textsear

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

2018-07-09 Thread Craig Ringer
On 9 July 2018 at 15:51, Tsunakawa, Takayuki wrote: > From: davecra...@gmail.com [mailto:davecra...@gmail.com] On Behalf Of > > Dave Cramer > > Certainly there is history of people using PG code for non-PostgreSQL or > > at least commercial derivative work. Greenplum for example. > > Yes, we woul

Re: [HACKERS] Replication status in logical replication

2018-07-09 Thread Masahiko Sawada
On Fri, Jul 6, 2018 at 2:21 PM, Michael Paquier wrote: > On Thu, Jul 05, 2018 at 05:13:27PM +0900, Michael Paquier wrote: >> This concerns as well v10, so that's not actually an open item... >> Well, it was an open item last year. The last set of patches is from >> Simon here: >> https://www.post

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

2018-07-09 Thread Markus Wanner
David, On 07/07/2018 09:52 PM, David Fetter wrote: > Any deviation from that process requires an explanation, which has not > thus far been proffered. Takayuki-san is *offering* a patent grant. That's something the TPL clearly doesn't cover. If they would follow the standard procedure, as you se

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

2018-07-09 Thread Tsunakawa, Takayuki
From: David Fetter [mailto:da...@fetter.org] > We went out of our way to excise code that the PostgreSQL license > doesn't cover some years back. I think that was done for good reasons, > which obtain to this day. While the introduction of code someone else > ultimately owns may seem harmless or ev

Re: Let's remove DSM_IMPL_NONE.

2018-07-09 Thread Kyotaro HORIGUCHI
At Mon, 9 Jul 2018 10:49:19 +0900, Michael Paquier wrote in <20180709014919.gh1...@paquier.xyz> > On Fri, Jul 06, 2018 at 11:08:02PM +0200, Peter Eisentraut wrote: > > On 26.06.18 09:10, Kyotaro HORIGUCHI wrote: > > I would avoid renumbering here. It was kind of sensible to have NONE = > > 0, so

Re: Subplan result caching

2018-07-09 Thread David Rowley
On 23 May 2018 at 21:31, Heikki Linnakangas wrote: > I've been working on a patch to add a little cache to SubPlans, to speed up > queries with correlated subqueries, where the same subquery is currently > executed multiple times with the same parameters. The idea is to cache the > result of the s

Re: Non-reserved replication slots and slot advancing

2018-07-09 Thread Kyotaro HORIGUCHI
Hello. At Mon, 9 Jul 2018 15:48:33 +0900, Michael Paquier wrote in <20180709064833.gb30...@paquier.xyz> > On Mon, Jul 09, 2018 at 03:13:04PM +0900, Kyotaro HORIGUCHI wrote: > > Looking the attached patch, I noticed that both "WAL" and "wal" > > are used in similar ERROR messages. Grepping the so

Re: Let's remove DSM_IMPL_NONE.

2018-07-09 Thread Arthur Zakirov
Hello, On Mon, Jul 09, 2018 at 06:07:24PM +0900, Kyotaro HORIGUCHI wrote: > The new version v4 is changed in the following points. > > - Don't renumber the DSM_IMPL symbols, just removed _NONE. > > - Rewrote the pointed comment. > > - Revised the commit message removing a mention to an > alre

How to set array element to null value

2018-07-09 Thread Brahmam Eswar
I'm trying to reset array element to null. but 3rd line of below snippet is giving the compilation error. FOR indx_1 IN array_lower(X, 1)..array_upper(X, 1) LOOP IF X[indx_1].REFERENCE_VALUE = 'ABC' THEN X[indx_1].REFERENCE_VALUE:=''; END IF; END LOOP; -- Thanks & Regards, Brahmeswara Rao J.

Re: WAL prefetch

2018-07-09 Thread Tomas Vondra
On 07/09/2018 02:26 AM, Sean Chittenden wrote: > ... snip ... > The real importance of prefaulting becomes apparent in the following two situations: 1. Priming the OS's filesystem cache, notably after an OS restart. This is of value to all PostgreSQL scenarios, regardless of whether o

Allowing multiple DDL commands to run simultaneously

2018-07-09 Thread Simon Riggs
We use the word CONCURRENTLY to describe DDL that executes without preventing select, insert, update or delete against a table. That is not the topic discussed here. I've been asked if we could consider allowing more types of DDL to run at the same time as each other. Specifically, that all/most o

Re: How to set array element to null value

2018-07-09 Thread Pavel Stehule
2018-07-09 11:58 GMT+02:00 Brahmam Eswar : > I'm trying to reset array element to null. but 3rd line of below snippet > is giving the compilation error. > > > FOR indx_1 IN array_lower(X, 1)..array_upper(X, 1) LOOP > IF X[indx_1].REFERENCE_VALUE = 'ABC' THEN > X[indx_1].REFERENCE_VALUE:=''; > END

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

2018-07-09 Thread Nico Williams
On Thu, Jul 05, 2018 at 01:15:15AM +, Tsunakawa, Takayuki wrote: > From: Craig Ringer [mailto:cr...@2ndquadrant.com] > > I'm assuming you don't want to offer a grant that lets anyone use them for > > anything. But if you have a really broad grant to PostgreSQL, all someone > > would have to do

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

2018-07-09 Thread Etsuro Fujita
(2018/07/06 20:20), Ashutosh Bapat wrote: On Fri, Jul 6, 2018 at 4:29 PM, Etsuro Fujita wrote: (2018/07/04 21:37), Ashutosh Bapat wrote: On Wed, Jul 4, 2018 at 5:36 PM, Etsuro Fujita wrote: Let me explain about that: 1) my patch won't apply that function to a child if its top parent is

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2018-07-09 Thread Etsuro Fujita
(2018/07/09 9:00), Jeff Davis wrote: Committed. I made some small modifications and added a test for the case where the foreign table is a partition of a local table, which follows a different code path after commit 3d956d95. Great! Thanks for revising and committing, Jeff. Thanks for review

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

2018-07-09 Thread Ashutosh Bapat
On Mon, Jul 9, 2018 at 4:33 PM, Etsuro Fujita wrote: >> >> >> As I said, we do spend cycles in that function testing whether a node >> is Aggref or not even when the query doesn't have aggregates or >> grouping OR spend cycles in testing whether a node is a PlaceHolderVar >> when the query doesn't

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

2018-07-09 Thread Nico Williams
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 aggressive statements about a, so far, apparently > good faith engagement? One problem is that many contributors would not want to be tain

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

2018-07-09 Thread Nico Williams
On Mon, Jul 09, 2018 at 08:29:08AM +, Tsunakawa, Takayuki wrote: > > There are arguments made that TPL (and BSD, MIT etc) already includes an > > implicit patent grant, but while a longstanding theory, it's to my > > knowledge not legally been tested. > > When we find a reasonable consensus he

Re: Generating partitioning tuple conversion maps faster

2018-07-09 Thread Alexander Kuzmenkov
On 07/09/2018 10:13 AM, David Rowley wrote: I've attached v5. v5 looks good to me, I've changed the status to ready. Please feel free to add yourself as an author of this patch in the commitfest app. You've probably contributed about as much as I have to this. Thanks, I'm fine with being cr

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

2018-07-09 Thread Etsuro Fujita
(2018/07/09 20:06), Ashutosh Bapat wrote: On Mon, Jul 9, 2018 at 4:33 PM, Etsuro Fujita wrote: As I said, we do spend cycles in that function testing whether a node is Aggref or not even when the query doesn't have aggregates or grouping OR spend cycles in testing whether a node is a PlaceHold

Re: Concurrency bug in UPDATE of partition-key

2018-07-09 Thread Amit Kapila
On Mon, Jul 2, 2018 at 5:06 PM, Amit Khandekar wrote: > On 30 June 2018 at 19:20, Amit Kapila wrote: >> On Fri, Jun 29, 2018 at 11:22 PM, Alvaro Herrera >> wrote: >>> I was a bit surprised by the new epqslot output argument being added, >>> and now I think I know why: we already have es_trig_tu

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

2018-07-09 Thread Ashutosh Bapat
> > I don't have any numbers right now, so that is nothing but a concern. But as > I said in a previous email, in the approach I proposed, we don't need to > spend extra cycles where partitioning is not involved. I think that is a > good thing in itself. No? At the cost of having targetlist bein

Re: [GSoC] working status

2018-07-09 Thread Aleksander Alekseeev
Hello Charles, >The second review is coming. Here is my working status so far. 1. > Complete the thrift compact protocol implementation using bytea > interface. 2. Thrift type (binary protocol) is almost done, the only > remaining part is struct encoding and decoding. With the thrift type, > y

Re: [GSoC] working status

2018-07-09 Thread Aleksander Alekseeev
Hello Charles, > ``` > pg_thrift.c:1313:26: error: too few arguments to function > ‘array_create_iterator’ ArrayIterator iter = > array_create_iterator(parray, 0); ^ > In file included from pg_thrift.c:5: > .../postgresql-install/include/server/utils/array.h:418:22: > note: dec

Re: [GSoC] working status

2018-07-09 Thread Aleksander Alekseeev
Hello Charles, > > ``` > > pg_thrift.c:1313:26: error: too few arguments to function > > ‘array_create_iterator’ ArrayIterator iter = > > array_create_iterator(parray, 0); ^ > > In file included from pg_thrift.c:5: > > .../postgresql-install/include/server/utils/array.h:418:22

Re: missing toast table for pg_policy

2018-07-09 Thread Peter Eisentraut
On 15.06.18 21:15, Joe Conway wrote: > Not surprising -- thanks for the update. > >> It occurred to be that we could go further and create most toast >> tables automatically by taking advantage of the fact that the toast >> creation function is a no-op if there are no varlena attributes. The >> se

Un peu décu : Re: Performance regression with PostgreSQL 11 and partitioning

2018-07-09 Thread Christophe Courtois
Hello, J'ai eu peur, 7d872c91a3f9d49b56117557cdbb0c3d4c620687 n'est pas en bêta 2 mais bien dans REL_11_STABLE. J'ai relancé mes scripts avec 1 partitions vides, un peu à l'arrache et sans rigueur : la dernière version incluant ce patch est effectivement souvent moitié plus rapide qu'en 10, m

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

2018-07-09 Thread David Fetter
On Mon, Jul 09, 2018 at 08:29:08AM +, Tsunakawa, Takayuki wrote: > From: David Fetter [mailto:da...@fetter.org] > > We went out of our way to excise code that the PostgreSQL license > > doesn't cover some years back. I think that was done for good > > reasons, which obtain to this day. While th

Oops... Re: Un peu décu : Re: Performance regression with PostgreSQL 11 and partitioning

2018-07-09 Thread Christophe Courtois
Oops, that message was supposed to be in private. Sorry for the noise. -- Christophe Courtois

Re: How to set array element to null value

2018-07-09 Thread David Fetter
On Mon, Jul 09, 2018 at 03:28:45PM +0530, Brahmam Eswar wrote: > I'm trying to reset array element to null. You can do this in SQL as follows: SELECT ARRAY( SELECT CASE e WHEN 'ABC' THEN NULL ELSE e FROM UNNEST(x) _(e) ) This should really be going to pgsql-general because to is about ho

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

2018-07-09 Thread Fabien COELHO
Hello Marina, v9-0004-Pgbench-errors-and-serialization-deadlock-retries.patch - the main patch for handling client errors and repetition of transactions with serialization/deadlock failures (see the detailed description in the file). Here is a review for the last part of your v9 version.

Re: [HACKERS] PoC: full merge join on comparison clause

2018-07-09 Thread Ashutosh Bapat
On Fri, Jul 6, 2018 at 6:31 PM, Ashutosh Bapat wrote: > > I will continue reviewing the patches. > Here are some more review comments - * sort ordering for each merge key. The mergejoinable operator is an - * equality operator in the opfamily, and the two inputs are guaranteed to be + * sort or

Re: EXPLAIN of Parallel Append

2018-07-09 Thread Jesper Pedersen
Hi Amit, On 07/07/2018 01:08 AM, Amit Kapila wrote: On Wed, Mar 14, 2018 at 8:58 PM, Jesper Pedersen Parallel Append's ntuples is 1, but given nloops is 3 you end up with the slightly confusing "(actual ... *rows=0* loops=3)". The number of rows displayed is total_rows / loops due to which y

Re: Simplify final sync in pg_rewind's target folder and add --no-sync

2018-07-09 Thread Heikki Linnakangas
On 25/03/18 15:26, Michael Paquier wrote: Hi all, While looking at pg_rewind code, I have been surprised to find that the final fsync done on the target's data folder is done using initdb -S via a system() call. This is in my opinion overcomplicated because we have a dedicated API in fe_utils a

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-07-09 Thread Heikki Linnakangas
On 03/04/18 19:20, Andres Freund wrote: On 2018-04-03 09:56:24 -0400, Tom Lane wrote: Heikki Linnakangas writes: But let's go back to why we're considering this. The idea was to optimize this block: ... One trick that we could do is to replace that with a 128-bit atomic compare-and-swap instru

LLVM jit and matview

2018-07-09 Thread Dmitry Dolgov
Hi, I've found out an interesting problem that you can reproduce by running installcheck against a database with enabled llvm jit (with and without the patch I've sent in [1]): # postgresql.conf jit = on jit_above_cost = 0 jit_optimize_above_cost = 0 jit_inline_above_cost = 0 # matview.sql ... =

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-07-09 Thread Fujii Masao
On Sun, Jul 8, 2018 at 11:48 AM, Haribabu Kommi wrote: > > On Fri, Jul 6, 2018 at 3:22 AM Fujii Masao wrote: >> >> On Wed, Jul 4, 2018 at 7:12 PM, Haribabu Kommi >> wrote: >> > >> > Update patch attached. >> >> + if (userid != 0 && dbid != 0 && queryid != 0) >> >> UINT64CONST() should be used fo

Re: Postgres 11 release notes

2018-07-09 Thread Bruce Momjian
On Sun, Jul 8, 2018 at 10:28:15PM -0700, Andres Freund wrote: > On 2018-07-09 14:18:14 +0900, Tatsuro Yamada wrote: > > Hi Bruce, > > > > > I expect a torrent of feedback.;-) > > > > Could you add this fix to the release note because this change affects > > an extension developer using the hook

Re: Postgres 11 release notes

2018-07-09 Thread David Fetter
On Mon, Jul 09, 2018 at 10:36:30AM -0400, Bruce Momjian wrote: > On Sun, Jul 8, 2018 at 10:28:15PM -0700, Andres Freund wrote: > > On 2018-07-09 14:18:14 +0900, Tatsuro Yamada wrote: > > > Hi Bruce, > > > > > > > I expect a torrent of feedback.;-) > > > > > > Could you add this fix to the releas

Re: [GSoC] working status

2018-07-09 Thread Charles Cui
yes, my CI test version is 9.4. will make it work on 10 by following your advices. Thanks. On Mon, Jul 9, 2018, 5:22 AM Aleksander Alekseeev wrote: > Hello Charles, > > > > ``` > > > pg_thrift.c:1313:26: error: too few arguments to function > > > ‘array_create_iterator’ ArrayIterator iter = > >

Re: add default parallel query to v10 release notes? (Re: [PERFORM] performance drop after upgrade (9.6 > 10))

2018-07-09 Thread Bruce Momjian
On Fri, Jun 22, 2018 at 02:53:36PM +0530, Amit Kapila wrote: > On Wed, Jun 20, 2018 at 8:43 PM, Bruce Momjian wrote: > > On Thu, May 24, 2018 at 08:00:25PM -0500, Justin Pryzby wrote: > > > > So I did some research on this, particularly to find out how it was > > missed in the PG 10 release notes.

Re: cannot restore schema with is not distinct from on hstore since PG 9.6.8

2018-07-09 Thread Tom Lane
Marc Cousin writes: > This is a really simple test case, I think it's an unintended > consequence of CVE-2018-1058: > demo=# create extension hstore; > CREATE EXTENSION > demo=# create table test (a hstore); > CREATE TABLE > demo=# create index idx_test_not_distinct on test(a) where a is not > di

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-07-09 Thread Simon Riggs
On 9 July 2018 at 14:49, Heikki Linnakangas wrote: > On 03/04/18 19:20, Andres Freund wrote: >> >> On 2018-04-03 09:56:24 -0400, Tom Lane wrote: >>> >>> Heikki Linnakangas writes: But let's go back to why we're considering this. The idea was to optimize this block: ... On

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-07-09 Thread Heikki Linnakangas
On 09/07/18 18:57, Simon Riggs wrote: On 9 July 2018 at 14:49, Heikki Linnakangas wrote: I'll mark this as "returned with feedback" in the commitfest. The way forward is to test if we can get the same performance benefit from switching to CMPXCHG16B, and keep the WAL format unchanged. If not, t

Re: Locking B-tree leafs immediately in exclusive mode

2018-07-09 Thread Alexander Korotkov
Hi! On Mon, Jul 9, 2018 at 6:19 AM Imai, Yoshikazu wrote: > Hi, I'm reviewing this. Great. Thank you for giving attention to this patch. > Firstly, I did performance tests on 72-cores machines(AWS c5.18xlarge) same > as you did. OK. But not that c5.18xlarge is 72-VCPU machine, which AFAIK i

Re: Locking B-tree leafs immediately in exclusive mode

2018-07-09 Thread Peter Geoghegan
On Mon, Jul 9, 2018 at 9:43 AM, Alexander Korotkov wrote: > In this case it also looks like we observed 1% regression. Despite 1% > may seem to be very small, I think we should clarify whether it really > exists. I have at least two hypothesis about this. > > 1) There is no real regression, obse

Re: Locking B-tree leafs immediately in exclusive mode

2018-07-09 Thread Simon Riggs
On 9 July 2018 at 04:18, Imai, Yoshikazu wrote: >> # script_ordered.sql >> INSERT INTO ordered (value) VALUES ('abcdefghijklmnoprsqtuvwxyz'); >> >> # script_unordered.sql >> \set i random(1, 100) >> INSERT INTO unordered VALUES (:i, 'abcdefghijklmnoprsqtuvwxyz'); >> # results >> ordered, ma

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

2018-07-09 Thread Tom Lane
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 to resolve bugs, we usually like to add a regression test case that demonstrates

Re: [HACKERS] [PATCH] kNN for SP-GiST

2018-07-09 Thread Andrey Borodin
Hi! > 4 июля 2018 г., в 3:21, Nikita Glukhov написал(а): > Attached 5th version of the patches, where minor refactoring of distance > handling was done (see below). > I'm reviewing this patch. Currently I'm trying to understand sp-gist scan deeeper, but as for now have some small notices. F

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

2018-07-09 Thread Andres Freund
Hi, On 2018-07-09 05:47:56 -0500, Nico Williams wrote: > Suppose I have my own patches, not yet contributed to PG, and that I'm > using them in production. Can I use my patched version of PG with your > functionality? Yes. Given the proposal was to license the potentially encumbered code under

Re: WAL prefetch

2018-07-09 Thread Andres Freund
Hi, On 2018-07-09 11:59:06 +0200, Tomas Vondra wrote: > > * During the design phase, I looked into using bgworkers but given the > > number of > >in-flight pread(2) calls required to fully utilize the IO subsystem, I > > opted > >for something threaded (I was also confined to using Solar

Re: Proposed fix for Bug #15259 (invalid empty array returned by intarray "&" operator)

2018-07-09 Thread Tom Lane
Alexey Kryuchkov writes: > The attached patch fixes Bug #15259 [1] in the intarray module, making the > '&' array intersection operator return proper zero-dimensional empty arrays > instead of one-dimensional, zero-length "empty" arrays. LGTM, pushed. Thanks for the report and patch!

Re: [HACKERS] PoC: full merge join on comparison clause

2018-07-09 Thread Alexander Kuzmenkov
On 07/09/2018 04:12 PM, Ashutosh Bapat wrote: On Fri, Jul 6, 2018 at 6:31 PM, Ashutosh Bapat wrote: I will continue reviewing the patches. Here are some more review comments Ashutosh, Many thanks for the review, I'm glad that we are continuing with this patch. I'm working on your comment

Re: Non-reserved replication slots and slot advancing

2018-07-09 Thread Andres Freund
On 2018-07-09 15:48:33 +0900, Michael Paquier wrote: > On Mon, Jul 09, 2018 at 03:13:04PM +0900, Kyotaro HORIGUCHI wrote: > > Looking the attached patch, I noticed that both "WAL" and "wal" > > are used in similar ERROR messages. Grepping the source tree > > showed me that it is always in upper cas

Re: Non-reserved replication slots and slot advancing

2018-07-09 Thread Alvaro Herrera
On 2018-Jul-09, Andres Freund wrote: > On 2018-07-09 15:48:33 +0900, Michael Paquier wrote: > > + if (XLogRecPtrIsInvalid(MyReplicationSlot->data.restart_lsn)) > > + { > > + ReplicationSlotRelease(); > > + ereport(ERROR, > > + (errcode(ERRCODE_FEA

Re: no partition pruning when partitioning using array type

2018-07-09 Thread Alvaro Herrera
On 2018-Jul-09, Amit Langote wrote: > On 2018/07/07 9:19, Alvaro Herrera wrote: > > On 2018-May-08, Amit Langote wrote: > > > >> I would like to revisit this as a bug fix for get_partition_operator() to > >> be applied to both PG 10 and HEAD. In the former case, it fixes the bug > >> that constr

Re: [PATCH] Improve geometric types

2018-07-09 Thread Tomas Vondra
On 06/05/2018 06:32 PM, Emre Hasegeli wrote: >> Those underscore-prefixed names are defined in Microsoft's >> [3][4]. So now I'm wondering if win32_port.h needs to >> #include if (_MSC_VER < 1800). > > I don't have the C experience to decide the correct way. There are > currently many .c fil

Re: [HACKERS] plpgsql - additional extra checks

2018-07-09 Thread Tomas Vondra
On 07/03/2018 03:45 PM, Tomas Vondra wrote: > On 03/20/2018 01:35 PM, Tomas Vondra wrote: >> >> >> On 03/20/2018 05:36 AM, Pavel Stehule wrote: >>> >>> >>> 2018-03-19 21:47 GMT+01:00 Tomas Vondra >> >: >>> >>> Hi, >>> >>> I'm looking at the updated pat

Re: [HACKERS] plpgsql - additional extra checks

2018-07-09 Thread Alvaro Herrera
> + ereport(errlevel, > (errcode(ERRCODE_TOO_MANY_ROWS), >errmsg("query returned more > than one row"), > - errdetail ? > errdetai

Re: [HACKERS] plpgsql - additional extra checks

2018-07-09 Thread Andres Freund
On 2018-07-09 15:44:36 -0400, Alvaro Herrera wrote: > > + ereport(errlevel, > > (errcode(ERRCODE_TOO_MANY_ROWS), > > errmsg("query returned more > > than one row"), > > -

Re: Generating partitioning tuple conversion maps faster

2018-07-09 Thread David Rowley
On 9 July 2018 at 23:28, Alexander Kuzmenkov wrote: > On 07/09/2018 10:13 AM, David Rowley wrote: >> I've attached v5. > > v5 looks good to me, I've changed the status to ready. Many thanks for reviewing this. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Developmen

Re: [HACKERS] plpgsql - additional extra checks

2018-07-09 Thread Alvaro Herrera
On 2018-Jul-09, Andres Freund wrote: > On 2018-07-09 15:44:36 -0400, Alvaro Herrera wrote: > > > + ereport(errlevel, > > > (errcode(ERRCODE_TOO_MANY_ROWS), > > >errmsg("query returned more

Re: Un peu décu : Re: Performance regression with PostgreSQL 11 and partitioning

2018-07-09 Thread David Rowley
On 10 July 2018 at 00:47, Christophe Courtois wrote: > J'ai eu peur, 7d872c91a3f9d49b56117557cdbb0c3d4c620687 n'est pas en bêta > 2 mais bien dans REL_11_STABLE. > > J'ai relancé mes scripts avec 1 partitions vides, un peu à l'arrache > et sans rigueur : la dernière version incluant ce patch e

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

2018-07-09 Thread Markus Wanner
David, On 07/09/2018 02:52 PM, David Fetter wrote: > Unfortunately, this does not mean anything until courts have upheld > it. Were Red Hat to be taken over by people who didn't see things > this way, it is a long way from clear that such a statement would be > upheld in every court, which is wha

Re: pgsql: Fix crash when ALTER TABLE recreates indexes on partitions

2018-07-09 Thread Andres Freund
On 2018-07-04 20:33:05 -0700, Andres Freund wrote: > On 2018-07-04 13:15:19 -0400, Alvaro Herrera wrote: > > On 2018-Jun-30, Tom Lane wrote: > > > > > Alvaro Herrera writes: > > > > Fix crash when ALTER TABLE recreates indexes on partitions > > > > > > So ... buildfarm member skink has been repo

Re: no partition pruning when partitioning using array type

2018-07-09 Thread Tom Lane
Alvaro Herrera writes: > The same occurs in 11 and master. I think this is because the > polymorphic type is resolved for the function ahead of time (at > table creation time); partexprs shows > ({FUNCEXPR :funcid 35757 :funcresulttype 23 :funcretset false :funcvariadic > false :funcformat 0 :

Re: peripatus build failures....

2018-07-09 Thread Tom Lane
I wrote: > I'd been hesitant to back-patch dddfc4cb2 back in April; but now that > it's survived some beta testing, I think that doing so seems like the > most appropriate way to fix this. Done. Hopefully I didn't break anything; a lot of this code has mutated to some extent since 9.3. But I exp

Re: peripatus build failures....

2018-07-09 Thread Larry Rosenman
On Mon, Jul 09, 2018 at 05:25:50PM -0400, Tom Lane wrote: > I wrote: > > I'd been hesitant to back-patch dddfc4cb2 back in April; but now that > > it's survived some beta testing, I think that doing so seems like the > > most appropriate way to fix this. > > Done. Hopefully I didn't break anythin

Re: WAL prefetch

2018-07-09 Thread Konstantin Knizhnik
On 08.07.2018 00:47, Tomas Vondra wrote: Hi, I've done a bit of testing on the current patch, mostly to see how much the prefetching can help (if at all). While the patch is still in early WIP stages (at least that's my assessment, YMMV), the improvement are already quite significant. I've a

Re: [PATCH] Improve geometric types

2018-07-09 Thread Thomas Munro
On Tue, Jul 10, 2018 at 7:21 AM, Tomas Vondra wrote: > On 06/05/2018 06:32 PM, Emre Hasegeli wrote: >>> Those underscore-prefixed names are defined in Microsoft's >>> [3][4]. So now I'm wondering if win32_port.h needs to >>> #include if (_MSC_VER < 1800). >> >> I don't have the C experience to d

Re: no partition pruning when partitioning using array type

2018-07-09 Thread Alvaro Herrera
Another thing I realized when testing this is that partitioning over a domain doesn't work very nicely (tested in 10 and master): create domain overint as int; create table pt (a overint) partition by range (a); create table pt1 partition of pt for values from (0) to (100); results in: ERROR: s

Re: no partition pruning when partitioning using array type

2018-07-09 Thread Tom Lane
Alvaro Herrera writes: > Tracing it down, turns out that transformPartitionBoundValue gets from > coerce_to_target_type a CoerceToDomain node. It then tries to apply > expression_planner() to simplify the expression, but that one doesn't > want anything to do with a domain coercion (for apparentl

Re: WAL prefetch

2018-07-09 Thread Konstantin Knizhnik
On 09.07.2018 21:28, Andres Freund wrote: Hi, On 2018-07-09 11:59:06 +0200, Tomas Vondra wrote: * During the design phase, I looked into using bgworkers but given the number of in-flight pread(2) calls required to fully utilize the IO subsystem, I opted for something threaded (I was

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

2018-07-09 Thread Tom Lane
Masahiko Sawada writes: > I got an assertion failure when I use GROUPS mode and specifies offset > without ORDER BY clause. The reproduction steps and the backtrace I > got are following. > =# create table test as select 1 as c; > =# select sum(c) over (partition by c groups between 1 preceding a

Re: Locking B-tree leafs immediately in exclusive mode

2018-07-09 Thread Alexander Korotkov
On Mon, Jul 9, 2018 at 8:18 PM Peter Geoghegan wrote: > On Mon, Jul 9, 2018 at 9:43 AM, Alexander Korotkov > wrote: > > In this case it also looks like we observed 1% regression. Despite 1% > > may seem to be very small, I think we should clarify whether it really > > exists. I have at least tw

Re: Locking B-tree leafs immediately in exclusive mode

2018-07-09 Thread Peter Geoghegan
On Mon, Jul 9, 2018 at 3:23 PM, Alexander Korotkov wrote: > I'm sorry, but I didn't understand this guess. I agree that moving > right within _bt_findinsertloc() might be worse than moving right > within _bt_moveright(). But why should it happen more often, if both > with and without patch that

Re: [HACKERS] Clock with Adaptive Replacement

2018-07-09 Thread Peter Geoghegan
On Tue, May 1, 2018 at 11:58 AM, Robert Haas wrote: >> All of that having been said, maybe we have an independent low-level >> problem: we increase usage_count when we pin a buffer, even if we last >> pinned the buffer 5ms ago. IIRC a change to this went in when ARC went >> in (and came out with A

Re: [HACKERS] Possibly too stringent Assert() in b-tree code

2018-07-09 Thread Tom Lane
Kyotaro HORIGUCHI writes: > At Mon, 26 Sep 2016 09:12:04 +0530, Amit Kapila > wrote in >>> It seems to me that we do take actions for conflict resolution during >>> the page deletion (that looks to be covered by XLOG_HEAP2_CLEANUP_INFO >>> which we emit in vacuum), but not sure if that is suffi

Re: Usage of epoch in txid_current

2018-07-09 Thread Thomas Munro
On Fri, Dec 8, 2017 at 3:36 PM, Amit Kapila wrote: > On Wed, Dec 6, 2017 at 11:26 PM, Andres Freund wrote: >>> Either way, it is not clear to me how we will keep it >>> updated after recovery. Right now, the mechanism is quite simple, at >>> the beginning of a recovery we take the value of nextX

small development tip: Consider using the gold linker

2018-07-09 Thread Andres Freund
Hi, FWIW, I've lately noticed that I spend a fair time waiting for the linker during edit-compile-test cycles. Due to an independent issue I just used the gold linker, and the speedup is quite noticable. Just relinking the backend, without rebuilding anything else, goes from 0m3.975s to 0m1.585s

Re: Usage of epoch in txid_current

2018-07-09 Thread Andres Freund
On 2018-07-10 11:35:59 +1200, Thomas Munro wrote: > I played around with this idea yesterday. Experiment-grade patch > attached. Cool! > I think it's probably a good idea to make it very explicit when moving > between big and small transaction IDs, hence the including of the word > 'big' in var

Re: Usage of epoch in txid_current

2018-07-09 Thread Tom Lane
Andres Freund writes: > On 2018-07-10 11:35:59 +1200, Thomas Munro wrote: >> I think it's probably a good idea to make it very explicit when moving >> between big and small transaction IDs, hence the including of the word >> 'big' in variable and function names and the use of a function-like >> ma

Re: Simplify final sync in pg_rewind's target folder and add --no-sync

2018-07-09 Thread Michael Paquier
On Mon, Jul 09, 2018 at 04:38:11PM +0300, Heikki Linnakangas wrote: > Looks good to me. I'll mark this as "ready for committer". Thanks Heikki for the review, I have committed both things after splitting it into two commits for clarity, and fixing a comment as fsync_pgdata also initiates a write-b

Re: cannot restore schema with is not distinct from on hstore since PG 9.6.8

2018-07-09 Thread Andrew Dunstan
On 07/09/2018 11:34 AM, Tom Lane wrote: Marc Cousin writes: This is a really simple test case, I think it's an unintended consequence of CVE-2018-1058: demo=# create extension hstore; CREATE EXTENSION demo=# create table test (a hstore); CREATE TABLE demo=# create index idx_test_not_distinct

Re: Usage of epoch in txid_current

2018-07-09 Thread Andres Freund
Hi, On 2018-07-09 19:56:25 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2018-07-10 11:35:59 +1200, Thomas Munro wrote: > >> I think it's probably a good idea to make it very explicit when moving > >> between big and small transaction IDs, hence the including of the word > >> 'big' in var

Re: LLVM jit and matview

2018-07-09 Thread Michael Paquier
On Mon, Jul 09, 2018 at 04:04:11PM +0200, Dmitry Dolgov wrote: > # matview.sql > ... > =# REFRESH MATERIALIZED VIEW CONCURRENTLY mvtest_tm; > server closed the connection unexpectedly > This probably means the server terminated abnormally > before or while processing the request. > The connection t

Re: Usage of epoch in txid_current

2018-07-09 Thread Andres Freund
On 2018-07-09 17:08:34 -0700, Andres Freund wrote: > Hi, > > On 2018-07-09 19:56:25 -0400, Tom Lane wrote: > > Andres Freund writes: > > > On 2018-07-10 11:35:59 +1200, Thomas Munro wrote: > > >> I think it's probably a good idea to make it very explicit when moving > > >> between big and small t

Re: Non-reserved replication slots and slot advancing

2018-07-09 Thread Michael Paquier
On Mon, Jul 09, 2018 at 02:48:28PM -0400, Alvaro Herrera wrote: > On 2018-Jul-09, Andres Freund wrote: > > On 2018-07-09 15:48:33 +0900, Michael Paquier wrote: > > > + if (XLogRecPtrIsInvalid(MyReplicationSlot->data.restart_lsn)) > > > + { > > > + ReplicationSlotRelease(); > > > + e

Re: Postgres 11 release notes

2018-07-09 Thread Tatsuro Yamada
On 2018/07/09 23:52, David Fetter wrote: On Mon, Jul 09, 2018 at 10:36:30AM -0400, Bruce Momjian wrote: On Sun, Jul 8, 2018 at 10:28:15PM -0700, Andres Freund wrote: On 2018-07-09 14:18:14 +0900, Tatsuro Yamada wrote: Hi Bruce, I expect a torrent of feedback.;-) Could you add this fix to

Re: [HACKERS] Replication status in logical replication

2018-07-09 Thread Michael Paquier
On Mon, Jul 09, 2018 at 05:25:55PM +0900, Masahiko Sawada wrote: > Thank you for updating the patch. The patch looks fine to me, and I > agree with all changes you made. Thanks. If there are no objections, then I will try to wrap this stuff on Thursday my time. -- Michael signature.asc Descript

Re: missing toast table for pg_policy

2018-07-09 Thread Michael Paquier
On Mon, Jul 09, 2018 at 02:45:26PM +0200, Peter Eisentraut wrote: > On 15.06.18 21:15, Joe Conway wrote: >> Not surprising -- thanks for the update. >> >>> It occurred to be that we could go further and create most toast >>> tables automatically by taking advantage of the fact that the toast >>> c

Re: Postgres 11 release notes

2018-07-09 Thread Andres Freund
On 2018-07-09 16:52:11 +0200, David Fetter wrote: > On Mon, Jul 09, 2018 at 10:36:30AM -0400, Bruce Momjian wrote: > > On Sun, Jul 8, 2018 at 10:28:15PM -0700, Andres Freund wrote: > > > On 2018-07-09 14:18:14 +0900, Tatsuro Yamada wrote: > > > > Hi Bruce, > > > > > > > > > I expect a torrent of

Re: missing toast table for pg_policy

2018-07-09 Thread Joe Conway
On 07/09/2018 09:16 PM, Michael Paquier wrote: > On Mon, Jul 09, 2018 at 02:45:26PM +0200, Peter Eisentraut wrote: >> On 15.06.18 21:15, Joe Conway wrote: >>> Not surprising -- thanks for the update. >>> It occurred to be that we could go further and create most toast tables automatically

Re: Usage of epoch in txid_current

2018-07-09 Thread Thomas Munro
On Tue, Jul 10, 2018 at 12:08 PM, Andres Freund wrote: > On 2018-07-09 19:56:25 -0400, Tom Lane wrote: >> Andres Freund writes: >> > On 2018-07-10 11:35:59 +1200, Thomas Munro wrote: >> >> I think it's probably a good idea to make it very explicit when moving >> >> between big and small transacti

  1   2   >