Re: [PROPOSAL] Shared Ispell dictionaries

2018-03-31 Thread Arthur Zakirov
Tomas Vondra wrote: > > On 03/31/2018 12:42 PM, Arthur Zakirov wrote: > > Hello all, > > > > I'd like to add new optional function to text search template named fini > > in addition to init() and lexize(). It will be called by > > RemoveTSDictionaryById() and AlterTSDictionary(). dispell_fini()

Re: [HACKERS] A design for amcheck heapam verification

2018-03-31 Thread Peter Geoghegan
On Sat, Mar 31, 2018 at 2:56 PM, Andres Freund wrote: >> So you're asking for something like bt_index_check_heap() + >> bt_index_parent_check_heap()? Or, are you talking about function >> overloading? > > The latter. That addresses my concerns about dropping the function and >

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-03-31 Thread Michael Paquier
On Sat, Mar 31, 2018 at 12:38:12PM -0400, Tom Lane wrote: > Craig Ringer writes: >> So we should just use the big hammer here. > > And bitch, loudly and publicly, about how broken this kernel behavior is. > If we make enough of a stink maybe it'll get fixed. That won't

Re: [HACKERS] A design for amcheck heapam verification

2018-03-31 Thread Peter Geoghegan
On Fri, Mar 30, 2018 at 7:04 PM, Andres Freund wrote: > I'm just saying that there should be two functions here, rather than dropping > the old definition, and creating s new one with a default argument. So you're asking for something like bt_index_check_heap() +

Re: [HACKERS] A design for amcheck heapam verification

2018-03-31 Thread Peter Geoghegan
On Sat, Mar 31, 2018 at 2:59 PM, Peter Geoghegan wrote: > WFM. I have all the information I need to produce the next revision now. I might as well post this one first. I'll have 0002 for you in a short while. -- Peter Geoghegan

Re: [HACKERS] [PATCH] Incremental sort

2018-03-31 Thread Tomas Vondra
Hi, I've been doing a bit more review of the patch today, focusing on the planner part, and I'm starting to have some doubts regarding the way incremental sort paths are created. I do have some question about the executor and other parts too. I'll mark this as 'waiting on author' to make it

Re: Foreign keys and partitioned tables

2018-03-31 Thread Alvaro Herrera
Peter Eisentraut wrote: > On 3/29/18 23:19, Alvaro Herrera wrote: > > 0003 is the matter of interest. This is essentially the same code I > > posted earlier, rebased to the committed row triggers patch, with a few > > minor bug fixes and some changes in the regression tests to try and make > >

Re: some last patches breaks plan cache

2018-03-31 Thread Tomas Vondra
On 03/31/2018 07:38 PM, Pavel Stehule wrote: > Hi > > CREATE OR REPLACE PROCEDURE public.proc(a integer, INOUT b integer, c > integer) >  LANGUAGE plpgsql > AS $procedure$ > begin >   b := a + c; > end; > $procedure$ > > CREATE OR REPLACE PROCEDURE public.testproc() >  LANGUAGE plpgsql > AS

Re: some last patches breaks plan cache

2018-03-31 Thread Tomas Vondra
On 03/31/2018 07:56 PM, Tomas Vondra wrote: > On 03/31/2018 07:38 PM, Pavel Stehule wrote: >> Hi >> >> CREATE OR REPLACE PROCEDURE public.proc(a integer, INOUT b integer, c >> integer) >>  LANGUAGE plpgsql >> AS $procedure$ >> begin >>   b := a + c; >> end; >> $procedure$ >> >> CREATE OR REPLACE

Re: [HACKERS] A design for amcheck heapam verification

2018-03-31 Thread Andres Freund
On 2018-03-31 11:27:14 -0700, Peter Geoghegan wrote: > On Fri, Mar 30, 2018 at 7:04 PM, Andres Freund wrote: > > I'm just saying that there should be two functions here, rather than > > dropping the old definition, and creating s new one with a default argument. > > So

