different results from plpgsql functions related to last changes in master

2018-02-17 Thread Pavel Stehule
Hi I did update of plpgsql_check and I see, so some functions returns different result than on older posgresql. Probably this is wanted behave, but It should be mentioned as partial compatibility break, because some regress test can be broken too. create table t(i int); create function

Re: ALTER TABLE ADD COLUMN fast default

2018-02-17 Thread David Rowley
On 17 February 2018 at 10:46, Andrew Dunstan wrote: > The attached version largely fixes with the performance degradation > that Tomas Vondra reported, replacing an O(N^2) piece of code in > slot_getmissingattrs() by one that is O(N). I've looked over this patch

Re: [HACKERS] path toward faster partition pruning

2018-02-17 Thread David Rowley
On 17 February 2018 at 22:39, David Rowley wrote: > 10. I'd rather see bms_next_member() used here: > > /* Add selected partitions' RT indexes to result. */ > while ((i = bms_first_member(partindexes)) >= 0) > result = bms_add_member(result,

Re: missing toast table for pg_policy

2018-02-17 Thread Michael Paquier
On Sat, Feb 17, 2018 at 03:52:33PM -0800, Andres Freund wrote: > I've a hard hard hard time believing this is something useful to do. I > mean by that argument you can just cause trouble everywhere by just > storing arbitrarily large stuff via sql. Did you read my last email until the end?

Re: missing toast table for pg_policy

2018-02-17 Thread Andres Freund
Hi, On 2018-02-18 08:48:37 +0900, Michael Paquier wrote: > On Sat, Feb 17, 2018 at 08:52:11AM -0800, Andres Freund wrote: > > On 2018-02-17 11:39:57 -0500, Tom Lane wrote: > > > pg_authid | rolpassword | text > > > > that seems not not to require one. > > You can craft SCRAM

Re: missing toast table for pg_policy

2018-02-17 Thread Michael Paquier
On Sat, Feb 17, 2018 at 08:52:11AM -0800, Andres Freund wrote: > On 2018-02-17 11:39:57 -0500, Tom Lane wrote: > > pg_authid | rolpassword | text > > that seems not not to require one. You can craft SCRAM verifiers that make it fail, which can be easily done using this module:

Re: [HACKERS] path toward faster partition pruning

2018-02-17 Thread David Rowley
On 17 February 2018 at 22:24, David Rowley wrote: > On 2 February 2018 at 23:03, Amit Langote > wrote: >> I started wondering if it's not such a good idea to make >> PartitionClauseInfo a Node at all? > That sounds like a good idea. >

Re: [HACKERS] Cache lookup errors with functions manipulation object addresses

2018-02-17 Thread Alvaro Herrera
Michael Paquier wrote: > > As far as format_type_extended() is concerned, IMO we've gone far enough > > with the number of variants of format_type(). Making the function > > public makes sense to me, but let's add a bits32 flags argument instead > > of exposing the messy set of booleans. We can

Proposal for changes in official Docker image

2018-02-17 Thread Максим Кольцов
Hi! First of all, thanks for the great app :) I started using PgAdmin with docker image (dpage/pgadmin4) a few weeks ago, however I thought that it had some issues, so I decided to make my own image. Some of the advantages: - Use alpine linux instead of centos to greatly reduce image size

Re: pgbench - allow to specify scale as a size

