Re: [HACKERS] [Patch] Log SSL certificate verification errors

2017-11-10 Thread Michael Paquier
On Sat, Nov 11, 2017 at 3:34 AM, Graham Leggett wrote: > Currently neither the server side nor the client side SSL certificate verify > callback does anything, leading to potential hair-tearing-out moments. > > The following patch to master implements logging of all certificate

Re: [HACKERS] pg_upgrade to clusters with a different WAL segment size

2017-11-10 Thread Michael Paquier
On Sat, Nov 11, 2017 at 12:46 AM, Bossart, Nathan wrote: > Allowing changes to the WAL segment size during pg_upgrade seems like a > nice way to avoid needing a dump and load, so I would like to propose > adding support for this. I'd be happy to submit patches for this in

Re: [HACKERS] Simplify ACL handling for large objects and removal of superuser() checks

2017-11-10 Thread Michael Paquier
On Sat, Nov 11, 2017 at 12:50 AM, Robert Haas wrote: > On Fri, Nov 10, 2017 at 10:34 AM, Tom Lane wrote: >> I think as far as that goes, we can just change to "Therefore, by default >> their use is restricted ...". Then I suggest adding a para >>

Re: [HACKERS] Simplify ACL handling for large objects and removal of superuser() checks

2017-11-10 Thread Stephen Frost
Michael, Tom, * Michael Paquier (michael.paqu...@gmail.com) wrote: > On Fri, Nov 10, 2017 at 10:00 AM, Tom Lane wrote: > > Stephen Frost writes: > >> I'm guessing no, which essentially means that *we* consider access to > >> lo_import/lo_export to be

Re: [HACKERS] Proposal: Improve bitmap costing for lossy pages

2017-11-10 Thread Robert Haas
On Thu, Nov 9, 2017 at 3:55 AM, amul sul wrote: > It took me a little while to understand this calculation. You have moved this > code from tbm_create(), but I think you should move the following > comment as well: I made an adjustment that I hope will address your concern

Re: [HACKERS] LDAP URI decoding bugs

2017-11-10 Thread Thomas Munro
On Sat, Nov 11, 2017 at 8:37 AM, Peter Eisentraut wrote: > On 11/6/17 23:30, Michael Paquier wrote: >> On Fri, Nov 3, 2017 at 12:57 PM, Thomas Munro >> wrote: >>> 1. If you set up a pg_hba.conf with a URL that lacks a base DN or

Re: [HACKERS] parallelize queries containing initplans

2017-11-10 Thread Tom Lane
Robert Haas writes: > On Fri, Nov 10, 2017 at 2:24 PM, Tom Lane wrote: >> Also, I wonder whether the InvalidOid hack in SS_assign_special_param >> requires commentary. It might be safer to use a valid type OID there, >> perhaps VOIDOID or INTERNALOID.

Re: [HACKERS] Planning counters in pg_stat_statements