Re: [HACKERS][PATCH] adding simple sock check for windows

2018-03-31 Thread Tom Lane
... Oh, just to make things even more fun, PQsocket() returns int, not pgsocket; see its header comment. Therefore, that test is correctly coded as-is (though it's still useless), and the real problem is that ParallelSlot.sock ought to be declared int not pgsocket. If you look around at our

Re: some last patches breaks plan cache

2018-03-31 Thread Tomas Vondra
On 03/31/2018 08:28 PM, Tomas Vondra wrote: > > > On 03/31/2018 07:56 PM, Tomas Vondra wrote: >> On 03/31/2018 07:38 PM, Pavel Stehule wrote: >>> Hi >>> >>> CREATE OR REPLACE PROCEDURE public.proc(a integer, INOUT b integer, c >>> integer) >>>  LANGUAGE plpgsql >>> AS $procedure$ >>> begin >>>

Re: [HACKERS] A design for amcheck heapam verification

2018-03-31 Thread Peter Geoghegan
On Sat, Mar 31, 2018 at 3:15 PM, Peter Geoghegan wrote: >> WFM. I have all the information I need to produce the next revision now. > > I might as well post this one first. I'll have 0002 for you in a short while. Attached is 0002 -- the amcheck enhancement itself. As requested by

Re: WIP: Covering + unique indexes.

2018-03-31 Thread Peter Geoghegan
On Fri, Mar 30, 2018 at 6:24 AM, Alexander Korotkov wrote: >> With an extreme enough case, this could result in a failure to find a >> split point. Or at least, if that isn't true then it's not clear why, >> and I think it needs to be explained. > > > I don't think this

Re: [HACKERS] A design for amcheck heapam verification

2018-03-31 Thread Peter Geoghegan
On Sat, Mar 31, 2018 at 8:09 PM, Peter Geoghegan wrote: > I was thinking of using rint(), which is what you get if you call > round(float8) from SQL. Attached patch does it that way. Note that there are float/int cast regression tests that ensure that rint() behaves consistently on

Re: [HACKERS] A design for amcheck heapam verification

2018-03-31 Thread Peter Geoghegan
On Sat, Mar 31, 2018 at 8:32 PM, Andres Freund wrote: > LGTM, pushed. Closing CF entry. Yay! Only 110 to go. Thanks Andres! -- Peter Geoghegan

Re: lazy detoasting

2018-03-31 Thread Tom Lane
Chapman Flack writes: > If I copy an out-of-line, on-disk TOAST pointer into a memory context > with transaction lifetime, with an eye to detoasting it later in the > same transaction, are there circumstances where it wouldn't work? Should be safe *as long as you hold onto

Re: [HACKERS][PATCH] adding simple sock check for windows

2018-03-31 Thread Tom Lane
Amit Kapila writes: > oops, I just saw that you have already pushed a fix for it. I am not > sure if we should try to do anything about walrcv_receive's output > still uses pgsocket instead of int as the usage in itself doesn't have > any problem. I see a few places

Re: [HACKERS] A design for amcheck heapam verification

2018-03-31 Thread Peter Geoghegan
On Sat, Mar 31, 2018 at 3:15 PM, Peter Geoghegan wrote: > On Sat, Mar 31, 2018 at 2:59 PM, Peter Geoghegan wrote: >> WFM. I have all the information I need to produce the next revision now. > > I might as well post this one first. I'll have 0002 for you in a short

Re: [HACKERS] A design for amcheck heapam verification

2018-03-31 Thread Peter Geoghegan
On Sat, Mar 31, 2018 at 8:08 PM, Andres Freund wrote: >> round() is from C99, apparently. I'll investigate a fix. > > Just replacing it with a floor(val + 0.5) ought to do the trick, right? I was thinking of using rint(), which is what you get if you call round(float8) from

Re: [HACKERS] A design for amcheck heapam verification

2018-03-31 Thread Andres Freund
On 2018-03-31 19:43:45 -0700, Peter Geoghegan wrote: > On Sat, Mar 31, 2018 at 3:15 PM, Peter Geoghegan wrote: > > On Sat, Mar 31, 2018 at 2:59 PM, Peter Geoghegan wrote: > >> WFM. I have all the information I need to produce the next revision now. > > > > I might as

Re: [HACKERS][PATCH] adding simple sock check for windows

2018-03-31 Thread Amit Kapila
On Sat, Mar 31, 2018 at 11:33 PM, Tom Lane wrote: > ... Oh, just to make things even more fun, PQsocket() returns int, not > pgsocket; see its header comment. Therefore, that test is correctly > coded as-is (though it's still useless), and the real problem is that >

Re: [HACKERS] why not parallel seq scan for slow functions

2018-03-31 Thread Amit Kapila
On Fri, Mar 30, 2018 at 1:41 AM, Robert Haas wrote: > On Thu, Mar 29, 2018 at 12:55 AM, Amit Kapila wrote: >> I think that is under acceptable range. I am seeing few regression >> failures with the patch series. The order of targetlist seems to

lazy detoasting

2018-03-31 Thread Chapman Flack
Hi, If I copy an out-of-line, on-disk TOAST pointer into a memory context with transaction lifetime, with an eye to detoasting it later in the same transaction, are there circumstances where it wouldn't work? Thanks, -Chap

Re: [HACKERS] A design for amcheck heapam verification

2018-03-31 Thread Andres Freund
On 2018-03-31 20:25:24 -0700, Peter Geoghegan wrote: > On Sat, Mar 31, 2018 at 8:09 PM, Peter Geoghegan wrote: > > I was thinking of using rint(), which is what you get if you call > > round(float8) from SQL. > > Attached patch does it that way. Note that there are float/int cast >

Re: [HACKERS][PATCH] adding simple sock check for windows

2018-03-31 Thread Amit Kapila
On Sun, Apr 1, 2018 at 8:59 AM, Amit Kapila wrote: > On Sat, Mar 31, 2018 at 11:33 PM, Tom Lane wrote: >> ... Oh, just to make things even more fun, PQsocket() returns int, not >> pgsocket; see its header comment. Therefore, that test is correctly >>

Re: [HACKERS][PATCH] adding simple sock check for windows

2018-03-31 Thread CharSyam
Thanks Amit. I had a mistake. Thank you again to point it out :) 2018-03-31 19:33 GMT+09:00 Amit Kapila : > On Sat, Mar 31, 2018 at 12:05 PM, CharSyam wrote: >> Amit, I agree with you. >> >> I changed my patch :) to remove old check. >> > > - if