2018-02-17 Thread Alvaro Hernandez
On 17/02/18 12:37, Fabien COELHO wrote:     Why not then insert a "few" rows, measure size, truncate the table, compute the formula and then insert to the desired user requested size? (or insert what should be the minimum, scale 1, measure, and extrapolate what's missing). It doesn't sound

Re: pgbench - allow to specify scale as a size

2018-02-17 Thread Fabien COELHO
    Why not then insert a "few" rows, measure size, truncate the table, compute the formula and then insert to the desired user requested size? (or insert what should be the minimum, scale 1, measure, and extrapolate what's missing). It doesn't sound too complicated to me, and targeting a

Re: pgbench - allow to specify scale as a size

2018-02-17 Thread Fabien COELHO
Hello Tom, Here is a attempt at extending --scale so that it can be given a size. I do not actually find this to be a good idea. It's going to be platform-dependent, or not very accurate, or both, and thereby contribute to confusion by making results less reproducible. I have often wanted

Re: pgbench - allow to specify scale as a size

2018-02-17 Thread Alvaro Hernandez
On 17/02/18 12:17, Tom Lane wrote: Alvaro Hernandez writes: On 17/02/18 11:26, Tom Lane wrote: Fabien COELHO writes: Here is a attempt at extending --scale so that it can be given a size. I do not actually find this to be a good idea. It's going to

Re: pgbench - allow to specify scale as a size

2018-02-17 Thread Tom Lane
Alvaro Hernandez writes: > On 17/02/18 11:26, Tom Lane wrote: >> Fabien COELHO writes: >>> Here is a attempt at extending --scale so that it can be given a size. >> I do not actually find this to be a good idea. It's going to be >> platform-dependent, or

Re: missing toast table for pg_policy

2018-02-17 Thread Tom Lane
Andres Freund writes: > On 2018-02-17 11:39:57 -0500, Tom Lane wrote: >> pg_aggregate| agginitval | text >> pg_aggregate| aggminitval | text > Seems like it should have a toast table, it's not too hard to imagine > some form of aggregate to

Re: pgbench - allow to specify scale as a size

2018-02-17 Thread Alvaro Hernandez
On 17/02/18 11:26, Tom Lane wrote: Fabien COELHO writes: Here is a attempt at extending --scale so that it can be given a size. I do not actually find this to be a good idea. It's going to be platform-dependent, or not very accurate, or both, and thereby contribute to

Re: missing toast table for pg_policy

2018-02-17 Thread Andres Freund
On 2018-02-17 11:39:57 -0500, Tom Lane wrote: > BTW, I was wondering if it'd be a good idea to try to forestall future > oversights of this sort by adding a test query in, say, misc_sanity.sql. > Something like +many > relname | attname | atttypid >

Re: missing toast table for pg_policy

2018-02-17 Thread Tom Lane
Joe Conway writes: > Yes, exactly. I'm fine with not backpatching, just wanted to raise the > possibility. I will push later today to HEAD (with a catalog version bump). BTW, I was wondering if it'd be a good idea to try to forestall future oversights of this sort by adding a

Re: missing toast table for pg_policy

2018-02-17 Thread Joe Conway
On 02/16/2018 05:24 PM, Tom Lane wrote: > Joe Conway writes: >> On 02/16/2018 05:07 PM, Andres Freund wrote: >>> If problematic for < master users I think you'll have to restart cluster >>> with allow_system_table_mods, manually create/drop toasted column. IIRC >>> that should

Documenting PROVE_TESTS in section of TAP tests

2018-02-17 Thread Michael Paquier
Hi all, The section of the documentation dedicated to TAP tests mentions PROVE_FLAGS: https://www.postgresql.org/docs/devel/static/regress-tap.html I think that it would be a good idea to mention PROVE_TESTS as well. I personally use and abuse of it, and documenting it instead of keeping it

Re: Disabling src/test/[ssl|ldap] when not building with SSL/LDAP support

2018-02-17 Thread Michael Paquier
On Sat, Feb 17, 2018 at 08:34:41AM +0900, Michael Paquier wrote: > For this an environment variable seems suited to me. Say if > PG_TAP_ALLOW_INSECURE is set, then the tests said "insecure" are allowed > to run. If the tests are tried to be run, then they are just skipped > with a nice log

Re: pgbench - allow to specify scale as a size

2018-02-17 Thread Erik Rijkers
On 2018-02-17 10:20, Fabien COELHO wrote: After Karel Moppel piece on pgbench scale/size conversion, it occured to me that having this as an option would be nice. https://www.cybertec-postgresql.com/en/a-formula-to-calculate-pgbench-scaling-factor-for-target-db-size/ Here is a attempt at

Re: [HACKERS] path toward faster partition pruning

2018-02-17 Thread David Rowley
On 15 February 2018 at 18:57, Amit Langote wrote: > Here is an updated version. Thanks for sending v27. I've had a quick look over it while I was working on the run-time prune patch. However, I've not quite managed a complete pass of this version yet A

Re: [HACKERS] Proposal: generic WAL compression

2018-02-17 Thread Oleg Ivanov
Hello everyone! Unfortunately, I faced the use case with RUM index, in which my patch produced enormously large time overhead (queries execution time is about 2 or 3 times slower). Only now I finally managed to limit this overhead by 20% or even make it statistically insignificant on my HDD.

Re: [HACKERS] path toward faster partition pruning

2018-02-17 Thread David Rowley
On 2 February 2018 at 23:03, Amit Langote wrote: >> 2. PartitionClauseInfo->keyclauses is a list of PartClause which is >> not a node type. This will cause _copyPartitionClauseInfo() to fail. >> >> I'm still not quite sure the best way to fix #2 since PartClause >>

pgbench - allow to specify scale as a size

2018-02-17 Thread Fabien COELHO
After Karel Moppel piece on pgbench scale/size conversion, it occured to me that having this as an option would be nice. https://www.cybertec-postgresql.com/en/a-formula-to-calculate-pgbench-scaling-factor-for-target-db-size/ Here is a attempt at extending --scale so that it can be given a

Re: [HACKERS] Bug in to_timestamp().

2018-02-17 Thread Arthur Zakirov
On Wed, Feb 14, 2018 at 05:23:53PM +0100, Dmitry Dolgov wrote: > * On line 52 there is a removed empty line, without any other changes around Agree, it is unnecessary change. There was the macro there before. > * On line 177 there is a new commented out line of code. I assume it's not > an >

Re: [HACKERS] Runtime Partition Pruning

2018-02-17 Thread David Rowley
Hi, I've attached an updated patch, now at v10. v9 was short lived due to the evolution of Amit's which which this based on. This version is based on Amit's v27 of faster partition pruning [1] which can be applied atop of ad7dbee36. I've done a self review of this, but I've not yet done any