Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-07-26 Thread David Rowley
On 27 July 2018 at 04:19, David Rowley wrote: > I've attached a delta of the changes I made since your v2 delta and > also a complete updated patch. I did a very quick performance test of this patch on an AWS m5d.large instance with fsync=off. The test setup is the same as is described in my

Re: Upper limit arguments of pg_logical_slot_xxx_changes functions accept invalid values

2018-07-26 Thread Masahiko Sawada
Thank you for comment! On Fri, Jul 27, 2018 at 7:27 AM, Michael Paquier wrote: > On Thu, Jul 12, 2018 at 09:58:16AM +0900, Masahiko Sawada wrote: >> If upto_lsn is non-NULL, decoding will include only those >> transactions which commit prior to the specified LSN. If upto_nchanges >> is

Re: pgbench - very minor bug fix on hash() missing argument

2018-07-26 Thread Michael Paquier
On Thu, Jul 26, 2018 at 11:16:06PM -0400, Fabien COELHO wrote: > Could be backpatched to 11 where hash was introduced. Thanks, committed and back-patched. I have added some tests for least() and greatest() on the way. -- Michael signature.asc Description: PGP signature

Re: negative bitmapset member not allowed Error with partition pruning

2018-07-26 Thread David Rowley
On 27 July 2018 at 15:14, Tom Lane wrote: > David Rowley writes: >> On 27 July 2018 at 13:35, Amit Langote wrote: >>> On 2018/07/27 1:28, Tom Lane wrote: (BTW, I'm not sure that it was wise to design bms_add_range to fail for empty ranges. Maybe it'd be better to redefine it as a

Re: negative bitmapset member not allowed Error with partition pruning

2018-07-26 Thread Amit Langote
On 2018/07/27 12:14, Tom Lane wrote: > David Rowley writes: >> On 27 July 2018 at 13:35, Amit Langote wrote: >>> On 2018/07/27 1:28, Tom Lane wrote: (BTW, I'm not sure that it was wise to design bms_add_range to fail for empty ranges. Maybe it'd be better to redefine it as a no-op for

Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack

2018-07-26 Thread Michael Paquier
On Fri, Jul 27, 2018 at 12:37:02PM +0900, Kyotaro HORIGUCHI wrote: > I intended the same as Bossart said. It is not reasonable that > VACUUM and VACUUM FULL behaves differently on rejection for the > same reason. The objective of the first (or early) check is > rejecting (non-superuser's)

Re: Deprecating, and scheduling removal of, pg_dump's tar format.

2018-07-26 Thread Tom Lane
Andres Freund writes: > Is there any real reason to retain it? As I recall, the principal argument for having it to begin with was that it's a "non proprietary" format that could be read without any PG-specific tools. Perhaps the directory format could be said to serve that purpose too, but if

Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack

2018-07-26 Thread Kyotaro HORIGUCHI
Hello. At Fri, 27 Jul 2018 11:31:23 +0900, Michael Paquier wrote in <20180727023123.ge1...@paquier.xyz> > On Thu, Jul 26, 2018 at 11:14:31PM +, Bossart, Nathan wrote: > > On 7/26/18, 3:42 PM, "Michael Paquier" wrote: > > Minus a possible documentation update, 0003 seems almost ready, too.

Re: Deprecating, and scheduling removal of, pg_dump's tar format.

2018-07-26 Thread Andres Freund
On July 26, 2018 8:14:57 PM PDT, Christophe Pettus wrote: > >> On Jul 26, 2018, at 20:09, Stephen Frost wrote: >> >> Do you, perhaps, have any insight into why those users are currently >> using the .tar format? > >Inertia, in most cases; some of those procedures have been around since >8.1

pgbench - very minor bug fix on hash() missing argument

2018-07-26 Thread Fabien COELHO
While doing something else, I noticed that pgbench's hash() does not fail gracefully: sh> cat hash.sql \set i hash() sh> pgbench -f hash.sql -t 1 ... cannot coerce (null) to int client 0 aborted in command 0 (set) of script 0; evaluation of meta-command failed The message is not very

Re: Deprecating, and scheduling removal of, pg_dump's tar format.

2018-07-26 Thread Christophe Pettus
> On Jul 26, 2018, at 20:09, Stephen Frost wrote: > > Do you, perhaps, have any insight into why those users are currently > using the .tar format? Inertia, in most cases; some of those procedures have been around since 8.1 days. Custom format (or a tar'd parallel dump) would be an

Re: negative bitmapset member not allowed Error with partition pruning

2018-07-26 Thread Tom Lane
David Rowley writes: > On 27 July 2018 at 13:35, Amit Langote wrote: >> On 2018/07/27 1:28, Tom Lane wrote: >>> (BTW, I'm not sure that it was wise to design bms_add_range to fail for >>> empty ranges. Maybe it'd be better to redefine it as a no-op for >>> upper < lower?) >> FWIW, I was

Re: Deprecating, and scheduling removal of, pg_dump's tar format.

2018-07-26 Thread Stephen Frost
Greetings, * Christophe Pettus (x...@thebuild.com) wrote: > > On Jul 26, 2018, at 19:35, Peter Geoghegan wrote: > > > > Why, specifically, would it make them unhappy? > > Forensic and archive backups in .tar format (which I know of users doing) > would require a two-step restore process on

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

2018-07-26 Thread Nico Williams
On Thu, Jul 26, 2018 at 04:42:24PM -0400, Tom Lane wrote: > It's barely possible that we could get current and new contributors to > sign some kind of CLA containing anti-patent terms, but I don't think > there's any hope of amending the distribution license. Leaving aside whether you could

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

2018-07-26 Thread Stephen Frost
Greetings, * Andres Freund (and...@anarazel.de) wrote: > On 2018-07-26 16:42:24 -0400, Tom Lane wrote: > > Andres Freund writes: > > > On 2018-07-26 09:51:54 -0400, Tom Lane wrote: > > >> There's been an awful lot of discussion in this thread that supposes that > > >> we can change the Postgres

Re: Deprecating, and scheduling removal of, pg_dump's tar format.

2018-07-26 Thread Joshua D. Drake
On 07/26/2018 07:41 PM, Christophe Pettus wrote: On Jul 26, 2018, at 19:35, Peter Geoghegan wrote: Why, specifically, would it make them unhappy? Forensic and archive backups in .tar format (which I know of users doing) would require a two-step restore process on newer versions. I am a +1

Re: Early WIP/PoC for inlining CTEs

2018-07-26 Thread Thomas Munro
On Thu, Jul 26, 2018 at 7:14 AM, David Fetter wrote: > Please find attached the next version, which passes 'make check'. ... but not 'make check-world' (contrib/postgres_fdw's EXPLAIN is different). -- Thomas Munro http://www.enterprisedb.com

Re: Deprecating, and scheduling removal of, pg_dump's tar format.

2018-07-26 Thread Michael Paquier
On Thu, Jul 26, 2018 at 07:35:56PM -0700, Peter Geoghegan wrote: > On Thu, Jul 26, 2018 at 7:33 PM, Michael Paquier wrote: >> The maintenance load is not high as well, so I see no real point in >> removing it, and that it would likely make people using it unhappy. > > Why, specifically, would it

Re: negative bitmapset member not allowed Error with partition pruning

2018-07-26 Thread David Rowley
On 27 July 2018 at 13:35, Amit Langote wrote: > On 2018/07/27 1:28, Tom Lane wrote: >> (BTW, I'm not sure that it was wise to design bms_add_range to fail for >> empty ranges. Maybe it'd be better to redefine it as a no-op for >> upper < lower?) > > FWIW, I was thankful that David those left

Re: Deprecating, and scheduling removal of, pg_dump's tar format.

2018-07-26 Thread Christophe Pettus
> On Jul 26, 2018, at 19:35, Peter Geoghegan wrote: > > Why, specifically, would it make them unhappy? Forensic and archive backups in .tar format (which I know of users doing) would require a two-step restore process on newer versions. -- -- Christophe Pettus x...@thebuild.com

Re: Deprecating, and scheduling removal of, pg_dump's tar format.

2018-07-26 Thread Andres Freund
On July 26, 2018 7:33:30 PM PDT, Michael Paquier wrote: >On Thu, Jul 26, 2018 at 06:53:06PM -0700, Andres Freund wrote: >> If we were to remove it, it'd obviously be a drawn out affair, given >> that we likely couldn't drop it from the restore side immediately... > >The maintenance load is not

Re: Deprecating, and scheduling removal of, pg_dump's tar format.

2018-07-26 Thread Peter Geoghegan
On Thu, Jul 26, 2018 at 7:33 PM, Michael Paquier wrote: > The maintenance load is not high as well, so I see no real point in > removing it, and that it would likely make people using it unhappy. Why, specifically, would it make them unhappy? -- Peter Geoghegan

Re: partition tree inspection functions

2018-07-26 Thread Amit Langote
Hi Jesper, Thanks for the quick feedback. On 2018/07/27 1:30, Jesper Pedersen wrote: > On 07/26/2018 04:47 AM, Amit Langote wrote: >> Further, I've added a pg_partition_level that returns the level of a >> partition in the partition tree wrt to the root of the *whole* partition >> tree.  But

Re: Deprecating, and scheduling removal of, pg_dump's tar format.

2018-07-26 Thread Michael Paquier
On Thu, Jul 26, 2018 at 06:53:06PM -0700, Andres Freund wrote: > If we were to remove it, it'd obviously be a drawn out affair, given > that we likely couldn't drop it from the restore side immediately... The maintenance load is not high as well, so I see no real point in removing it, and that it

Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack

2018-07-26 Thread Michael Paquier
On Thu, Jul 26, 2018 at 11:14:31PM +, Bossart, Nathan wrote: > On 7/26/18, 3:42 PM, "Michael Paquier" wrote: > Minus a possible documentation update, 0003 seems almost ready, too. The docs mentioned that shared catalogs are processed, so I did not bother, but visibly your comment is that we

Re: Making "COPY partitioned_table FROM" faster

2018-07-26 Thread David Rowley
On 27 July 2018 at 05:30, Melanie Plageman wrote: > On patched code line 2564, there is a missing parenthesis. It might be > better to remove the parentheses entirely and, while you're at it, there is > a missing comma. Thanks for noticing that. Fixed in the attached v4. That's the only change.

Re: pread() and pwrite()

2018-07-26 Thread Thomas Munro
On Fri, Jul 20, 2018 at 8:14 PM, Oskari Saarenmaa wrote: > On Thu, Jul 12, 2018 at 01:55:31PM +1200, Thomas Munro wrote: >> [...] I'm not even sure I'd bother adding "At" to the >> function names. If there are any extensions that want the old >> interface they will fail to compile either way.

Deprecating, and scheduling removal of, pg_dump's tar format.

2018-07-26 Thread Andres Freund
Hi, Is there any real reason to retain it? I realize it's not been a huge issue to maintain the format, but it has significantly fewer features than the other formats, without corresponding upsides (sql is clearer to read, directory format has parallelism, custom is a single file while allowing

Re: negative bitmapset member not allowed Error with partition pruning

2018-07-26 Thread Amit Langote
On 2018/07/27 1:28, Tom Lane wrote: > Rajkumar Raghuwanshi writes: >> I am getting "ERROR: negative bitmapset member not allowed" when >> enable_partition_pruning set to true with below test case. Thanks Rajkumar. > Confirmed here. It's failing in perform_pruning_combine_step, > which reaches

Re: pgbench: improve --help and --version parsing

2018-07-26 Thread Michael Paquier
On Thu, Jul 26, 2018 at 06:42:02PM -0400, Fabien COELHO wrote: > Ok, if you remove tests, it can be done in less tests, obviously. Well, if we can find a way to reduce the number of tests but not their coverage, that's always welcome. > ISTM that some minimal sanity on the output would be

Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack

2018-07-26 Thread Bossart, Nathan
On 7/26/18, 3:42 PM, "Michael Paquier" wrote: > Thanks for the lookup. 0003 is the most simple in the set by the way. Minus a possible documentation update, 0003 seems almost ready, too. For 0002, would adding vacuum_skip_rel() before and after try_relation_open() in vacuum_rel() be enough?

Re: pgbench: improve --help and --version parsing

2018-07-26 Thread Fabien COELHO
I do not understand what you mean by "reduce that to one single test". I cannot see how to test stdouts equalities and contents' sanity in one single test. I was wondering about reducing the number of tests to a strict minimum. At the end I think that I would just remove most of the tests

Re: pgbench: improve --help and --version parsing

2018-07-26 Thread Michael Paquier
On Thu, Jul 26, 2018 at 06:22:16PM -0400, Fabien COELHO wrote: > I do not understand what you mean by "reduce that to one single test". I > cannot see how to test stdouts equalities and contents' sanity in one single > test. I was wondering about reducing the number of tests to a strict minimum.

Re: Upper limit arguments of pg_logical_slot_xxx_changes functions accept invalid values

2018-07-26 Thread Michael Paquier
On Thu, Jul 12, 2018 at 09:58:16AM +0900, Masahiko Sawada wrote: > If upto_lsn is non-NULL, decoding will include only those > transactions which commit prior to the specified LSN. If upto_nchanges > is non-NULL, decoding will stop when the number of rows produced by > decoding exceeds the

Re: pgbench: improve --help and --version parsing

2018-07-26 Thread Fabien COELHO
Hello Michaël, Do you mean something like the attached? You basically have the idea, except that the number of tests in any TAP files calling program_help_ok and program_version_ok Indeed. I wanted to outline the perl module part, really. needs to be updated, and that the test is too

Re: Upper limit arguments of pg_logical_slot_xxx_changes functions accept invalid values

2018-07-26 Thread Brian Faherty
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:not tested The error messages are nice, and I think will be a helpful feature.

Re: [HACKERS] Getting rid of "accept incoming network connections" prompts on OS X

2018-07-26 Thread Tom Lane
[ blast-from-the-past department ] Peter Eisentraut writes: > On 10/25/14 2:52 PM, Tom Lane wrote: >> And a bit of experimentation later: it seems that on Yosemite (and >> probably earlier OS X versions), "localhost" maps to all three of these >> addresses: >> 127.0.0.1 >> ::1 >> fe80:1::1 >>

Re: Locking B-tree leafs immediately in exclusive mode

2018-07-26 Thread Simon Riggs
On 26 July 2018 at 20:59, Alexander Korotkov wrote: > Great, thank you! So, I think the regression is demystified. We can > now conclude that on our benchmarks this patch doesn't cause > performance regression larger than measurement error. But in some > cases it shows huge performance

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

2018-07-26 Thread Andres Freund
On 2018-07-26 16:42:24 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2018-07-26 09:51:54 -0400, Tom Lane wrote: > >> There's been an awful lot of discussion in this thread that supposes that > >> we can change the Postgres license. Let me just point out very clearly > >> that no such

Re: why doesn't pg_create_logical_replication_slot throw an error if the encoder doesn't exist

2018-07-26 Thread Andres Freund
Hi, On 2018-07-26 16:40:18 -0400, Dave Cramer wrote: > Since nothing else can be done we should throw an error early. I can't immediately think of a reason not to do that, but I personally don't care enough to write a patch... Greetings, Andres Freund

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

2018-07-26 Thread Tom Lane
Andres Freund writes: > On 2018-07-26 09:51:54 -0400, Tom Lane wrote: >> There's been an awful lot of discussion in this thread that supposes that >> we can change the Postgres license. Let me just point out very clearly >> that no such thing is going to happen. There will be no changes, no >>

Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack

2018-07-26 Thread Michael Paquier
On Thu, Jul 26, 2018 at 03:06:59PM +, Bossart, Nathan wrote: > I took a look at 0001. Thanks for the lookup. 0003 is the most simple in the set by the way. > On 7/26/18, 12:24 AM, "Michael Paquier" wrote: > - myrelid = RelationGetRelid(rel); > + myrelid =

why doesn't pg_create_logical_replication_slot throw an error if the encoder doesn't exist

2018-07-26 Thread Dave Cramer
Since nothing else can be done we should throw an error early. Dave Cramer

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

2018-07-26 Thread Andres Freund
On 2018-07-26 20:24:00 +0530, Nikhil Sontakke wrote: > Hi, > > >> I think we even can just do something like a global > >> TransactionId check_if_transaction_is_alive = InvalidTransactionId; > >> and just set it up during decoding. And then just check it whenever it's > >> not set tot

Re: Locking B-tree leafs immediately in exclusive mode

2018-07-26 Thread Alexander Korotkov
Hi! On Thu, Jul 26, 2018 at 1:31 PM Imai, Yoshikazu wrote: > On Wed, July 25, 2018 at 0:28 AM, Alexander Korotkov wrote:> > On Tue, Jul > 10, 2018 at 4:39 PM 今井 良一 wrote: > > I've reread the thread. And I found that in my initial letter [1] I > > forget to include index definition. > > CREATE

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

2018-07-26 Thread Andres Freund
On 2018-07-26 09:51:54 -0400, Tom Lane wrote: > Chris Travers writes: > > What about adding an extra line to the license that indicates that the > > copyright owners also give all patent licenses which are both in their > > power to grant and also needed for exercise of the copyright license and

Re: print_path is missing GatherMerge and CustomScan support

2018-07-26 Thread Robert Haas
On Thu, Jul 26, 2018 at 1:14 AM, Etsuro Fujita wrote: > because we currently don't consider gathering partial child-scan or > child-join paths. I think we might consider that in future, though. You generally want to put the Gather node as high up in the plan tree as possible. I think the only

Re: 11beta crash/assert caused by parameter type changes

2018-07-26 Thread Tom Lane
Andres Freund writes: > On 2018-07-26 14:06:16 -0400, Tom Lane wrote: >> I was about to add Andrew's example as a test case (also shown in >> attached), but realized that there's a problem: just as noted in >> the similar test for named-composite-type changes a bit above there, >> the failure

Re: 11beta crash/assert caused by parameter type changes

2018-07-26 Thread Andres Freund
Hi, On 2018-07-26 14:06:16 -0400, Tom Lane wrote: > I was about to add Andrew's example as a test case (also shown in > attached), but realized that there's a problem: just as noted in > the similar test for named-composite-type changes a bit above there, > the failure fails to fail in

Re: 11beta crash/assert caused by parameter type changes

2018-07-26 Thread Tom Lane
Robert Haas writes: > On Thu, Jul 26, 2018 at 2:06 PM, Tom Lane wrote: >> I was about to add Andrew's example as a test case (also shown in >> attached), but realized that there's a problem: just as noted in >> the similar test for named-composite-type changes a bit above there, >> the failure

Re: 11beta crash/assert caused by parameter type changes

2018-07-26 Thread Robert Haas
On Thu, Jul 26, 2018 at 2:06 PM, Tom Lane wrote: > I was about to add Andrew's example as a test case (also shown in > attached), but realized that there's a problem: just as noted in > the similar test for named-composite-type changes a bit above there, > the failure fails to fail in

Re: Enhancement request: enable FIRST/LAST_value() also as a regular aggregate (not only as windowing function)

2018-07-26 Thread Tom Lane
matshyeq writes: > Can I make custom aggregate function that accepts WITHIN GROUP syntax? It's possible, but it would have to be written in C, I think; see src/backend/utils/adt/orderedsetaggs.c for prototype code. You'll find it a lot easier to write a plain aggregate function and control its

Re: Enhancement request: enable FIRST/LAST_value() also as a regular aggregate (not only as windowing function)

2018-07-26 Thread matshyeq
Thanks Robert! I thought this could be nice functionality available out of the box but yea, sure, that would work for me. Can I make custom aggregate function that accepts WITHIN GROUP syntax? Which language would that need to be implemented in? Would you have examples (url?) Thank you, Kind

Re: 11beta crash/assert caused by parameter type changes

2018-07-26 Thread Tom Lane
Vik Fearing writes: > On 24/07/18 22:50, Andrew Gierth wrote: >> Haven't had time yet to poke at what's changed in detail. > git bisect lays the blame on 6719b238e8f0ea83c39d2b1728c7670cdaa34e06. Right. So the reason that this Assert is reachable now is that that commit made it possible to, as

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

2018-07-26 Thread Andrey Borodin
17 июля 2018 г., в 16:42, Nikita Glukhov написал(а): > > Fixed. Patch works as advertised, adds documentation and tests. I didn't succeeded in attempts to break it's functionality. I have no more notices about the code. Maybe except this const looks unusual, but is correct +extern BOX

Re: Online enabling of checksums

2018-07-26 Thread Andres Freund
On July 26, 2018 10:03:39 AM PDT, Robert Haas wrote: >On Tue, Jun 26, 2018 at 7:45 AM, Magnus Hagander >wrote: >> PFA an updated version of the patch for the next CF. We believe this >one >> takes care of all the things pointed out so far. >> >> For this version, we "implemented" the

Re: Making "COPY partitioned_table FROM" faster

2018-07-26 Thread Melanie Plageman
On Wed, Jul 25, 2018 at 7:24 PM, David Rowley wrote: On patched code line 2564, there is a missing parenthesis. It might be better to remove the parentheses entirely and, while you're at it, there is a missing comma. /* * For partitioned tables we can't support multi-inserts when there * are

Re: Online enabling of checksums

2018-07-26 Thread Robert Haas
On Tue, Jun 26, 2018 at 7:45 AM, Magnus Hagander wrote: > PFA an updated version of the patch for the next CF. We believe this one > takes care of all the things pointed out so far. > > For this version, we "implemented" the MegaExpensiveRareMemoryBarrier() by > simply requiring a restart of

Re: [HACKERS] [PATCH] Overestimated filter cost and its mitigation

2018-07-26 Thread Dean Rasheed
On 26 July 2018 at 07:12, Ashutosh Bapat wrote: > In the patch clauselist_selectivity() gets called repeatedly for every > new qual added to the clause list. Instead, if we try to combine the > cost/row estimation with order_qual_clauses() or > clauselist_selectivity(), we might be able to what

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-07-26 Thread Tom Lane
David Rowley writes: > 1) Got rid of PARTITION_ROUTING_MAXSIZE. The code using this was > useless since the int would have wrapped long before it reached > UINT_MAX. There's no shortage of other code doubling the size of an > array by multiplying it by 2 unconditionally without considering >

Re: Allow COPY's 'text' format to output a header

2018-07-26 Thread Cynthia Shang
> On Jul 25, 2018, at 6:09 PM, Simon Muller wrote: > > I've incorporated both your suggestions and included the patch you provided > in the attached patch. Hope it's as expected. > -- > Simon Muller > > Reviewed and retested. Changing status to Ready for Committer.

Re: partition tree inspection functions

2018-07-26 Thread Jesper Pedersen
Hi Amit, On 07/26/2018 04:47 AM, Amit Langote wrote: Alright, I have replaced pg_partition_tree_tables with pg_partition_children with an 'include_all' argument, as you suggested, but I implemented it as an optional argument. So, one would use that argument only if need to get *all*

Re: negative bitmapset member not allowed Error with partition pruning

2018-07-26 Thread Tom Lane
Rajkumar Raghuwanshi writes: > I am getting "ERROR: negative bitmapset member not allowed" when > enable_partition_pruning set to true with below test case. Confirmed here. It's failing in perform_pruning_combine_step, which reaches this: result->bound_offsets = bms_add_range(NULL, 0,

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-07-26 Thread David Rowley
On 18 July 2018 at 20:29, Amit Langote wrote: > Let me know what you think of the code in the updated patch. Thanks for sending the updated patch. I looked over it tonight and made a number of changes: 1) Got rid of PARTITION_ROUTING_MAXSIZE. The code using this was useless since the int would

Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack

2018-07-26 Thread Bossart, Nathan
On 7/26/18, 10:07 AM, "Bossart, Nathan" wrote: > The first time we use this callback, the relation won't be locked, so > isn't it possible that we won't get a valid tuple here? I did notice > that callbacks like RangeVarCallbackForRenameRule, > RangeVarCallbackForPolicy, and

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2018-07-26 Thread Dmitry Dolgov
> On Mon, 23 Jul 2018 at 10:38, Ashutosh Bapat > wrote: > > On Fri, Jul 20, 2018 at 3:13 AM, Dmitry Dolgov <9erthali...@gmail.com> wrote: > > > > It's of course wrong, it's going to be O(max(m, n)) as you said, but > > the point is still valid - if we have partitions A1, A2 from one side > > and

Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack

2018-07-26 Thread Bossart, Nathan
I took a look at 0001. On 7/26/18, 12:24 AM, "Michael Paquier" wrote: > 1) 0001 does the work for TRUNCATE, but using RangeVarGetRelidExtended > with a custom callback based on the existing truncate_check_rel(). I > had to split the session-level checks into a separate routine as no > Relation

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

2018-07-26 Thread Nikhil Sontakke
Hi, >> I think we even can just do something like a global >> TransactionId check_if_transaction_is_alive = InvalidTransactionId; >> and just set it up during decoding. And then just check it whenever it's >> not set tot InvalidTransactionId. >> >> > > Ok. I will work on something along these

Re: Early WIP/PoC for inlining CTEs

2018-07-26 Thread David Fetter
On Thu, Jul 26, 2018 at 02:51:53PM +0200, Andreas Karlsson wrote: > On 07/25/2018 06:08 PM, Andrew Gierth wrote: > >WITH ctename AS [[NOT] MATERIALIZED] (query) > > I think "NOT MATERIALIZED" would be a bit misleading since the > planner may choose to materialize anyway, so I suggest skipping

Re: 11beta crash/assert caused by parameter type changes

2018-07-26 Thread Tom Lane
Robert Haas writes: > On Tue, Jul 24, 2018 at 5:34 PM, Vik Fearing > wrote: >> git bisect lays the blame on 6719b238e8f0ea83c39d2b1728c7670cdaa34e06. > Sounds like an open item for Tom, then. Yeah, agreed, but I've not had time for it yet. regards, tom lane

Re: Enhancement request: enable FIRST/LAST_value() also as a regular aggregate (not only as windowing function)

2018-07-26 Thread Robert Haas
On Tue, Jul 24, 2018 at 4:16 PM, matshyeq wrote: > I'd like to throw here an enhancement proposal to discuss/consider. > The FIRST/LAST_value() > > functions offer powerful lookup capabilities, eg. >

Re: 11beta crash/assert caused by parameter type changes

2018-07-26 Thread Robert Haas
On Tue, Jul 24, 2018 at 5:34 PM, Vik Fearing wrote: > On 24/07/18 22:50, Andrew Gierth wrote: >> Haven't had time yet to poke at what's changed in detail. > > git bisect lays the blame on 6719b238e8f0ea83c39d2b1728c7670cdaa34e06. Sounds like an open item for Tom, then. -- Robert Haas

Re: Explain buffers wrong counter with parallel plans

2018-07-26 Thread Jonathan S. Katz
> On Jul 25, 2018, at 10:25 PM, Amit Kapila wrote: > > On Wed, Jul 25, 2018 at 7:42 PM, Jonathan S. Katz > wrote: >> >> On Jul 7, 2018, at 12:03 AM, Amit Kapila wrote: >> >> I tried running the below on both 11beta2 and HEAD with the patch >> applied: >> >> CREATE UNLOGGED TABLE t1 (c1

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

2018-07-26 Thread Tom Lane
Chris Travers writes: > What about adding an extra line to the license that indicates that the > copyright owners also give all patent licenses which are both in their > power to grant and also needed for exercise of the copyright license and > require that new code contributions use this license

Re: Early WIP/PoC for inlining CTEs

2018-07-26 Thread Andreas Karlsson
On 07/25/2018 06:08 PM, Andrew Gierth wrote: WITH ctename AS [[NOT] MATERIALIZED] (query) I think "NOT MATERIALIZED" would be a bit misleading since the planner may choose to materialize anyway, so I suggest skipping that part of the syntax unless there is a really strong reason for having

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

2018-07-26 Thread Etsuro Fujita
(2018/07/26 5:27), Robert Haas wrote: On Tue, Jul 24, 2018 at 7:51 AM, Etsuro Fujita wrote: Isn't that assumption fundamental to your whole approach? I don't think so. What I mean here is: currently the subplan would be a scan/join node, but in future we might have eg, a Sort node atop the

Online verification of checksums

2018-07-26 Thread Michael Banck
Hi, v10 almost added online activation of checksums, but all we've got is pg_verify_checksums, i.e. offline verification of checkums.  However, we also got (online) checksum verification during base backups, and I have ported/adapted David Steele's recheck code to my personal fork of

Re: Optimizer misses big in 10.4 with BRIN index

2018-07-26 Thread Tomas Vondra
On 07/26/2018 10:11 AM, Emre Hasegeli wrote: Isn't the 23040 just the totalpages * 10 per `return totalpages * 10;` in bringetbitmap()? Yes, it is just confusing. The correct value is on one level up of the tree. It is 204 + 4404 rows removed by index recheck = 4608, so the estimate is not

RE: Locking B-tree leafs immediately in exclusive mode

2018-07-26 Thread Imai, Yoshikazu
On Wed, July 25, 2018 at 0:30 AM, Alexander Korotkov wrote: > > Lefted tasks in my review is doing the regression tests. > > Cool, thank you for review! > I did "make check-world" in patched version and all tests were passed successfully! Yoshikazu Imai

RE: Locking B-tree leafs immediately in exclusive mode

2018-07-26 Thread Imai, Yoshikazu
Hi. On Wed, July 25, 2018 at 0:28 AM, Alexander Korotkov wrote: > Hi! > > On Tue, Jul 10, 2018 at 4:39 PM 今井 良一 wrote: > > On 2018/07/10 20:36, Alexander Korotkov wrote: > > > Thank you for the experiments! It seems that there is real regression > > > here... BTW, which script were you using

negative bitmapset member not allowed Error with partition pruning

2018-07-26 Thread Rajkumar Raghuwanshi
Hi, I am getting "ERROR: negative bitmapset member not allowed" when enable_partition_pruning set to true with below test case. [edb@localhost bin]$ ./psql postgres psql (12devel) Type "help" for help. postgres=# SET enable_partition_pruning TO on; SET postgres=# CREATE TABLE part (a INT, b

Re: [Proposal] Add accumulated statistics for wait event

2018-07-26 Thread Bertrand DROUVOT
Hello Guys, As you mentioned Oracle like active session history sampling in this thread, I just want to let you know that I am working on a brand new extension to provide this feature. You can find the extension here: https://github.com/pgsentinel/pgsentinel Basically, you could see it as

Re: Temporary tables prevent autovacuum, leading to XID wraparound

2018-07-26 Thread Kyotaro HORIGUCHI
Hello. At Wed, 18 Jul 2018 07:34:10 +, "Tsunakawa, Takayuki" wrote in <0A3221C70F24FB45833433255569204D1FA538FD@G01JPEXMBYT05> > From: Michael Paquier [mailto:mich...@paquier.xyz] > > + /* Does the backend own the temp schema? */ > > + if (proc->tempNamespaceId != namespaceID) > > +

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

2018-07-26 Thread Chris Travers
On Wed, Jul 4, 2018 at 2:28 AM Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > Hello, > > As I asked at the PGCon developer meeting this year, we'd like to offer > our company's patents and patentapplications license to the > PostgreSQL community free of charge. If I heard

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

2018-07-26 Thread Chris Travers
On Thu, Jul 26, 2018 at 9:33 AM Oleksandr Shulgin < oleksandr.shul...@zalando.de> wrote: > On Wed, Jul 25, 2018 at 8:35 PM Nico Williams > wrote: > >> >> What are you proposing anyways? That every commit come with a patent >> search? >> > > I would propose that everyone wasting their time and

Re: Log query parameters for terminated execute

2018-07-26 Thread Sergei Kornilov
Hello > Changed the status as per last email of Tom Lane. I have no idea what can i change. I received no feedback how i can print parameters in other cases. Should i mark CF as rejected? regards, Sergei

Re: Log query parameters for terminated execute

2018-07-26 Thread Ibrar Ahmed
Changed the status as per last email of Tom Lane.

Re: Optimizer misses big in 10.4 with BRIN index

2018-07-26 Thread Emre Hasegeli
> Isn't the 23040 just the totalpages * 10 per `return totalpages * 10;` > in bringetbitmap()? Yes, it is just confusing. The correct value is on one level up of the tree. It is 204 + 4404 rows removed by index recheck = 4608, so the estimate is not only 150x but 733x off :(. The sequential

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

2018-07-26 Thread Oleksandr Shulgin
On Wed, Jul 25, 2018 at 8:35 PM Nico Williams wrote: > > What are you proposing anyways? That every commit come with a patent > search? > I would propose that everyone wasting their time and effort to discuss this issue here, would rather spend that time working towards putting an end to

Re: Making "COPY partitioned_table FROM" faster

2018-07-26 Thread Simon Riggs
On 26 July 2018 at 03:30, David Rowley wrote: > The v3 version of the patch also fixes the very small performance > regression for the (probably quite likely) worst-case situation. New > performance is about 3.5% faster instead of 0.5-1% slower. So likely > there's no longer any need to

Re: [HACKERS] [PATCH] Overestimated filter cost and its mitigation

2018-07-26 Thread Ashutosh Bapat
On Mon, Jan 29, 2018 at 10:42 AM, Yuto Hayamizu wrote: > On Fri, Jan 19, 2018 at 5:07 PM, Yuto Hayamizu wrote: >> My idea of improving this patch is that give a threshold N_limit, >> and for q_1 ... q_N_limit, do the same weighted cost estimation in the >> current version of this patch. >> For