Re: [PATCH] Verify Checksums during Basebackups

2018-03-31 Thread Michael Banck
Hi, On Fri, Mar 30, 2018 at 07:46:02AM -0400, Stephen Frost wrote: > * Magnus Hagander (mag...@hagander.net) wrote: > > On Fri, Mar 30, 2018 at 5:35 AM, David Steele wrote: > > > > > On 3/24/18 10:32 AM, Michael Banck wrote: > > > > Am Freitag, den 23.03.2018, 17:43 +0100

Re: [HACKERS][PATCH] adding simple sock check for windows

2018-03-31 Thread Amit Kapila
On Sat, Mar 31, 2018 at 6:08 PM, CharSyam wrote: > Thanks Amit. > I had a mistake. Thank you again to point it out :) > Thanks, your new patch looks good. -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com

Re: Foreign keys and partitioned tables

2018-03-31 Thread Peter Eisentraut
On 3/29/18 23:19, Alvaro Herrera wrote: > 0001 prohibits having foreign keys pointing to partitioned tables, as > discussed above. This is already prohibited. You get an error ERROR: cannot reference partitioned table "fk_partitioned_pk" Your patch 0001 just adds the same error check a few

Re: hot_standby_feedback vs excludeVacuum and snapshots

2018-03-31 Thread Amit Kapila
On Thu, Mar 29, 2018 at 4:47 PM, Greg Stark wrote: > I'm poking around to see debug a vacuuming problem and wondering if > I've found something more serious. > > As far as I can tell the snapshots on HOT standby are built using a > list of running xids that the primary builds and

