Re: [HACKERS] Setting pd_lower in GIN metapage

2017-06-22 Thread Masahiko Sawada
On Fri, Jun 23, 2017 at 11:17 AM, Amit Langote wrote: > On 2017/06/23 10:22, Masahiko Sawada wrote: >> On Thu, Jun 22, 2017 at 6:55 PM, Amit Langote >> wrote: >>> On 2017/06/22 16:56, Michael Paquier wrote: Did you check this

Re: [HACKERS] [POC] hash partitioning

2017-06-22 Thread Yugo Nagata
On Fri, 23 Jun 2017 13:41:15 +0900 Yugo Nagata wrote: > On Tue, 6 Jun 2017 13:03:58 +0530 > amul sul wrote: > > > > Updated patch attached. > > I looked into the latest patch (v13) and have some comments > althogh they might be trivial. One more

[HACKERS] Small bug in replication lag tracking

2017-06-22 Thread Thomas Munro
Hi, I discovered a thinko in the new replication lag interpolation code that can cause a strange number to be reported occasionally. The interpolation code is designed to report increasing lag when replay gets stuck somewhere between two LSNs for which we have timestamp samples. The bug is that

Re: [HACKERS] Fix a typo in partition.c

2017-06-22 Thread Masahiko Sawada
On Thu, Jun 22, 2017 at 10:38 PM, Magnus Hagander wrote: > > > On Thu, Jun 22, 2017 at 4:16 AM, Masahiko Sawada > wrote: >> >> On Wed, Jun 21, 2017 at 3:32 AM, Peter Eisentraut >> wrote: >> > On 6/19/17 23:02,

Re: [HACKERS] Autovacuum launcher occurs error when cancelled by SIGINT

2017-06-22 Thread Yugo Nagata
On Thu, 22 Jun 2017 13:55:26 -0400 Alvaro Herrera wrote: > Yugo Nagata wrote: > > Hi, > > > > As I report in another thread[1], I found the autovacuum launcher occurs > > the following error in PG 10 when this received SIGINT. I can repuroduce > > this by

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-22 Thread Ashutosh Sharma
Hi, On Wed, Jun 21, 2017 at 9:50 AM, Amit Kapila wrote: > On Wed, Jun 21, 2017 at 12:15 AM, Peter Eisentraut > wrote: >> On 6/20/17 09:23, Amit Kapila wrote: >>> To avoid that why can't we use the same icu path for executing uconv >>>

Re: [HACKERS] Multi column range partition table

2017-06-22 Thread amul sul
On Fri, Jun 23, 2017 at 6:58 AM, Amit Langote wrote: > On 2017/06/22 20:48, amul sul wrote: >> Hi, >> >> While working on the another patch, I came across the case where >> I need an auto generated partition for a mutil-column range partitioned >> table having

Re: [HACKERS] [POC] hash partitioning

2017-06-22 Thread Yugo Nagata
On Tue, 6 Jun 2017 13:03:58 +0530 amul sul wrote: > Updated patch attached. I looked into the latest patch (v13) and have some comments althogh they might be trivial. First, I couldn't apply this patch to the latest HEAD due to a documentation fix and pgintend updates. It

Re: [HACKERS] Regarding Postgres Dynamic Shared Memory (DSA)