2017-11-10 Thread Thomas Munro
On Tue, Nov 7, 2017 at 6:39 PM, Tsunakawa, Takayuki wrote: > From: pgsql-hackers-ow...@postgresql.org >> [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Thomas Munro >> I have often wanted $SUBJECT and was happy to find that Fujii-san had posted >> a patch

Re: [HACKERS] parallelize queries containing initplans

2017-11-10 Thread Robert Haas
On Fri, Nov 10, 2017 at 2:24 PM, Tom Lane wrote: > Robert Haas writes: >> I decided to try instead teaching the planner to keep track of the >> types of PARAM_EXEC parameters as they were created, and that seems to >> work fine. See 0001, attached. > >

Re: [HACKERS] LDAP URI decoding bugs

2017-11-10 Thread Peter Eisentraut
On 11/6/17 23:30, Michael Paquier wrote: > On Fri, Nov 3, 2017 at 12:57 PM, Thomas Munro > wrote: >> 1. If you set up a pg_hba.conf with a URL that lacks a base DN or >> hostname, hba.c will segfault on startup when it tries to pstrdup a >> null pointer. Examples:

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

2017-11-10 Thread Robert Haas
On Wed, Sep 27, 2017 at 7:07 AM, amul sul wrote: > Attaching POC patch that throws an error in the case of a concurrent update > to an already deleted tuple due to UPDATE of partition key[1]. > > In a normal update new tuple is linked to the old one via ctid forming > a chain

Re: [HACKERS] parallelize queries containing initplans

2017-11-10 Thread Tom Lane
Robert Haas writes: > I decided to try instead teaching the planner to keep track of the > types of PARAM_EXEC parameters as they were created, and that seems to > work fine. See 0001, attached. I did not look at the other part, but 0001 looks reasonable to me. I might

Re: [HACKERS] Add some const decorations to prototypes

2017-11-10 Thread Peter Eisentraut
On 11/10/17 10:29, Fabien COELHO wrote: > Or basically all is fine, I'm just nitpicking for nothing, shame on me. > > As I said, I rather like more precise declarations. committed -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA,

Re: [HACKERS] parallelize queries containing initplans

2017-11-10 Thread Robert Haas
On Tue, Nov 7, 2017 at 4:45 AM, Amit Kapila wrote: > As mentioned, changed the status of the patch in CF app. I spent some time reviewing this patch today and found myself still quite uncomfortable with the fact that it was adding execution-time work to track the types

[HACKERS] [Patch] Log SSL certificate verification errors

2017-11-10 Thread Graham Leggett
Hi all, Currently neither the server side nor the client side SSL certificate verify callback does anything, leading to potential hair-tearing-out moments. The following patch to master implements logging of all certificate verification failures, as well as (crucially) which certificates

Re: [HACKERS] Add some const decorations to prototypes

2017-11-10 Thread Peter Eisentraut
On 11/10/17 11:42, Fabien COELHO wrote: > After your explanation, and on third thoughts, ISTM that the assignment > should not include "const" in the explicit cast, i.e., use > >extern void * msg_func(void); >const char * msg = (char *) msg_func(); > > The variable or field is constant,

Re: [HACKERS] Fix bloom WAL tap test

2017-11-10 Thread Tom Lane
I wrote: > Is there anything we can do to cut the runtime of the TAP test to > the point where running it by default wouldn't be so painful? As an experiment, I tried simply cutting the size of the test table 10X: diff --git a/contrib/bloom/t/001_wal.pl b/contrib/bloom/t/001_wal.pl index

Re: [HACKERS] Fix bloom WAL tap test

2017-11-10 Thread Tom Lane
Michael Paquier writes: > On Thu, Nov 9, 2017 at 7:51 PM, Alexander Korotkov > wrote: >> OK, then so be it :) > Thanks for the new version. This one, as well as the switch to > psql_safe in >

Re: [HACKERS] Add some const decorations to prototypes

2017-11-10 Thread Tom Lane
Fabien COELHO writes: >> LWLockTrancheArray = (char **) >> MemoryContextAllocZero(TopMemoryContext, >> LWLockTranchesAllocated * sizeof(char *)); > After your explanation, and on third thoughts, ISTM that the assignment > should not include

Re: [HACKERS] Add some const decorations to prototypes

2017-11-10 Thread Fabien COELHO
Hello Tom, ISTM That there is still at least one strange cast: +static const char **LWLockTrancheArray = NULL; + LWLockTrancheArray = (const char **) // twice These are not cases of "cheating". This is just the return value of a memory allocation function being cast from

Re: [HACKERS] Incorrect comment for build_child_join_rel

2017-11-10 Thread Robert Haas
On Fri, Nov 10, 2017 at 4:34 AM, Etsuro Fujita wrote: > Here is a small patch for $Subject. Good catch. Committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list

Re: [HACKERS] proposal: psql command \graw

2017-11-10 Thread Pavel Stehule
2017-11-10 16:38 GMT+01:00 Fabien COELHO : > > Hello, > > Maybe I'm missing something, but it looks that it could be made to work >>> without adding another boolean. >>> >> >> The tuples only cannot be disabled, because then other parts print number >> of rows >> >>

Re: [HACKERS] Aggregates push-down to partitions