Re: WIP: a way forward on bootstrap data

2018-03-31 Thread John Naylor
Attached is v13, rebased against b0c90c85fc. Patch 0001: -The data files are formatted to at most 80 columns wide. -Rename rewrite_dat.pl to reformat_dat_file.pl. -Refactor Catalog.pm and reformat_dat_file.pl to have better separation of concerns. -Add src/include/catalog/Makefile with

Re: Small proposal to improve out-of-memory messages

2018-03-31 Thread Alvaro Herrera
Tom Lane wrote: > In the wake of commit 442accc3f one might think that the message should > also include the context "identifier" if any. But I'm specifically not > proposing that, because of the point made in the discussion of that patch > that some identifier strings might contain

Re: [HACKERS][PATCH] adding simple sock check for windows

2018-03-31 Thread CharSyam
Amit, I agree with you. I changed my patch :) to remove old check. 2018-03-31 15:17 GMT+09:00 Amit Kapila : > On Sat, Mar 31, 2018 at 11:42 AM, CharSyam wrote: >> Hi, Amit, It's good question. I also thought about it. >> >> But, I want to leave

Re: Feature Request - DDL deployment with logical replication

2018-03-31 Thread Nikhil Sontakke
Hi Jeremy, > My whole point is that in most architectures, DBAs decide to deploy the same > SQL on providers and subscribers. Yes it isn't perfect, but IMO, it is very > helpful to try to automate that idea, as opposed to trying to actually > replicate DDL at the low level. The latter is

Re: 2018-03 Commitfest Summary (Andres #1)

2018-03-31 Thread Fabien COELHO
Hello Bruce, Has anyone considered moving pgbench out of our git tree and into a separate project where a separate team could maintain and improve it? The movements has been the exact reverse: it was initially in contrib where it had some independence, and has been promoted to the main

Re: csv format for psql

2018-03-31 Thread Gavin Flower
On 31/03/18 21:33, Fabien COELHO wrote: Bonjour Daniel, For csv, Fabien and Peter expressed the opinion that we shouldn't create another fieldsep-like variable specifically for it, but instead reuse fieldsep. That's what my latest patch does. Now it turns out that sharing fieldsep comes with

Re: csv format for psql

2018-03-31 Thread Fabien COELHO
Bonjour Daniel, For csv, Fabien and Peter expressed the opinion that we shouldn't create another fieldsep-like variable specifically for it, but instead reuse fieldsep. That's what my latest patch does. Now it turns out that sharing fieldsep comes with some problems. Personnaly I do not

Re: Planning counters in pg_stat_statements

2018-03-31 Thread legrand legrand
+1 Shouldn't this be added in next CF ? nb: As plan_time is not included into total_time, could it be added to usage (for statement eviction calculation) ? I will try to include plan_time into my proposed version of pgss with planid.

Re: [HACKERS][PATCH] adding simple sock check for windows

2018-03-31 Thread CharSyam
Hi, Amit, It's good question. I also thought about it. But, I want to leave original code intention. Actually I think there is no case ( slot->sock is not PGINVALID_SOCKET and slot->sock < 0) but if original code want to check (sock < -1) I think it is better to leave that condition. but I

Re: [HACKERS][PATCH] adding simple sock check for windows

2018-03-31 Thread Amit Kapila
On Sat, Mar 31, 2018 at 11:42 AM, CharSyam wrote: > Hi, Amit, It's good question. I also thought about it. > > But, I want to leave original code intention. > > Actually I think there is no case ( slot->sock is not PGINVALID_SOCKET > and slot->sock < 0) > > but if original

Re: [PROPOSAL] Shared Ispell dictionaries

2018-03-31 Thread Arthur Zakirov
Hello all, I'd like to add new optional function to text search template named fini in addition to init() and lexize(). It will be called by RemoveTSDictionaryById() and AlterTSDictionary(). dispell_fini() will call ts_dict_shmem_release(). It doesn't change segments leaking situation. I think

bulk typos

2018-03-31 Thread Justin Pryzby
I needed another distraction so bulk-checked for typos, limited to comments in *.[ch]. I'm not passionate about this, but it serves the purpose of reducing the overhead of fixing them individually. Also I heard something here recently about ugly languages.. time find . -name '*.c' -print0 |xargs

Re: Problem while setting the fpw with SIGHUP

2018-03-31 Thread Amit Kapila
On Wed, Mar 28, 2018 at 12:10 PM, Kyotaro HORIGUCHI wrote: > At Tue, 27 Mar 2018 22:02:26 +0900, Michael Paquier > wrote in <20180327130226.ga1...@paquier.xyz> >> On Tue, Mar 27, 2018 at 09:01:20PM +0900, Kyotaro HORIGUCHI wrote: >> > The

Re: [HACKERS][PATCH] adding simple sock check for windows

2018-03-31 Thread Amit Kapila
On Sat, Mar 31, 2018 at 12:05 PM, CharSyam wrote: > Amit, I agree with you. > > I changed my patch :) to remove old check. > - if (slot->sock < 0) + if (slot->sock == PGINVALID_SOCKET || slot->sock < 0) I still see the same check. I think by mistake you have attached old

