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

2018-04-05 Thread Heikki Linnakangas
On 03/04/18 17:20, Claudio Freire wrote: Ok, rebased patches attached Thanks! I took a look at this. First, now that the data structure is more complicated, I think it's time to abstract it, and move it out of vacuumlazy.c. The Tid Map needs to support the following operations: * Add

Re: Parallel Aggregates for string_agg and array_agg

2018-04-05 Thread Tomas Vondra
On 04/05/2018 05:41 AM, David Rowley wrote: > Hi Tomas, > > Thanks for taking another look. > > On 5 April 2018 at 07:12, Tomas Vondra wrote: >> Seems fine to me, although we should handle the anyarray case too, I >> guess. That is, get_agg_clause_costs_walker()

Re: Checkpoint not retrying failed fsync?

2018-04-05 Thread Thomas Munro
On Fri, Apr 6, 2018 at 10:16 AM, Andrew Gierth wrote: > Furthermore, checking the trace output from the checkpointer process, it > is not even attempting an fsync of the failing file; this isn't like the > Linux fsync issue, I've confirmed that fsync will repeatedly

Re: Checkpoint not retrying failed fsync?

2018-04-05 Thread Andrew Gierth
> "Thomas" == Thomas Munro writes: >> As far as I can tell from reading the code, if a checkpoint fails the >> checkpointer is supposed to keep all the outstanding fsync requests for >> next time. Am I wrong, or is there some failure in the logic to do this?

Re: [HACKERS] path toward faster partition pruning