2017-06-22 Thread Mahendranath Gurram
Hi Thomas, When you create or attach to a DSA area, a detach callback is automatically registered on the control segment (or containing segment, for an in-place DSA area). See the code like this in dsa.c: /* Clean up when the control segment detaches. */ on_dsm_detach(segment,

Re: [HACKERS] Guarding against bugs-of-omission in initdb's setup_depend

2017-06-22 Thread Tom Lane
Robert Haas writes: > On Thu, Jun 22, 2017 at 2:11 PM, Tom Lane wrote: >> So I'm thinking about adding a regression test case, say in dependency.sql, >> that looks for unpinned objects with OIDs in the hand-assigned range, >> along the lines of this

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

2017-06-22 Thread Tom Lane
Andrew Dunstan writes: > On 06/22/2017 10:24 AM, Tom Lane wrote: >> That earlier request is still valid. Also, if you can reproduce the >> symptom that lorikeet just showed and get a stack trace from the >> (hypothetical) postmaster core dump, that would be hugely

Re: [HACKERS] AdvanceXLInsertBuffer vs. WAL segment compressibility

2017-06-22 Thread Chapman Flack
On 06/21/17 04:51, Heikki Linnakangas wrote: > (I'm cleaning up my inbox, hence the delayed reply) I had almost completely forgotten ever bringing it up. :) > When I wrote that code, I don't remember if I realized that we're > initializing the page headers, or if I thought that it's good enough

Re: [HACKERS] Missing comment for create_modifytable_path

2017-06-22 Thread Etsuro Fujita
On 2017/06/23 2:53, Robert Haas wrote: On Thu, Jun 15, 2017 at 4:40 AM, Etsuro Fujita wrote: While working on adding support for tuple routing for foreign partitions, I noticed that in create_modifytable_path, we forgot to add a comment on its new argument

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

2017-06-22 Thread Andrew Dunstan
On 06/22/2017 10:24 AM, Tom Lane wrote: > Andrew Dunstan writes: >> Please let me know if there are tests I can run. I missed your earlier >> request in this thread, sorry about that. > That earlier request is still valid. Also, if you can reproduce the >

Re: [HACKERS] Can ICU be used for a database's default sort order?

2017-06-22 Thread Peter Geoghegan
On Thu, Jun 22, 2017 at 7:10 PM, Tom Lane wrote: > Is there some way I'm missing, or is this just a not-done-yet feature? It's a not-done-yet feature. -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] shift_sjis_2004 related autority files are remaining

2017-06-22 Thread Kyotaro HORIGUCHI
At Fri, 23 Jun 2017 10:04:26 +0900 (JST), Tatsuo Ishii wrote in <20170623.100426.157023025943107410.t-is...@sraoss.co.jp> > > Hm. I am wondering about licensing issues here to keep those files in > > the tree. I am no lawyer. > > Of course. Regarding euc-jis-2004-std.txt and

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

2017-06-22 Thread Amit Kapila
On Thu, Jun 22, 2017 at 7:54 PM, Tom Lane wrote: > Andrew Dunstan writes: >> Please let me know if there are tests I can run. I missed your earlier >> request in this thread, sorry about that. > > That earlier request is still valid. > Yeah,

Re: [HACKERS] psql: Activate pager only for height, not width

2017-06-22 Thread Brendan Jurd
On Tue, 30 May 2017 at 05:30 Christoph Berg wrote: > Oh interesting, I didn't know about pager_min_lines. That sounds > useful as well. +1 on the analogous pager_min_cols option. > On closer inspection, I note that psql already has a 'columns' \pset option, which does control

Re: [HACKERS] Broken hint bits (freeze)

2017-06-22 Thread Amit Kapila
On Wed, Jun 21, 2017 at 10:03 PM, Bruce Momjian wrote: > On Wed, Jun 21, 2017 at 07:49:21PM +0530, Amit Kapila wrote: >> On Tue, Jun 20, 2017 at 7:24 PM, Amit Kapila wrote: >> > Hmm. I think we need something that works with lesser effort because >> >

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-06-22 Thread Amit Langote
On 2017/06/23 10:22, Masahiko Sawada wrote: > On Thu, Jun 22, 2017 at 6:55 PM, Amit Langote > wrote: >> On 2017/06/22 16:56, Michael Paquier wrote: >>> Did you check this patch with wal_consistency_checking? I am getting >>> failures so your patch does not have the

[HACKERS] Can ICU be used for a database's default sort order?

2017-06-22 Thread Tom Lane
I tried to arrange $subject via create database icu encoding 'utf8' lc_ctype "en-US-x-icu" lc_collate "en-US-x-icu" template template0; and got only ERROR: invalid locale name: "en-US-x-icu" which is unsurprising after looking into the code, because createdb() checks those parameters with

Re: [HACKERS] TRUE and true

2017-06-22 Thread Kyotaro HORIGUCHI
At Thu, 22 Jun 2017 09:13:56 -0400, Peter Eisentraut wrote in <08678a07-3967-8567-59e5-b9bcced7f...@2ndquadrant.com> > On 6/22/17 07:09, Kyotaro HORIGUCHI wrote: > > What makes us have both TRUE/true or FALSE/false as constants of > > bool? > > Historical

Re: [HACKERS] TRUE and true

2017-06-22 Thread Kyotaro HORIGUCHI
At Thu, 22 Jun 2017 15:35:13 +0300, Alexander Korotkov wrote in

Re: [HACKERS] Fast promotion not used when doing a recovery_target PITR restore?

2017-06-22 Thread Michael Paquier
On Fri, Jun 23, 2017 at 2:34 AM, Andres Freund wrote: > I don't think it's really a bug - just a missed optimization. I'd > personally not be in favor of backpatching this - it'll have some chance > of screwing things up, even if I hope that chance is fairly small. It would

Re: [HACKERS] transition table behavior with inheritance appears broken

2017-06-22 Thread Noah Misch
On Sun, Jun 18, 2017 at 11:59:43PM +0100, Andrew Gierth wrote: > > "Andrew" == Andrew Gierth writes: > > Andrew> Unfortunately I've been delayed over the past couple of days, > Andrew> but I have Thomas' latest patchset in hand and will be working > Andrew> on

[HACKERS] ICU non-utf8 code path leaks memory like there's no tomorrow

2017-06-22 Thread Tom Lane
In a database with utf8 encoding, this behaves reasonably: select count(*) from (select * from generate_series(1,1000) x order by x::text collate "en-x-icu") ss; It eats circa 25MB, not a lot worse than the libc-collation equivalent. But try it in say LATIN1, and it eats multiple gigabytes.

Re: [HACKERS] Multi column range partition table

2017-06-22 Thread Amit Langote
On 2017/06/22 20:48, amul sul wrote: > Hi, > > While working on the another patch, I came across the case where > I need an auto generated partition for a mutil-column range partitioned > table having following range bound: > > PARTITION p1 FROM (UNBOUNDED, UNBOUNDED) TO (10, 10) > PARTITION p2

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-06-22 Thread Masahiko Sawada
On Thu, Jun 22, 2017 at 6:55 PM, Amit Langote wrote: > On 2017/06/22 16:56, Michael Paquier wrote: >> On Wed, Jun 21, 2017 at 9:42 AM, Amit Langote >> wrote: >>> On 2017/06/20 20:37, Amit Kapila wrote: On Tue, Jun 20, 2017 at

Re: [HACKERS] shift_sjis_2004 related autority files are remaining

2017-06-22 Thread Tatsuo Ishii
> Hm. I am wondering about licensing issues here to keep those files in > the tree. I am no lawyer. Of course. Regarding euc-jis-2004-std.txt and sjis-0213-2004-std.txt, it seems safe to keep them. > ## Date: 13 May 2006 > ## License: > ##Copyright (C) 2001 earth...@tama.or.jp, All Rights

Re: [HACKERS] shift_sjis_2004 related autority files are remaining

2017-06-22 Thread Michael Paquier
On Fri, Jun 23, 2017 at 9:39 AM, Tatsuo Ishii wrote: > I think we should keep the original .txt files because: Hm. I am wondering about licensing issues here to keep those files in the tree. I am no lawyer. > - It allows to track the changes in the original file if we decide

Re: [HACKERS] shift_sjis_2004 related autority files are remaining

2017-06-22 Thread Tatsuo Ishii
>> Why do you believe so? > > Unicode/Makefile includes that: > euc-jis-2004-std.txt sjis-0213-2004-std.txt: > $(DOWNLOAD) http://x0213.org/codetable/$(@F) > > So those files ought to be downloaded when rebuilding the maps, and > they should not be in the tree. In short, I think that

Re: [HACKERS] Fix comment in xlog.c

2017-06-22 Thread Amit Langote
On 2017/06/23 5:44, Alvaro Herrera wrote: > Amit Langote wrote: >> Attached a patch for $SUBJECT. >> >> - * If RecPtr is not NULL, try to read a record at that position. Otherwise >> + * If RecPtr is valid, try to read a record at that position. Otherwise >> >> Commit 4d6d425ab8d addressed the

Re: [HACKERS] Redundant check of em_is_child

2017-06-22 Thread Amit Langote
On 2017/06/23 0:00, Robert Haas wrote: > On Fri, May 19, 2017 at 3:46 AM, Amit Langote > wrote: >> In match_eclasses_to_foreign_key_col(), there is this: >> >> if (em->em_is_child) >> continue; /* ignore children here */ >> >> ISTM,

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

2017-06-22 Thread Thom Brown
On 22 June 2017 at 22:52, Robert Haas wrote: > On Thu, Jun 15, 2017 at 12:35 AM, Mithun Cy > wrote: >> [ new patch ] > > I think this is looking better. I have some suggestions: > > * I suggest renaming launch_autoprewarm_dump() to >

Re: [HACKERS] shift_sjis_2004 related autority files are remaining

2017-06-22 Thread Michael Paquier
On Fri, Jun 23, 2017 at 8:12 AM, Tatsuo Ishii wrote: >> Hi, I happned to notice that backend/utils/mb/Unicode directory >> contains two encoding authority files, which I believe are not to >> be there. (Worked on that with Horiguchi-san a couple of weeks back.) >>

Re: [HACKERS] Pluggable storage

2017-06-22 Thread Michael Paquier
On Thu, Jun 22, 2017 at 11:27 PM, Robert Haas wrote: > On Thu, Jun 22, 2017 at 8:32 AM, Alexander Korotkov > wrote: >> On Thu, Jun 22, 2017 at 4:01 AM, Michael Paquier >> wrote: >>> Putting that in a couple of words.

Re: [HACKERS] Autovacuum launcher occurs error when cancelled by SIGINT

2017-06-22 Thread Michael Paquier
On Fri, Jun 23, 2017 at 7:02 AM, Alvaro Herrera wrote: > Thomas Munro wrote: >> I thought about this when designing the DSA API. I couldn't think of >> any good reason to provide an 'am-I-already-attached?' function >> equivalent to dsm_find_mapping. It seemed to me

Re: [HACKERS] shift_sjis_2004 related autority files are remaining

2017-06-22 Thread Tatsuo Ishii
> Hi, I happned to notice that backend/utils/mb/Unicode directory > contains two encoding authority files, which I believe are not to > be there. > > euc-jis-2004-std.txt > sjis-0213-2004-std.txt Why do you believe so? -- Tatsuo Ishii SRA OSS, Inc. Japan English:

Re: [HACKERS] initdb initalization failure for collation "ja_JP"

2017-06-22 Thread Tom Lane
I wrote: > Now the hard part of that is that because pg_import_system_collations > isn't using a temporary staging table, but is just inserting directly > into pg_collation, there isn't any way for it to eliminate duplicates > unless it uses if_not_exists behavior all the time. So there seem to >

Re: [HACKERS] Autovacuum launcher occurs error when cancelled by SIGINT

2017-06-22 Thread Alvaro Herrera
Thomas Munro wrote: > I thought about this when designing the DSA API. I couldn't think of > any good reason to provide an 'am-I-already-attached?' function > equivalent to dsm_find_mapping. It seemed to me that the client code > shouldn't ever be in any doubt about whether it's attached, and

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

2017-06-22 Thread Robert Haas
On Thu, Jun 15, 2017 at 12:35 AM, Mithun Cy wrote: > [ new patch ] I think this is looking better. I have some suggestions: * I suggest renaming launch_autoprewarm_dump() to autoprewarm_start_worker(). I think that will be clearer. Remember that user-visible

Re: [HACKERS] Pluggable storage

2017-06-22 Thread Tomas Vondra
Hi, On 6/22/17 4:36 PM, Alexander Korotkov wrote: On Thu, Jun 22, 2017 at 5:27 PM, Robert Haas > wrote: On Thu, Jun 22, 2017 at 8:32 AM, Alexander Korotkov > wrote: >

Re: [HACKERS] Autovacuum launcher occurs error when cancelled by SIGINT

2017-06-22 Thread Thomas Munro
On Thu, Jun 22, 2017 at 4:29 AM, Kuntal Ghosh wrote: > On Wed, Jun 21, 2017 at 7:52 PM, Dilip Kumar wrote: >> On Wed, Jun 21, 2017 at 7:47 PM, Kuntal Ghosh >> wrote: IMHO, It's not a good idea to use DSM call to

Re: [HACKERS] Fix a typo in README.dependencies

2017-06-22 Thread Alvaro Herrera
Ashutosh Bapat wrote: > On Mon, Jun 5, 2017 at 8:22 AM, atorikoshi > wrote: > > Hi, > > > > I found below formula to compute selectivities, but > > I think the last Probability 'P(b=?)' should be 'P(c=?)'. > > > >> P(a=?,b=?,c=?) = P(a=?,b=?) * (d +

Re: [HACKERS] Pluggable storage

2017-06-22 Thread Tomas Vondra
Hi, On 6/21/17 9:47 PM, Robert Haas wrote: ... > like int8 or numeric, it won't work at all. Even for other things, it's going to cause problems because the bit patterns won't be what the code is expecting; e.g. bitmap scans care about the structure of the TID, not just how many bits it is.

[HACKERS] Dynamic instrumentation of lwlock wait times (lwlock flamegraphs)

2017-06-22 Thread Andres Freund
Hi, At pgcon some people were talking about the difficulty of instrumenting the time actually spent waiting for lwlocks and related measurements. I'd mentioned that linux these days provides infrastructure to measure such things in unmodified binaries. Attached is a prototype of a script that

Re: [HACKERS] Fix comment in xlog.c

2017-06-22 Thread Alvaro Herrera
Amit Langote wrote: > Attached a patch for $SUBJECT. > > - * If RecPtr is not NULL, try to read a record at that position. Otherwise > + * If RecPtr is valid, try to read a record at that position. Otherwise > > Commit 4d6d425ab8d addressed the comment above XLogReadRecord() in > xlogreader.c,

Re: [HACKERS] Guarding against bugs-of-omission in initdb's setup_depend

2017-06-22 Thread Robert Haas
On Thu, Jun 22, 2017 at 2:11 PM, Tom Lane wrote: > While thinking about something else, it started to bother me that > initdb's setup_depend() function knows exactly which catalogs might > contain pinnable objects. It is not very hard to imagine that somebody > might add a

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

2017-06-22 Thread Robert Haas
On Wed, Jun 21, 2017 at 8:47 PM, Amit Langote wrote: > It's the comma inside the error message that suggests to me that it's a > style that I haven't seen elsewhere in the backend code. Exactly. Avoid that. -- Robert Haas EnterpriseDB:

Re: [HACKERS] possible self-deadlock window after bad ProcessStartupPacket

2017-06-22 Thread Tom Lane
Andres Freund writes: > Or, probably more robust: Simply _exit(2) without further ado, and rely > on postmaster to output an appropriate error message. Arguably it's not > actually useful to see hundreds of "WARNING: terminating connection because of > crash of another server

[HACKERS] Guarding against bugs-of-omission in initdb's setup_depend

2017-06-22 Thread Tom Lane
While thinking about something else, it started to bother me that initdb's setup_depend() function knows exactly which catalogs might contain pinnable objects. It is not very hard to imagine that somebody might add a DATA() line to, say, pg_transform.h and expect that the represented object could

Re: [HACKERS] Autovacuum launcher occurs error when cancelled by SIGINT

2017-06-22 Thread Alvaro Herrera
Yugo Nagata wrote: > Hi, > > As I report in another thread[1], I found the autovacuum launcher occurs > the following error in PG 10 when this received SIGINT. I can repuroduce > this by pg_cancel_backend or `kill -2 `. Thanks for the report, BTW! -- Álvaro Herrera

Re: [HACKERS] Re-indent HEAD tomorrow?

2017-06-22 Thread Bruce Momjian
On Thu, Jun 22, 2017 at 10:38:41AM -0400, Robert Haas wrote: > On Wed, Jun 21, 2017 at 5:28 PM, Tom Lane wrote: > > Right now we're really just speculating about how much pain there will > > be, on either end of this. So it'd be interesting for somebody who's > > carrying

Re: [HACKERS] Missing comment for create_modifytable_path

2017-06-22 Thread Robert Haas
On Thu, Jun 15, 2017 at 4:40 AM, Etsuro Fujita wrote: > While working on adding support for tuple routing for foreign partitions, I > noticed that in create_modifytable_path, we forgot to add a comment on its > new argument 'partitioned_rels'. Attached a patch for

Re: [HACKERS] Autovacuum launcher occurs error when cancelled by SIGINT

2017-06-22 Thread Alvaro Herrera
Thomas Munro wrote: > Hmm. So the problem here is that AutoVacLauncherMain assumes that > there are only two possibilities: (1) there is no handle published in > shmem yet, so we should create a DSA area and publish the handle, and > (2) there is a handle published in shmem so we should attach

Re: [HACKERS] possible self-deadlock window after bad ProcessStartupPacket

2017-06-22 Thread Andres Freund
On 2017-06-22 10:41:41 -0700, Andres Freund wrote: > On 2017-02-02 12:18:22 -0800, Jimmy Yih wrote: > > In the above pull request, Heikki also mentions that a similar scenario can > > happen during palloc() as well... which is similar to what we saw in > > Greenplum a couple years back for a

Re: [HACKERS] shift_sjis_2004 related autority files are remaining

2017-06-22 Thread Robert Haas
On Fri, Apr 7, 2017 at 1:59 AM, Kyotaro HORIGUCHI wrote: > Hi, I happned to notice that backend/utils/mb/Unicode directory > contains two encoding authority files, which I believe are not to > be there. > > euc-jis-2004-std.txt > sjis-0213-2004-std.txt > > And

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2017-06-22 Thread Daniel Verite
Andres Freund wrote: > > One option may be to leave that decision to the user by providing a > > PQBatchAutoFlush(true|false) property, along with a PQBatchFlush() > > function. > > What'd be the difference between PQflush() and PQbatchFlush()? I guess no difference, I was just not

Re: [HACKERS] possible self-deadlock window after bad ProcessStartupPacket

2017-06-22 Thread Andres Freund
On 2017-02-02 12:18:22 -0800, Jimmy Yih wrote: > In the above pull request, Heikki also mentions that a similar scenario can > happen during palloc() as well... which is similar to what we saw in > Greenplum a couple years back for a deadlock in a malloc() call where we > responded by changing

Re: [HACKERS] Stale comments in vacuumlazy.c

2017-06-22 Thread Robert Haas
On Sun, Mar 26, 2017 at 3:22 PM, Pavan Deolasee wrote: > I happened to notice a stale comment at the very beginning of vacuumlazy.c. > ISTM we forgot to fix that when we introduced FSM. With FSM, vacuum no > longer needed to track per-page free space info. I propose

Re: [HACKERS] Fast promotion not used when doing a recovery_target PITR restore?

2017-06-22 Thread Andres Freund
On 2017-06-22 14:04:42 +0900, Michael Paquier wrote: > On Thu, Jun 22, 2017 at 3:04 AM, Andres Freund wrote: > > When doing a PITR style recovery, with recovery target set, we're > > currently not doing a fast promotion, in contrast to the handling when > > doing a pg_ctl or

Re: [HACKERS] possible self-deadlock window after bad ProcessStartupPacket

2017-06-22 Thread Robert Haas
On Thu, Feb 2, 2017 at 3:18 PM, Jimmy Yih wrote: > In that pull request, we fix the issue by checking for proc_exit_inprogress. > Is there a reason why startup_die should not check for proc_exit_inprogress? startup_die() is just calling proc_exit(), so it seems like it might be

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

2017-06-22 Thread Shubham Barai
Hi, On 22 June 2017 at 21:12, Alvaro Herrera wrote: > Shubham Barai wrote: > > Hi, > > > > Now that hash index support write-ahead logging, it will be great if we > add > > support for predicate locking to it. > > Implementation of predicate locking in hash index seems

Re: [HACKERS] SQL MERGE patches for PostgreSQL Versions

2017-06-22 Thread Peter Geoghegan
On Thu, Jun 22, 2017 at 9:52 AM, Jan de Visser wrote: > I am not quite sure what you're trying to achieve, but are you aware that > pgsql 9.6 introduced the ON CONFLICT clause, which allows you to do the same > with a different syntax? > >

Re: [HACKERS] SQL MERGE patches for PostgreSQL Versions

2017-06-22 Thread Kang Yuzhe
On Thu, Jun 22, 2017 at 3:13 PM, Michael Paquier wrote: > On Thu, Jun 22, 2017 at 5:30 PM, Kang Yuzhe wrote: >> I wish I could but it's because I don't believe that I have the right >> capability to fix code conflicts. My ultimate goal is to be PG

Re: [HACKERS] SQL MERGE patches for PostgreSQL Versions

2017-06-22 Thread Kang Yuzhe
On Thu, Jun 22, 2017 at 7:52 PM, Jan de Visser wrote: > On Thursday, June 22, 2017 12:32:14 PM EDT Kang Yuzhe wrote: >> Here is a sample what I did after applying the patch. >> >> testdb=# BEGIN; >> BEGIN >> testdb=# >> testdb=# MERGE INTO Stock USING Buy ON Stock.item_id =

Re: [HACKERS] SQL MERGE patches for PostgreSQL Versions

2017-06-22 Thread Jan de Visser
On Thursday, June 22, 2017 12:32:14 PM EDT Kang Yuzhe wrote: > Here is a sample what I did after applying the patch. > > testdb=# BEGIN; > BEGIN > testdb=# > testdb=# MERGE INTO Stock USING Buy ON Stock.item_id = Buy.item_id > testdb-# WHEN MATCHED THEN UPDATE SET balance = balance + Buy.volume

Re: [HACKERS] lseek/read/write overhead becomes visible at scale ..

2017-06-22 Thread Andres Freund
On 2017-06-22 12:43:16 -0400, Robert Haas wrote: > On Wed, Jan 25, 2017 at 2:52 PM, Andres Freund wrote: > > You'll, depending on your workload, still have a lot of lseeks even if > > we were to use pread/pwrite because we do lseek(SEEK_END) to get file > > sizes. > > I'm

Re: [HACKERS] Misplacement of function declaration in contrib/postgres_fdw/postgres_fdw.h

2017-06-22 Thread Robert Haas
On Wed, Jan 11, 2017 at 10:19 PM, Etsuro Fujita wrote: > While working on pushing down more joins/updates to the remote, I noticed > that in contrib/postgres_fdw/postgres_fdw.h the declaration of > get_jointype_name is misplaced in the section of shippable.c. Since

Re: [HACKERS] SQL MERGE patches for PostgreSQL Versions

2017-06-22 Thread Kang Yuzhe
On Thu, Jun 22, 2017 at 3:51 PM, Peter Eisentraut wrote: > On 6/22/17 05:13, Craig Ringer wrote: >> On 22 June 2017 at 17:00, Kang Yuzhe wrote: >> >>> diff --git a/src/backend/executor/nodeModifyTable.c >>>

Re: [HACKERS] lseek/read/write overhead becomes visible at scale ..

2017-06-22 Thread Robert Haas
On Wed, Jan 25, 2017 at 2:52 PM, Andres Freund wrote: > You'll, depending on your workload, still have a lot of lseeks even if > we were to use pread/pwrite because we do lseek(SEEK_END) to get file > sizes. I'm pretty convinced that the lseek overhead that we're incurring

Re: [HACKERS] SQL MERGE patches for PostgreSQL Versions

2017-06-22 Thread Kang Yuzhe
On Thu, Jun 22, 2017 at 12:10 PM, Thomas Munro wrote: > On Thu, Jun 22, 2017 at 9:00 PM, Kang Yuzhe wrote: >> I just downloaded the patch from GSoC site. > > I just looked at > https://wiki.postgresql.org/wiki/Add_MERGE_command_GSoC_2010 and

Re: [HACKERS] pg_stop_backup(wait_for_archive := true) on standby server

2017-06-22 Thread Masahiko Sawada
On Thu, Jun 22, 2017 at 10:36 PM, Magnus Hagander wrote: > > > On Thu, Jun 22, 2017 at 10:12 AM, Masahiko Sawada > wrote: >> >> Hi, >> >> Since an optional second argument wait_for_archive of pg_stop_backup >> has been introduced in PostgreSQL 10 we

Re: [HACKERS] Optional message to user when terminating/cancelling backend

2017-06-22 Thread Dilip Kumar
On Thu, Jun 22, 2017 at 7:18 PM, Daniel Gustafsson wrote: > Good point. I’ve attached a new version which issues a NOTICE on truncation > and also addresses all other comments so far in this thread. Thanks a lot for > the early patch reviews! > > cheers ./daniel I have done an

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2017-06-22 Thread Andres Freund
Hi, On 2017-06-22 13:43:35 +0200, Daniel Verite wrote: > But OTOH there are certainly batch workloads where it will be preferrable > for the first query to reach the server ASAP, rather than waiting to be > coalesced with the next ones. Is that really something people expect from a batch API? I

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

2017-06-22 Thread Alvaro Herrera
Shubham Barai wrote: > Hi, > > Now that hash index support write-ahead logging, it will be great if we add > support for predicate locking to it. > Implementation of predicate locking in hash index seems very simple. > I have already made changes in the code. I am currently working on testing.

Re: [HACKERS] [patch] pg_dump/pg_restore zerror() and strerror() mishap

2017-06-22 Thread Alvaro Herrera
Kunshchikov Vladimir wrote: Hi, > our testing team has noticed apparently wrong backup/restore error > messages like this: > > > pg_restore: [compress_io] could not read from input file: success > pg_dump: [directory archiver] could not write to output file: success > > > > Such

Re: [HACKERS] Multiple TO version in ALTER EXTENSION UPDATE

2017-06-22 Thread Daniel Gustafsson
> On 22 Jun 2017, at 17:02, Tom Lane wrote: > > Robert Haas writes: >> On Wed, Mar 29, 2017 at 11:13 AM, Daniel Gustafsson wrote: >>> While reading I noticed that we allow multiple TO in ALTER >>> EXTENSION >>> UPDATE, and defer

Re: [HACKERS] [psql] patch to fix ordering in words_after_create array

2017-06-22 Thread Robert Haas
On Fri, Mar 24, 2017 at 7:10 AM, Rushabh Lathia wrote: > While looking at the code around tab-complete.c, I > found the ordering in words_after_create array is not > correct for DEFAULT PRIVILEGES, which been added > under below commit: > > commit

Re: [HACKERS] Multiple TO version in ALTER EXTENSION UPDATE

2017-06-22 Thread Tom Lane
Robert Haas writes: > On Wed, Mar 29, 2017 at 11:13 AM, Daniel Gustafsson wrote: >> While reading I noticed that we allow multiple TO in ALTER >> EXTENSION >> UPDATE, and defer throwing a syntax error until command processing. Is >> there a >> reason

Re: [HACKERS] Redundant check of em_is_child

2017-06-22 Thread Robert Haas
On Fri, May 19, 2017 at 3:46 AM, Amit Langote wrote: > In match_eclasses_to_foreign_key_col(), there is this: > > if (em->em_is_child) > continue; /* ignore children here */ > > ISTM, it might as well be: > >

Re: [HACKERS] Prologue of set_append_rel_size() and partitioned tables

2017-06-22 Thread Robert Haas
On Wed, Mar 29, 2017 at 3:18 AM, Ashutosh Bapat wrote: >> Update patch attached. > > Looks good to me. Committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Multiple TO version in ALTER EXTENSION UPDATE

2017-06-22 Thread Robert Haas
On Wed, Mar 29, 2017 at 11:13 AM, Daniel Gustafsson wrote: > While reading I noticed that we allow multiple TO in ALTER EXTENSION > UPDATE, and defer throwing a syntax error until command processing. Is there > a > reason for deferring and not handling it in gram.y directly as

Re: [HACKERS] Re-indent HEAD tomorrow?

2017-06-22 Thread Robert Haas
On Wed, Jun 21, 2017 at 5:28 PM, Tom Lane wrote: > Right now we're really just speculating about how much pain there will > be, on either end of this. So it'd be interesting for somebody who's > carrying large out-of-tree patches (EDB? Citus?) to try the new > pgindent

Re: [HACKERS] Pluggable storage

2017-06-22 Thread Alexander Korotkov
On Thu, Jun 22, 2017 at 5:27 PM, Robert Haas wrote: > On Thu, Jun 22, 2017 at 8:32 AM, Alexander Korotkov > wrote: > > On Thu, Jun 22, 2017 at 4:01 AM, Michael Paquier < > michael.paqu...@gmail.com> > > wrote: > >> Putting that in a couple of

Re: [HACKERS] Pluggable storage

2017-06-22 Thread Alexander Korotkov
On Wed, Jun 21, 2017 at 10:47 PM, Robert Haas wrote: > On Mon, Jun 12, 2017 at 9:50 PM, Haribabu Kommi > wrote: > > Open Items: > > > > 1. The BitmapHeapScan and TableSampleScan are tightly coupled with > > HeapTuple and HeapScanDesc, So these

Re: [HACKERS] Pluggable storage

2017-06-22 Thread Robert Haas
On Thu, Jun 22, 2017 at 8:32 AM, Alexander Korotkov wrote: > On Thu, Jun 22, 2017 at 4:01 AM, Michael Paquier > wrote: >> Putting that in a couple of words. >> 1. Table AM with a 6-byte TID. >> 2. Table AM with a custom locator format, which

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

2017-06-22 Thread Tom Lane
Andrew Dunstan writes: > Please let me know if there are tests I can run. I missed your earlier > request in this thread, sorry about that. That earlier request is still valid. Also, if you can reproduce the symptom that lorikeet just showed and get a stack

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

2017-06-22 Thread Andrew Dunstan
On 06/21/2017 06:44 PM, Tom Lane wrote: > Today, lorikeet failed with a new variant on the bgworker start crash: > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=lorikeet=2017-06-21%2020%3A29%3A10 > > This one is even more exciting than the last one, because it sure looks > like the

Re: [HACKERS] Optional message to user when terminating/cancelling backend

2017-06-22 Thread Daniel Gustafsson
> On 22 Jun 2017, at 10:24, Yugo Nagata wrote: > > On Thu, 22 Jun 2017 09:24:54 +0900 > Michael Paquier wrote: > >> On Wed, Jun 21, 2017 at 11:42 PM, Daniel Gustafsson wrote: >>> The message is truncated in

Re: [HACKERS] Fix a typo in partition.c

2017-06-22 Thread Magnus Hagander
On Thu, Jun 22, 2017 at 4:16 AM, Masahiko Sawada wrote: > On Wed, Jun 21, 2017 at 3:32 AM, Peter Eisentraut > wrote: > > On 6/19/17 23:02, Masahiko Sawada wrote: > >> Hi, > >> > >> Attached patch for $subject. > >> > >>

Re: [HACKERS] pg_stop_backup(wait_for_archive := true) on standby server

2017-06-22 Thread Magnus Hagander
On Thu, Jun 22, 2017 at 10:12 AM, Masahiko Sawada wrote: > Hi, > > Since an optional second argument wait_for_archive of pg_stop_backup > has been introduced in PostgreSQL 10 we can choose whether wait for > archiving. But my colleagues found that we can do pg_stop_backup

Re: [HACKERS] TRUE and true

2017-06-22 Thread Peter Eisentraut
On 6/22/17 07:09, Kyotaro HORIGUCHI wrote: > What makes us have both TRUE/true or FALSE/false as constants of > bool? Historical reasons, probably. I plan to submit a patch to phase out or remove TRUE/FALSE as part of a migration toward stdbool.h. So I suggest you use lower case and don't worry

Re: [HACKERS] SQL MERGE patches for PostgreSQL Versions

2017-06-22 Thread Peter Eisentraut
On 6/22/17 05:13, Craig Ringer wrote: > On 22 June 2017 at 17:00, Kang Yuzhe wrote: > >> diff --git a/src/backend/executor/nodeModifyTable.c >> b/src/backend/executor/nodeModifyTable.c >> index 8619ce3..e3ac758 100644 >> --- a/src/backend/executor/nodeModifyTable.c >> +++

[HACKERS] [patch] pg_dump/pg_restore zerror() and strerror() mishap

2017-06-22 Thread Kunshchikov Vladimir
Hello, our testing team has noticed apparently wrong backup/restore error messages like this: pg_restore: [compress_io] could not read from input file: success pg_dump: [directory archiver] could not write to output file: success Such "success" messages are caused by calling strerror()

Re: [HACKERS] TRUE and true

2017-06-22 Thread Alexander Korotkov
On Thu, Jun 22, 2017 at 2:09 PM, Kyotaro HORIGUCHI < horiguchi.kyot...@lab.ntt.co.jp> wrote: > Hello, I have a maybe-silly question. > > What makes us have both TRUE/true or FALSE/false as constants of > bool? > > The following definitions in c.h didn't mess anything up. > > #define TRUEtrue

Re: [HACKERS] Pluggable storage

2017-06-22 Thread Alexander Korotkov
On Thu, Jun 22, 2017 at 4:01 AM, Michael Paquier wrote: > Putting that in a couple of words. > 1. Table AM with a 6-byte TID. > 2. Table AM with a custom locator format, which could be TID-like. > 3. Table AM with no locators. > > Getting into having #1 first to work

Re: [HACKERS] Pluggable storage

2017-06-22 Thread Alexander Korotkov
On Tue, Jun 13, 2017 at 4:50 AM, Haribabu Kommi wrote: > On Fri, Oct 14, 2016 at 7:26 AM, Alvaro Herrera > wrote: > >> I have sent the partial patch I have to Hari Babu Kommi. We expect that >> he will be able to further this goal some more.

Re: [HACKERS] SQL MERGE patches for PostgreSQL Versions

2017-06-22 Thread Michael Paquier
On Thu, Jun 22, 2017 at 5:30 PM, Kang Yuzhe wrote: > I wish I could but it's because I don't believe that I have the right > capability to fix code conflicts. My ultimate goal is to be PG hacker > like YOU. Anyway, I will consider your perspective. Nice to see such a goal,

[HACKERS] Multi column range partition table

2017-06-22 Thread amul sul
Hi, While working on the another patch, I came across the case where I need an auto generated partition for a mutil-column range partitioned table having following range bound: PARTITION p1 FROM (UNBOUNDED, UNBOUNDED) TO (10, 10) PARTITION p2 FROM (10, 10) TO (10, UNBOUNDED) PARTITION p3 FROM

  1   2   >