Re: bulk typos

2018-03-31 Thread Félix GERZAGUET
On Sat, Mar 31, 2018 at 12:56 PM, Justin Pryzby wrote: > I needed another distraction so bulk-checked for typos, limited to > comments in > *.[ch]. > I think you introduced another one while changing "explcitly" to "expilcitly" instead of "explicitly" :-) -- Félix

Re: Online enabling of checksums

2018-03-31 Thread Magnus Hagander
On Sat, Mar 31, 2018 at 2:08 AM, Tomas Vondra wrote: > Hi, > > I've been looking at the patch a bit more, and I think there are a > couple of fairly serious issues in the error handling. > Thanks! > > Firstly ChecksumHelperLauncherMain spends quite a bit of

Re: Feature Request - DDL deployment with logical replication

2018-03-31 Thread Craig Ringer
On 31 March 2018 at 15:53, Nikhil Sontakke wrote: > Hi Jeremy, > > > My whole point is that in most architectures, DBAs decide to deploy the > same > > SQL on providers and subscribers. Yes it isn't perfect, but IMO, it is > very > > helpful to try to automate that

Re: Parallel Aggregates for string_agg and array_agg

2018-03-31 Thread David Rowley
On 30 March 2018 at 02:55, Tomas Vondra wrote: > On 03/29/2018 03:09 PM, David Rowley wrote: >> I meant to mention earlier that I coded >> agg_args_have_sendreceive_funcs() to only check for send/receive >> functions. Really we could allow a byval types without

Re: Online enabling of checksums

2018-03-31 Thread Magnus Hagander
On Sat, Mar 31, 2018 at 4:21 PM, Tomas Vondra wrote: > > On 03/31/2018 02:02 PM, Magnus Hagander wrote: > > On Sat, Mar 31, 2018 at 2:08 AM, Tomas Vondra > > > > wrote: > > > > > > But wait -

Re: csv format for psql

2018-03-31 Thread Isaac Morland
On 31 March 2018 at 04:33, Fabien COELHO wrote: > > Bonjour Daniel, > > For csv, Fabien and Peter expressed the opinion that we shouldn't >> create another fieldsep-like variable specifically for it, but instead >> reuse fieldsep. That's what my latest patch does. >> >> Now