2018-04-05 Thread Alvaro Herrera
> @@ -1717,8 +1691,8 @@ expand_partitioned_rtentry(PlannerInfo *root, > RangeTblEntry *parentrte, >* parentrte already has the root partrel's updatedCols translated to > match >* the attribute ordering of parentrel. >*/ > - if (!*part_cols_updated) > -

Re: [HACKERS] path toward faster partition pruning

2018-04-05 Thread David Rowley
On 6 April 2018 at 12:02, David Rowley wrote: > On 6 April 2018 at 10:35, Alvaro Herrera wrote: > The only other thing I noted on this pass is that we could get rid of: > > + /* go check the next clause. */ > + if (unsupported_clause) > +

Re: [HACKERS] Runtime Partition Pruning

2018-04-05 Thread Jesper Pedersen
Hi David, First of all: Solid patch set with good documentation. On 04/05/2018 09:41 AM, David Rowley wrote: Seems mostly fair. I'm not a fan of using the term "unpruned" though. I'll have a think. The "all" is meant in terms of what exists as subnodes. 'included_parts' / 'excluded_parts'

Re: WIP: a way forward on bootstrap data

2018-04-05 Thread John Naylor
On 4/5/18, Tom Lane wrote: > I've generalized the BKI_LOOKUP(pg_proc) code so that > you can use either regproc-like or regprocedure-like notation, and then > applied that to relevant columns. > [...] > bootstrap-v13-delta.patch is a diff atop your patch series for the >

Re: Parallel Aggregates for string_agg and array_agg

2018-04-05 Thread Tomas Vondra
On 04/05/2018 09:10 PM, Tels wrote: > Moin, > > On Wed, April 4, 2018 11:41 pm, David Rowley wrote: >> Hi Tomas, >> >> Thanks for taking another look. >> >> On 5 April 2018 at 07:12, Tomas Vondra >> wrote: >>> Other than that, the patch seems fine to me, and it's

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

2018-04-05 Thread Claudio Freire
On Thu, Apr 5, 2018 at 5:02 PM, Heikki Linnakangas wrote: > On 03/04/18 17:20, Claudio Freire wrote: >> >> Ok, rebased patches attached > > > Thanks! I took a look at this. > > First, now that the data structure is more complicated, I think it's time to > abstract it, and move it

Re: [HACKERS] MERGE SQL Statement for PG11

2018-04-05 Thread Andres Freund
Hi, On 2018-04-05 11:31:48 +0530, Pavan Deolasee wrote: > > +/*- > > > > + * > > + * nodeMerge.c > > + * routines to handle Merge nodes relating to the MERGE command > > > > Isn't this file misnamed and it should be

Re: Online enabling of checksums

2018-04-05 Thread Andres Freund
On 2018-04-05 13:12:08 -0700, Andres Freund wrote: > On 2018-04-05 22:06:36 +0200, Magnus Hagander wrote: > > I have now pushed this latest version with some minor text adjustments and > > a catversion bump. > > > > Thanks for all the reviews! > > I want to be on the record that I think merging

Re: WIP: a way forward on bootstrap data

2018-04-05 Thread Tom Lane
John Naylor writes: > It seems most of the time the FooRelationId labels are predictable, > although not as pristine as the Anum_* constants. One possibility that > came to mind is to treat these like pg_type OID #defines -- have a > simple rule that can be overridden for

Re: file cloning in pg_upgrade and CREATE DATABASE

2018-04-05 Thread Peter Eisentraut
I think we have raised a number of interesting issues here which require more deeper consideration. So I suggest to set this patch to Returned with feedback. Btw., I just learned that copy_file_range() only works on files on the same device. So more arrangements will need to be made for that.

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

2018-04-05 Thread Peter Eisentraut
The documentation change suggests the error will be ERROR: canceling statement due to user request: "Cancellation message text" Why the quotes? -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: [PATCH] btree_gin, add support for uuid, bool, name, bpchar and anyrange types

2018-04-05 Thread Matheus de Oliveira
On Thu, Apr 5, 2018 at 12:23 PM, Teodor Sigaev wrote: > Thanks to everyone, first patch is pushed. > > Range opclass seems unusable because comparing function is close to dummy > and BTree opclass is only useful to implement unique check constraint. So, > for range it should

Re: Online enabling of checksums

2018-04-05 Thread Andres Freund
Hi, On 2018-04-05 22:06:36 +0200, Magnus Hagander wrote: > I have now pushed this latest version with some minor text adjustments and > a catversion bump. Is there any sort of locking that guarantees that worker processes see an up2date value of

Re: BUG #14941: Vacuum crashes

2018-04-05 Thread Michael Paquier
On Thu, Apr 05, 2018 at 08:29:38PM +, Bossart, Nathan wrote: > The new tests are now passing as expected, but I am still doing some > manual testing. Since there is quite a bit of added complexity in > this new patch set, I will certainly not be surprised if this gets > moved to the next

Re: Online enabling of checksums

2018-04-05 Thread Andres Freund
Hi, On 2018-04-05 23:32:19 +0200, Magnus Hagander wrote: > On Thu, Apr 5, 2018 at 11:23 PM, Andres Freund wrote: > > Is there any sort of locking that guarantees that worker processes see > > an up2date value of > > DataChecksumsNeedWrite()/ControlFile->data_checksum_version?

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

2018-04-05 Thread Andrew Gierth
Note: as I've brought up in another thread, it turns out that PG is not handling fsync errors correctly even when the OS _does_ do the right thing (discovered by testing on FreeBSD). -- Andrew (irc:RhodiumToad)

Re: Checkpoint not retrying failed fsync?

2018-04-05 Thread Thomas Munro
On Fri, Apr 6, 2018 at 11:34 AM, Andrew Gierth wrote: >> "Thomas" == Thomas Munro writes: > > >> As far as I can tell from reading the code, if a checkpoint fails the > >> checkpointer is supposed to keep all the outstanding fsync

Re: [HACKERS] path toward faster partition pruning

2018-04-05 Thread David Rowley
On 6 April 2018 at 10:35, Alvaro Herrera wrote: > I changed a lot of code also, but cosmetic changes only. > > I'll clean this up a bit more now, and try to commit shortly (or early > tomorrow); wanted to share current status now in case I have to rush > out. I made a

Re: Online enabling of checksums

2018-04-05 Thread Joshua D. Drake
On 04/05/2018 01:12 PM, Andres Freund wrote: On 2018-04-05 22:06:36 +0200, Magnus Hagander wrote: I have now pushed this latest version with some minor text adjustments and a catversion bump. Thanks for all the reviews! I want to be on the record that I think merging a nontrival feature that

Re: Online enabling of checksums

2018-04-05 Thread Andres Freund
On 2018-04-05 13:51:41 -0700, Joshua D. Drake wrote: > On 04/05/2018 01:12 PM, Andres Freund wrote: > > I want to be on the record that I think merging a nontrival feature that > > got submitted 2018-02-21, just before the start of the last last CF, is > > an abuse of process, and not cool. We've

Re: Online enabling of checksums

2018-04-05 Thread Peter Geoghegan
On Thu, Apr 5, 2018 at 1:27 PM, Andres Freund wrote: >>At least this patch was posted on the lists before commit, unlike many >>others from many different people. And AFAIK there has never been such >>a >>rule. The rules cannot possibly anticipate every situation or subtlety.

Re: Online enabling of checksums

2018-04-05 Thread Magnus Hagander
On Thu, Apr 5, 2018 at 11:48 PM, Tom Lane wrote: > Magnus Hagander writes: > > I have now pushed this latest version with some minor text adjustments > and > > a catversion bump. > > crake is not happy --- it's failing cross-version upgrade tests

Re: Online enabling of checksums

2018-04-05 Thread Andres Freund
On April 5, 2018 1:20:52 PM PDT, Magnus Hagander wrote: >On Thu, Apr 5, 2018 at 10:14 PM, Andres Freund >wrote: > >And even worse, without even announcing an intent to commit and giving >> people a chance to object. >> > >At least this patch was posted

Re: WIP: a way forward on bootstrap data

2018-04-05 Thread John Naylor
On 4/6/18, Tom Lane wrote: > I experimented with converting all frontend code to include just the > catalog/pg_foo_d.h files instead of catalog/pg_foo.h, as per the > proposed new policy. I soon found that we'd overlooked one thing: > some clients expect to see the relation

Re: Online enabling of checksums

2018-04-05 Thread Magnus Hagander
On Thu, Apr 5, 2018 at 11:23 PM, Andres Freund wrote: > Hi, > > On 2018-04-05 22:06:36 +0200, Magnus Hagander wrote: > > I have now pushed this latest version with some minor text adjustments > and > > a catversion bump. > > Is there any sort of locking that guarantees that

Re: WIP: a way forward on bootstrap data

2018-04-05 Thread Tom Lane
John Naylor writes: > Looking at convert_oid2name.patch again, I see this: > + elsif ($catname eq 'pg_am') > + { > + $values{aggfnoid} = > lookup_procname($values{aggfnoid}); > + } >

Re: Parallel Aggregates for string_agg and array_agg

2018-04-05 Thread David Rowley
Thanks for your input on all this. It's good to some words from people using the software rather than just writing it. On 6 April 2018 at 07:10, Tels wrote: > PS: We use string_agg() in a case where we first agg each row, then > string_agg() all rows, and the

Checkpoint not retrying failed fsync?

2018-04-05 Thread Andrew Gierth
This is only a preliminary report, I'm still trying to analyze what's going on, but: In doing testing on FreeBSD with a filesystem set up to induce errors controllably (using gconcat+gnop), I can get this to happen (on 11devel): (note that "mytable" is on a tablespace on the erroring filesystem,

Re: Online enabling of checksums

2018-04-05 Thread Magnus Hagander
On Thu, Apr 5, 2018 at 7:30 PM, Magnus Hagander wrote: > On Thu, Apr 5, 2018 at 5:08 PM, Andrey Borodin > wrote: > >> >> >> > 5 апр. 2018 г., в 19:58, Magnus Hagander >> написал(а): >> > >> > >> > >> > On Thu, Apr 5, 2018 at 4:55

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

2018-04-05 Thread Daniel Gustafsson
> On 05 Apr 2018, at 23:16, Peter Eisentraut > wrote: > > The documentation change suggests the error will be > > ERROR: canceling statement due to user request: "Cancellation message text" > > Why the quotes? It seemed like a good idea at the time to

Re: Fix for pg_stat_activity putting client hostaddr into appname field

2018-04-05 Thread Edmund Horner
On 29 March 2018 at 20:46, Michael Paquier wrote: > On Tue, Mar 27, 2018 at 03:47:07PM +1300, Edmund Horner wrote: >> But the stats array includes auxiliary processes, which means it has >> NumBackendStatSlots items. The pointers for the aux process strings >> are out of

Re: Online enabling of checksums

2018-04-05 Thread Andres Freund
On 2018-04-05 22:06:36 +0200, Magnus Hagander wrote: > I have now pushed this latest version with some minor text adjustments and > a catversion bump. > > Thanks for all the reviews! I want to be on the record that I think merging a nontrival feature that got submitted 2018-02-21, just before

Re: Removing useless DISTINCT clauses

2018-04-05 Thread David Rowley
On 6 April 2018 at 03:36, Melanie Plageman wrote: > The updated patch looks good to me. > I've changed the status to "ready for committer" Great. Thanks for reviewing this! -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7

Re: pgsql: New files for MERGE

2018-04-05 Thread Bruce Momjian
On Thu, Apr 5, 2018 at 11:15:20AM +0100, Simon Riggs wrote: > On 4 April 2018 at 21:28, Simon Riggs wrote: > > On 4 April 2018 at 21:14, Andres Freund wrote: > > > >>> The normal way is to make review comments that allow change. Your > >>> request for

Re: Online enabling of checksums

2018-04-05 Thread Magnus Hagander
On Thu, Apr 5, 2018 at 10:14 PM, Andres Freund wrote: > On 2018-04-05 13:12:08 -0700, Andres Freund wrote: > > On 2018-04-05 22:06:36 +0200, Magnus Hagander wrote: > > > I have now pushed this latest version with some minor text adjustments > and > > > a catversion bump. > >

Re: Online enabling of checksums

2018-04-05 Thread Magnus Hagander
On Thu, Apr 5, 2018 at 11:09 PM, Peter Geoghegan wrote: > On Thu, Apr 5, 2018 at 1:27 PM, Andres Freund wrote: > >>At least this patch was posted on the lists before commit, unlike many > >>others from many different people. And AFAIK there has never been such

Re: Online enabling of checksums

2018-04-05 Thread Peter Geoghegan
On Thu, Apr 5, 2018 at 1:51 PM, Joshua D. Drake wrote: > Perhaps I am missing something but there has been a lot of public discussion > on this feature for the last 7 weeks of which you barely participated. I > certainly understand wanting some notice before commit but

Re: Online enabling of checksums

2018-04-05 Thread Tom Lane
Magnus Hagander writes: > I have now pushed this latest version with some minor text adjustments and > a catversion bump. crake is not happy --- it's failing cross-version upgrade tests because: Performing Consistency Checks - Checking cluster

Re: [HACKERS] GUC for cleanup indexes threshold.

2018-04-05 Thread Masahiko Sawada
On Thu, Apr 5, 2018 at 7:23 PM, Teodor Sigaev wrote: > Thanks to everyone, fixes are pushed except nodeMerge.c, I don't wish to > increase entropy around MERGE patch :) > Thank you! Regards, -- Masahiko Sawada NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source

Re: csv format for psql

2018-04-05 Thread Jonathan S. Katz
> On Apr 5, 2018, at 11:08 PM, Peter Eisentraut > wrote: > > On 4/1/18 03:27, Pavel Stehule wrote: >> I don't share option so CSV format should be exactly same like CSV COPY. >> COPY is designed for backups - and header is not too important there. >> When I

Re: [HACKERS] MERGE SQL Statement for PG11

2018-04-05 Thread Pavan Deolasee
On Fri, Apr 6, 2018 at 1:30 AM, Andres Freund wrote: > > > My impression is that this simply shouldn't be going through > nodeModifyTuple, but be it's own nodeMerge node. The trigger handling > would need to be abstraced into execTrigger.c or such to avoid > duplication.

Re: Checkpoint not retrying failed fsync?

2018-04-05 Thread Thomas Munro
On Fri, Apr 6, 2018 at 11:36 AM, Thomas Munro wrote: > On Fri, Apr 6, 2018 at 11:34 AM, Andrew Gierth > wrote: >> Right. >> >> But I don't think just copying the value is sufficient; if a new bit was >> set while we were processing the

Re: [HACKERS] Runtime Partition Pruning

2018-04-05 Thread Amit Langote
Hi David. On 2018/04/05 22:41, David Rowley wrote: >> * make_partition_pruneinfo has a parameter resultRelations that's not used >> anywhere > > It gets used in 0005. > > I guess I could only add it in 0005, but make_partition_pruneinfo is > only used in 0003, so you could say the same about

Re: pgsql: New files for MERGE

2018-04-05 Thread Michael Paquier
On Thu, Apr 05, 2018 at 04:02:20PM -0400, Bruce Momjian wrote: > Simon, you have three committers in this thread suggesting this patch be > reverted. Are you just going to barrel ahead with the fixes without > addressing their emails? If my opinion counts, please count me in this bucket as well.

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

2018-04-05 Thread Thomas Munro
On Fri, Apr 6, 2018 at 1:27 PM, Craig Ringer wrote: > On 6 April 2018 at 07:37, Andrew Gierth wrote: >> Note: as I've brought up in another thread, it turns out that PG is not >> handling fsync errors correctly even when the OS _does_ do the

Re: csv format for psql

2018-04-05 Thread Peter Eisentraut
On 4/1/18 03:27, Pavel Stehule wrote: > I don't share option so CSV format should be exactly same like CSV COPY. > COPY is designed for backups - and header is not too important there. > When I seen some csv, then there usually header was used. I think in practice a lot of people use COPY also

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

2018-04-05 Thread Craig Ringer
On 6 April 2018 at 10:53, Thomas Munro wrote: > On Fri, Apr 6, 2018 at 1:27 PM, Craig Ringer > wrote: > > On 6 April 2018 at 07:37, Andrew Gierth > wrote: > >> Note: as I've brought up in another thread, it

Re: WIP: a way forward on bootstrap data

2018-04-05 Thread Tom Lane
Just had another thought about this business: if practical, we should remove the distinction between "descr" and "shdescr" and just use the former name in .dat files. genbki.pl knows which catalogs are shared, so it ought to be able to figure out where to route the descriptions.

Re: WIP: a way forward on bootstrap data

2018-04-05 Thread John Naylor
On 4/6/18, Tom Lane wrote: > BTW, I experimented with adding blank lines between the hash items in the > .dat files, and that seemed to make a nice improvement in readability, > converting masses of rather gray text into visibly distinct stanzas. > I'm not dead set on that,

Re: WIP: Covering + unique indexes.

2018-04-05 Thread Peter Geoghegan
On Thu, Apr 5, 2018 at 7:59 AM, Alexander Korotkov wrote: >> * btree_xlog_split() still has this code: > Right, I think there is absolutely no need in this code. It's removed in > the attached patchset. I'm now a bit nervous about always logging the high key, since

Re: WIP: a way forward on bootstrap data

2018-04-05 Thread John Naylor
On 4/6/18, Tom Lane wrote: > Just had another thought about this business: if practical, we should > remove the distinction between "descr" and "shdescr" and just use the > former name in .dat files. genbki.pl knows which catalogs are shared, > so it ought to be able to

Re: Online enabling of checksums

2018-04-05 Thread Daniel Gustafsson
> On 05 Apr 2018, at 23:13, Magnus Hagander wrote: > (And yes, we've noticed it's failing in isolationtester on a number of boxes > -- Daniel is currently investigating) Looking into the isolationtester failure on piculet, which builds using --disable-atomics, and locust

Re: [HACKERS] path toward faster partition pruning

2018-04-05 Thread Amit Langote
Hi. On 2018/04/06 7:35, Alvaro Herrera wrote: > I seems pretty clear that putting get_matching_partitions() in > catalog/partition.c is totally the wrong thing; it belongs wholly in > partprune. I think the reason you put it there is that it requires > access to a lot of internals that are static

Re: using index or check in ALTER TABLE SET NOT NULL

2018-04-05 Thread Peter Eisentraut
On 11/29/17 10:52, Sergei Kornilov wrote: > My target problem of adding NOT NULL to big relation without long downtime > can be done with ADD CONSTRAINT NOT VALID, VALIDATE it in second transaction, > then SET NOT NULL by my patch and drop unneeded constraint. It seems to me that this is a

Re: PATCH: Configurable file mode mask

2018-04-05 Thread Michael Paquier
On Thu, Apr 05, 2018 at 12:08:15PM -0400, David Steele wrote: > On 4/5/18 2:55 AM, Michael Paquier wrote: >> On Wed, Apr 04, 2018 at 08:03:54PM -0400, David Steele wrote: >> >>> Instead I have created variables in file_perm.c >>> that hold the current file create mode, dir create mode, and mode

Re: Fix for pg_stat_activity putting client hostaddr into appname field

2018-04-05 Thread Michael Paquier
On Fri, Apr 06, 2018 at 10:46:27AM +1200, Edmund Horner wrote: > Thanks for making a note of it, Michael. I guess it should be > considered for the next patch release of v10 too? The issue is tracked on the wiki, so at least we are sure that we won't lose sight of it :) After that, the timing a

Re: BUG #14941: Vacuum crashes

2018-04-05 Thread Michael Paquier
On Fri, Apr 06, 2018 at 06:41:14AM +0900, Michael Paquier wrote: > That would be wiser. We are two days away from the end of the CF and > this patch gets quite invasive with a set of new concepts, so my > recommendation would be to do so. There has been already much done with > the introduction

Re: PATCH: psql tab completion for SELECT

2018-04-05 Thread Edmund Horner
On 6 April 2018 at 13:29, Peter Eisentraut wrote: > I looked at this a bit now. I think it still needs some work. Hi Peter, thanks for the feedback. > Some of the queries for older versions contain syntax errors that causes > them not to work. > > For example,

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-04-05 Thread Amit Kapila
On Fri, Apr 6, 2018 at 1:13 AM, Andres Freund wrote: > On 2018-04-05 10:17:59 +0530, Amit Kapila wrote: >> On Thu, Apr 5, 2018 at 7:14 AM, Andres Freund wrote: >> Why? tid is both an input and output parameter. The input tid is >> valid and is verified

Re: [HACKERS] Runtime Partition Pruning

2018-04-05 Thread Amit Langote
Hi David, On 2018/04/06 12:27, David Rowley wrote: > (sending my reply in parts for concurrency) > > On 6 April 2018 at 14:39, Amit Langote wrote: >> I think we can save some space here by not having the pointers stored >> here. Instead of passing the pointer

Re: Excessive PostmasterIsAlive calls slow down WAL redo

2018-04-05 Thread Michael Paquier
On Thu, Apr 05, 2018 at 02:39:27PM -0400, Tom Lane wrote: > While it's not POSIX, at least some platforms are capable of delivering > a separate signal on parent process death. Perhaps using that where > available would be enough of an answer. Are you referring to prctl here? +1 on improving

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

2018-04-05 Thread Craig Ringer
On 6 April 2018 at 07:37, Andrew Gierth wrote: > Note: as I've brought up in another thread, it turns out that PG is not > handling fsync errors correctly even when the OS _does_ do the right > thing (discovered by testing on FreeBSD). Yikes. For other readers, the

Re: chained transactions

2018-04-05 Thread Peter Eisentraut
On 4/5/18 04:35, Heikki Linnakangas wrote: > With this patch, this stops working: > > set transaction_isolation='default'; But why is this supposed to work? This form is not documented anywhere. You can use RESET or SET TO DEFAULT. I suspect this is some artifact in the implementation that

Re: csv format for psql

2018-04-05 Thread Pavel Stehule
2018-04-06 5:46 GMT+02:00 Jonathan S. Katz : > > > On Apr 5, 2018, at 11:08 PM, Peter Eisentraut < > peter.eisentr...@2ndquadrant.com> wrote: > > > > On 4/1/18 03:27, Pavel Stehule wrote: > >> I don't share option so CSV format should be exactly same like CSV COPY. > >> COPY

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-04-05 Thread Amit Kapila
On Thu, Apr 5, 2018 at 10:40 AM, David G. Johnston wrote: > On Wednesday, April 4, 2018, Amit Kapila wrote: >> >> On Thu, Apr 5, 2018 at 7:14 AM, Andres Freund wrote: >> > >> >> > Questions: >> > >> > - I'm not perfectly

Re: [HACKERS] Add support for tuple routing to foreign partitions

2018-04-05 Thread Amit Langote
Fuiita-san, On 2018/04/05 15:56, Etsuro Fujita wrote: > (2018/04/05 15:37), Amit Langote wrote: >> I noticed that the 2nd patch (foreign-routing-fdwapi-5.patch) fails to >> apply to copy.c: > > I forgot to mention this: the second patch is created on top of the first > patch

Re: pgsql: New files for MERGE

2018-04-05 Thread Simon Riggs
On 4 April 2018 at 21:28, Simon Riggs wrote: > On 4 April 2018 at 21:14, Andres Freund wrote: > >>> The normal way is to make review comments that allow change. Your >>> request for change of the parser data structures is fine and can be >>> done,

Re: Add support for printing/reading MergeAction nodes

2018-04-05 Thread Pavan Deolasee
On Wed, Apr 4, 2018 at 11:21 PM, Tom Lane wrote: > Simon Riggs writes: > > On 4 April 2018 at 17:19, Tom Lane wrote: > >> If the MERGE patch has broken this, I'm going to push back on that > >> and push back on it hard, because it

Re: [PATCH] btree_gin, add support for uuid, bool, name, bpchar and anyrange types

2018-04-05 Thread Teodor Sigaev
somehow you missed some parts in 0001 patch, at least regression tests fail: CREATE EXTENSION btree_gin; + ERROR: could not find function "gin_extract_value_uuid" in file "/usr/local/pgsql/lib/btree_gin.so" Matheus de Oliveira wrote: Hi all. On Wed, Mar 21, 2018 at 1:47 PM, Tomas Vondra

Re: [HACKERS] Add support for tuple routing to foreign partitions

2018-04-05 Thread Etsuro Fujita
(2018/04/05 16:31), Amit Langote wrote: Might be a good idea to attach the bug-fix patch here as well, and perhaps add numbers to the file names like: 0001_postgres-fdw-refactoring-5.patch 0002_BUGFIX-copy-from-check-constraint-fix.patch 0003_foreign-routing-fdwapi-5.patch OK Just one minor

Re: Add support for printing/reading MergeAction nodes

2018-04-05 Thread Simon Riggs
On 5 April 2018 at 11:31, Pavan Deolasee wrote: > Attached patch refactors the grammar/parser side per your comments. We no > longer use InsertStmt/UpdateStmt/DeleteStmt/SelectStmt as part of > MergeAction. Instead we only collect the necessary information for running >

Re: [HACKERS] MERGE SQL Statement for PG11

2018-04-05 Thread Jesper Pedersen
Hi Simon and Paven, On 04/04/2018 08:46 AM, Jesper Pedersen wrote: On 03/30/2018 07:10 AM, Simon Riggs wrote: No problems found, but moving proposed commit to 2 April pm There is a warning for this, as attached. Updated version due to latest refactoring. Best regards,  Jesper diff

Re: [HACKERS] Add support for tuple routing to foreign partitions

2018-04-05 Thread Amit Langote
On 2018/04/05 16:31, Amit Langote wrote: > Fuiita-san, Oops, sorry about misspelling your name here, Fujita-san. - Amit

Re: [HACKERS] MERGE SQL Statement for PG11

2018-04-05 Thread Jesper Pedersen
Hi, On 04/05/2018 07:48 AM, Simon Riggs wrote: Updated version due to latest refactoring. Thanks for your input. Removing that seems to prevent compilation. Did something change in between? Updated for non-assert build. Best regards, Jesper diff --git a/src/backend/executor/execMerge.c

Re: Online enabling of checksums

2018-04-05 Thread Tomas Vondra
On 4/5/18 11:07 AM, Magnus Hagander wrote: > > > On Wed, Apr 4, 2018 at 12:11 AM, Tomas Vondra > > wrote: > > ... > > It however still fails to initialize the attempts field after allocating > the db entry in

Re: Online enabling of checksums

2018-04-05 Thread Magnus Hagander
On Wed, Apr 4, 2018 at 12:11 AM, Tomas Vondra wrote: > On 04/03/2018 02:05 PM, Magnus Hagander wrote: > > On Sun, Apr 1, 2018 at 2:04 PM, Magnus Hagander > > wrote: > > > > On Sat, Mar 31, 2018 at 5:38 PM, Tomas

Re: pgsql: New files for MERGE

2018-04-05 Thread Robert Haas
On Wed, Apr 4, 2018 at 3:09 PM, Tom Lane wrote: > Well, what's on the table is reverting this patch and asking you to try > again in the v12 cycle. Given Andres' concerns about the executor design, > and mine about the way the parsing end is built, there's certainly no way >

Re: pgsql: Validate page level checksums in base backups

2018-04-05 Thread Magnus Hagander
On Wed, Apr 4, 2018 at 8:22 PM, Michael Banck wrote: > Hi, > > On Wed, Apr 04, 2018 at 07:25:11PM +0200, Magnus Hagander wrote: > > On Wed, Apr 4, 2018 at 3:47 PM, Alvaro Herrera > > wrote: > > > Michael Banck wrote: > > > > > > > However, the

Re: [HACKERS] MERGE SQL Statement for PG11

2018-04-05 Thread Simon Riggs
On 5 April 2018 at 12:38, Jesper Pedersen wrote: > Hi Simon and Paven, > > On 04/04/2018 08:46 AM, Jesper Pedersen wrote: >> >> On 03/30/2018 07:10 AM, Simon Riggs wrote: >>> >>> No problems found, but moving proposed commit to 2 April pm >>> >> >> There is a warning

Re: [HACKERS] MERGE SQL Statement for PG11

2018-04-05 Thread Pavan Deolasee
On Thu, Apr 5, 2018 at 5:08 PM, Jesper Pedersen wrote: > Hi Simon and Paven, > > On 04/04/2018 08:46 AM, Jesper Pedersen wrote: > >> On 03/30/2018 07:10 AM, Simon Riggs wrote: >> >>> No problems found, but moving proposed commit to 2 April pm >>> >>> >> There is a

Re: [HACKERS] GUC for cleanup indexes threshold.

2018-04-05 Thread Kyotaro HORIGUCHI
Hello. The commit leaves three warnings for -Wunused-but-set-variable. Two of them are not assertion-only but really not used at all. I also found that nodeMerge.c has one such variable. regards. At Thu, 5 Apr 2018 15:43:55 +0900, Masahiko Sawada wrote in

Get the name of the target Relation from Query struct?

2018-04-05 Thread Ernst-Georg Schmid
Hello, I want to get the target Relation name for a UPDATE / INSERT / DELETE in a planner_hook. Do I understand struct Query correctly that: Query->resultRelation will be the index into Query->rtable to give me the target Relation? And if yes, what would rtable give me as list entry? An OID

Re: [HACKERS] MERGE SQL Statement for PG11

2018-04-05 Thread Simon Riggs
On 5 April 2018 at 12:56, Jesper Pedersen wrote: > Hi, > > On 04/05/2018 07:48 AM, Simon Riggs wrote: >>> >>> Updated version due to latest refactoring. >> >> >> Thanks for your input. Removing that seems to prevent compilation. >> >> Did something change in between?

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

2018-04-05 Thread Craig Ringer
Summary to date: It's worse than I thought originally, because: - Most widely deployed kernels have cases where they don't tell you about losing your writes at all; and - Information about loss of writes can be masked by closing and re-opening a file So the checkpointer cannot trust that a

Re: CALL optional in PL/pgSQL

2018-04-05 Thread Heikki Linnakangas
On 27/03/18 03:00, Andrew Dunstan wrote: On Fri, Mar 2, 2018 at 2:01 AM, Tom Lane wrote: I think this is an actively bad idea. It introduces an inherent ambiguity into the grammar; for instance PERFORM (2); now has two valid interpretations. The only way to

Re: [HACKERS] MERGE SQL Statement for PG11

2018-04-05 Thread Simon Riggs
On 5 April 2018 at 07:01, Pavan Deolasee wrote: >> +/* >> + * Given OID of the partition leaf, return the index of the leaf in the >> + * partition hierarchy. >> + */ >> +int >> +ExecFindPartitionByOid(PartitionTupleRouting *proute, Oid partoid) >> +{ >> + int i; >> +

Re: chained transactions

2018-04-05 Thread Heikki Linnakangas
On 15/03/18 18:39, Alvaro Herrera wrote: From 517bc6d9fefdee9135857d9562f644f2984ace32 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 18 Feb 2018 09:33:53 -0500 Subject: [PATCH v1 6/8] Turn transaction_isolation into GUC enum XXX no idea why it was done the way it

Re: [HACKERS] Add support for tuple routing to foreign partitions

2018-04-05 Thread Etsuro Fujita
(2018/04/04 19:31), Etsuro Fujita wrote: Attached is an updated version of the patch set: * As before, patch foreign-routing-fdwapi-4.patch is created on top of patch postgres-fdw-refactoring-4.patch and the bug-fix patch [1]. I did a bit of cleanup and comment-rewording to patch

Shared PostgreSQL libraries and symbol versioning

2018-04-05 Thread Pavel Raiskup
Hello, for the support of multiple versions of PostgreSQL RPM packages on one system, we are thinking about having only one libpq.so.5 (libecpg.so.6, libpgtype.so.3 respectively) supported and about building (linking) all the PostgreSQL package versions against that. The pattern would mean that

Excessive PostmasterIsAlive calls slow down WAL redo

2018-04-05 Thread Heikki Linnakangas
I started looking at the "Improve compactify_tuples and PageRepairFragmentation" patch, and set up a little performance test of WAL replay. I ran pgbench, scale 5, to generate about 1 GB of WAL, and timed how long it takes to replay that WAL. To focus purely on CPU overhead, I kept the data

Re: [HACKERS] path toward faster partition pruning

2018-04-05 Thread Amit Langote
Hi. On 2018/04/05 0:45, Jesper Pedersen wrote: > Hi, > > On 04/04/2018 09:29 AM, David Rowley wrote: >> Thanks for updating. I've made a pass over v49 and I didn't find very >> much wrong with it. >> >> The only real bug I found was a missing IsA(rinfo->clause, Const) in >> the pseudoconstant

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

2018-04-05 Thread Craig Ringer
On 5 April 2018 at 15:09, Craig Ringer wrote: > Also, it's been reported to me off-list that anyone on the system calling > sync(2) or the sync shell command will also generally consume the write > error, causing us not to see it when we fsync(). The same is true > for

Re: BUG #15112: Unable to run pg_upgrade with earthdistance extension

2018-04-05 Thread Noah Misch
On Mon, Apr 02, 2018 at 04:24:02PM -0400, Bruce Momjian wrote: > > I am not sure we can fix this without requiring people to drop and > > recreate such indexes. However, I am even at a loss in how to fix the > > CREATE FUNCTION to reference a cast in the same schema as the function, > > in this

Re: Postgres stucks in deadlock detection

2018-04-05 Thread Konstantin Knizhnik
Hi, Thank for your feedback. On 04.04.2018 21:15, Andres Freund wrote: Hi, On 2018-04-04 11:54:14 +0300, Konstantin Knizhnik wrote: Several times we and our customers are suffered from the problem that Postgres got stuck in deadlock detection. One scenario is YCSB workload with Zipf's

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

2018-04-05 Thread Tomas Vondra
On 4/5/18 8:50 AM, Nikhil Sontakke wrote: > Hi Tomas, > >> 1) There's a race condition in LogicalLockTransaction. The code does >> roughly this: >> >> if (!BecomeDecodeGroupMember(...)) >> ... bail out ... >> >> Assert(MyProc->decodeGroupLeader); >> lwlock =

Re: [HACKERS] Add support for tuple routing to foreign partitions

2018-04-05 Thread Amit Langote
Fujita-san, On 2018/04/05 15:02, Etsuro Fujita wrote: > (2018/04/04 19:31), Etsuro Fujita wrote: >> Attached is an updated version of the patch set: >> * As before, patch foreign-routing-fdwapi-4.patch is created on top of >> patch postgres-fdw-refactoring-4.patch and the bug-fix patch [1]. > >

  1   2   >