2017-11-10 Thread Konstantin Knizhnik
On 10.11.2017 12:15, Ashutosh Bapat wrote: Maybe in this thread[1] your described problem are solved through introducing Parallel Append node? 1. https://www.postgresql.org/message-id/CAJ3gD9dy0K_E8r727heqXoBmWZ83HwLFwdcaSSmBQ1%2BS%2BvRuUQ%40mail.gmail.com You may want to review [2] and [3]

Re: [HACKERS] Add some const decorations to prototypes

2017-11-10 Thread Tom Lane
Fabien COELHO writes: >>> ISTM That there is still at least one strange cast: +static const char **LWLockTrancheArray = NULL; + LWLockTrancheArray = (const char **) // twice >> These are not cases of "cheating". This is just the return value of a >>

Re: [HACKERS] Simplify ACL handling for large objects and removal of superuser() checks

2017-11-10 Thread Robert Haas
On Fri, Nov 10, 2017 at 10:34 AM, Tom Lane wrote: > I think as far as that goes, we can just change to "Therefore, by default > their use is restricted ...". Then I suggest adding a para > after that, with wording along the lines of > > It is possible to GRANT use of

Re: [HACKERS] [PATCH] A hook for session start

2017-11-10 Thread Fabrízio de Royes Mello
On Thu, Nov 9, 2017 at 9:08 PM, Michael Paquier wrote: > > On Fri, Nov 10, 2017 at 2:32 AM, Fabrízio de Royes Mello > wrote: > > On Thu, Nov 9, 2017 at 12:09 AM, Michael Paquier < michael.paqu...@gmail.com> > > wrote: > >> +++

[HACKERS] pg_upgrade to clusters with a different WAL segment size

2017-11-10 Thread Bossart, Nathan
Hi hackers, The thread for the recent change to allow setting the WAL segment size at initdb time [0] included a bit of discussion regarding pg_upgrade [1], where it was suggested that relaxing an error check (presumably in check_control_data()) might be enough to upgrade servers to a different

Re: [HACKERS] proposal: psql command \graw

2017-11-10 Thread Fabien COELHO
Hello, Maybe I'm missing something, but it looks that it could be made to work without adding another boolean. The tuples only cannot be disabled, because then other parts print number of rows postgres=# \pset format unaligned Output format is unaligned. postgres=# select 10 as a, 20 as b;

Re: [HACKERS] Simplify ACL handling for large objects and removal of superuser() checks

2017-11-10 Thread Tom Lane
Michael Paquier writes: > That will not sound much as a surprise as I spawned the original > thread, but like Robert I understand that getting rid of all superuser > checks is a goal that we are trying to reach to allow admins to have > more flexibility in handling

Re: [HACKERS] Add some const decorations to prototypes

2017-11-10 Thread Fabien COELHO
Would it make sense that the function returns "const void *", i.e. the cast is not on the const part but on the pointer type part? Or maybe you do not really need a cast, the following code does not generate any warning when compiled with clang & gcc. #include // const void * would be

Re: [HACKERS] Add some const decorations to prototypes

2017-11-10 Thread Fabien COELHO
ISTM That there is still at least one strange cast: +static const char **LWLockTrancheArray = NULL; + LWLockTrancheArray = (const char **) // twice These are not cases of "cheating". This is just the return value of a memory allocation function being cast from void * to

Re: [HACKERS] PATCH: multivariate histograms and MCV lists

2017-11-10 Thread Mark Dilger
> On Sep 12, 2017, at 2:06 PM, Tomas Vondra > wrote: > > Attached is an updated version of the patch, dealing with fallout of > 821fb8cdbf700a8aadbe12d5b46ca4e61be5a8a8 which touched the SGML > documentation for CREATE STATISTICS. Your patches need updating.

Re: [HACKERS] [POC] Faster processing at Gather node

2017-11-10 Thread Robert Haas
On Fri, Nov 10, 2017 at 5:44 AM, Amit Kapila wrote: > I am seeing the assertion failure as below on executing the above > mentioned Create statement: > > TRAP: FailedAssertion("!(!(tup->t_data->t_infomask & 0x0008))", File: > "heapam.c", Line: 2634) > server closed the