Re: [PROPOSAL] Shared Ispell dictionaries

2018-03-31 Thread Tomas Vondra
On 03/31/2018 12:42 PM, Arthur Zakirov wrote: > Hello all, > > I'd like to add new optional function to text search template named fini > in addition to init() and lexize(). It will be called by > RemoveTSDictionaryById() and AlterTSDictionary(). dispell_fini() will > call

Re: Online enabling of checksums

2018-03-31 Thread Tomas Vondra
Hi, On 03/31/2018 02:02 PM, Magnus Hagander wrote: > On Sat, Mar 31, 2018 at 2:08 AM, Tomas Vondra > > wrote: > > ... > > (a) Should not be difficult to do, I think. We don't have relation_open > with a missing_ok flag,

Re: Small proposal to improve out-of-memory messages

2018-03-31 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> In the wake of commit 442accc3f one might think that the message should >> also include the context "identifier" if any. But I'm specifically not >> proposing that, because of the point made in the discussion of that patch >>

Re: WIP: a way forward on bootstrap data

2018-03-31 Thread Tom Lane
John Naylor writes: > And in the department of second thoughts, it occurred to me that the > only reason that the .dat files are in include/catalog is because > that's where the DATA() statements were. Since they are separate now, > one could make the case that they actually

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-03-31 Thread Craig Ringer
On 31 March 2018 at 21:24, Anthony Iliopoulos wrote: > On Fri, Mar 30, 2018 at 10:18:14AM +1300, Thomas Munro wrote: > > > >> Yeah, I see why you want to PANIC. > > > > > > Indeed. Even doing that leaves question marks about all the kernel > > > versions before v4.13, which

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-03-31 Thread Tom Lane
Craig Ringer writes: > So we should just use the big hammer here. And bitch, loudly and publicly, about how broken this kernel behavior is. If we make enough of a stink maybe it'll get fixed. regards, tom lane

Re: Feature Request - DDL deployment with logical replication

2018-03-31 Thread Andres Freund
On 2018-03-31 22:13:42 +0800, Craig Ringer wrote: > We'll still need a mechanism to transport them to downstreams (like WAL > messages) and to send responses upstream. For responses I think we will > finally want to add a backchannel to the logical replication protocol as > I've wanted for a long

Re: Foreign keys and partitioned tables

2018-03-31 Thread Peter Eisentraut
On 3/29/18 23:19, Alvaro Herrera wrote: > 0003 is the matter of interest. This is essentially the same code I > posted earlier, rebased to the committed row triggers patch, with a few > minor bug fixes and some changes in the regression tests to try and make > them more comprehensive, including

Re: [HACKERS][PATCH] adding simple sock check for windows

2018-03-31 Thread Tom Lane
CharSyam writes: > [ simple_check.patch ] This is a good catch. However, it looks to me like the reason nobody has noticed a problem here is that actually, this error test is useless; we can never get here with a bad connection, because connectDatabase would have failed.

Re: [HACKERS][PATCH] adding simple sock check for windows

2018-03-31 Thread CharSyam
Hi, Tom, Thank you for your review. so Do you think it is better to remove if statement like below diff --git src/bin/scripts/vacuumdb.c src/bin/scripts/vacuumdb.c index 887fa48fbd..243d842d06 100644 --- src/bin/scripts/vacuumdb.c +++ src/bin/scripts/vacuumdb.c @@ -947,13 +947,6 @@

some last patches breaks plan cache

2018-03-31 Thread Pavel Stehule
Hi CREATE OR REPLACE PROCEDURE public.proc(a integer, INOUT b integer, c integer) LANGUAGE plpgsql AS $procedure$ begin b := a + c; end; $procedure$ CREATE OR REPLACE PROCEDURE public.testproc() LANGUAGE plpgsql AS $procedure$ declare r int; begin call proc(10, r, 20); end; $procedure$