Re: [HACKERS] Variable substitution in psql backtick expansion

2017-11-10 Thread Pavel Stehule
Hi I am sending a review of last patch psql-server-version-1.patch.gz This patch is trivial - the most big problem is choosing correct name for GUC. I am thinking so server_version_raw is acceptable. I had to fix doc - see attached updated patch All tests passed. I'll mark this patch as ready

Re: [HACKERS] Add some const decorations to prototypes

2017-11-10 Thread Peter Eisentraut
On 11/4/17 16:50, Fabien COELHO wrote: >>> Just leave it as char*. If you change the endptr argument you're going to >>> force every call site to change their return variable, and some of them >>> would end up having to cast away the const on their end. >> >> OK, here is an updated patch with the

Re: [HACKERS] Transform for pl/perl

2017-11-10 Thread Pavel Stehule
Hi 2017-10-24 14:27 GMT+02:00 Anthony Bykov : > There are some moments I should mention: > 1. {"1":1}::jsonb is transformed into HV {"1"=>"1"}, while > ["1","2"]::jsonb is transformed into AV ["1", "2"] > > 2. If there is a numeric value appear in jsonb, it will be

Re: [HACKERS] pg_basebackup --progress output for batch execution

2017-11-10 Thread Martín Marqués
Hi, Thanks for having a look at this patch. 2017-11-09 20:55 GMT-03:00 Jeff Janes : > On Fri, Sep 29, 2017 at 4:00 PM, Martin Marques > wrote: >> >> Hi, >> >> Some time ago I had to work on a system where I was cloning a standby >> using

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2017-11-10 Thread Etsuro Fujita
(2017/11/01 11:16), Robert Haas wrote: On Wed, Oct 4, 2017 at 5:58 PM, Ashutosh Bapat wrote: The view with WCO is local but the modification which violates WCO is being made on remote server by a trigger on remote table. Trying to control that doesn't seem to

Re: [HACKERS] Runtime Partition Pruning

2017-11-10 Thread amul sul
On Thu, Nov 9, 2017 at 4:48 PM, Beena Emerson wrote: > Hello all, > > Here is the updated patch which is rebased over v10 of Amit Langote's > path towards faster pruning patch [1]. It modifies the PartScanKeyInfo > struct to hold expressions which is then evaluated by the

Re: [HACKERS] [POC] Faster processing at Gather node

2017-11-10 Thread Amit Kapila
On Fri, Nov 10, 2017 at 9:48 AM, Amit Kapila wrote: > On Fri, Nov 10, 2017 at 8:36 AM, Robert Haas wrote: >> On Thu, Nov 9, 2017 at 9:31 PM, Amit Kapila wrote: >>> Have you set force_parallel_mode=regress; before running

[HACKERS] No mention of CREATE STATISTICS in event trigger docs

2017-11-10 Thread David Rowley
A patch to fix this is attached. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services event_trigger_statistics_doc.patch Description: Binary data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make

[HACKERS] Incorrect comment for build_child_join_rel

2017-11-10 Thread Etsuro Fujita
Hi, Here is a small patch for $Subject. Best regards, Etsuro Fujita *** a/src/backend/optimizer/util/relnode.c --- b/src/backend/optimizer/util/relnode.c *** *** 676,683 build_join_rel(PlannerInfo *root, * 'sjinfo': child-join context info * 'restrictlist': list of

Re: [HACKERS] pg_basebackup --progress output for batch execution

2017-11-10 Thread Arthur Zakirov
On Thu, Nov 09, 2017 at 03:55:36PM -0800, Jeff Janes wrote: > > I think I agree with Arthur that I'd rather have the decision made by > inspecting whether output is going to a tty, rather than by adding another > command line option. But maybe that is not detected robustly enough across > all

Re: [HACKERS] Aggregates push-down to partitions

2017-11-10 Thread Ashutosh Bapat
On Fri, Nov 10, 2017 at 12:20 AM, Maksim Milyutin wrote: > Hi Konstantin! >> I wonder if somebody already investigate this problem or working in this >> direction. >> May be there are already some patches proposed? >> I have searched hackers archive, but didn't find