Re: Performance regression with PostgreSQL 11 and partitioning

2018-06-10 Thread Ashutosh Bapat
On Sat, Jun 9, 2018 at 12:22 AM, Robert Haas wrote: > On Fri, Jun 8, 2018 at 2:10 PM, Tom Lane wrote: >>> I don't understand this complaint. Before, the code took one >>> AppendRelInfo, and according to you, it was clear what was supposed to >>> happen. Now it takes an array of AppendRelInfos a

Secured and customizable PLPython and PLR on Postgresql

2018-06-10 Thread Hubert Zhang
Hi all, As you know PLPython and PLR are untrusted language, which means only DBA could create these UDFs(very inconvenient). Moreover it's also hard to supply user specific Python/R env for different data scientists. We are working on an open source project to make PLPython and PLR trusted and

Re: SHOW ALL does not honor pg_read_all_settings membership

2018-06-10 Thread Laurenz Albe
Alvaro Herrera wrote: > On 2018-Mar-01, Laurenz Albe wrote: > > > I noticed that commit 25fff40798fc4ac11a241bfd9ab0c45c085e2212 forgot > > to teach SHOW ALL to show all GUCs when the user belongs to > > pg_read_all_settings. > > > > Patch attached; I think this should be backpatched. > > Done,

Re: Portability concerns over pq_sendbyte?

2018-06-10 Thread Michael Paquier
On Wed, Jun 06, 2018 at 12:27:58PM -0400, Alvaro Herrera wrote: > Do you have an answer to this question? Does anybody else? > > (My guts tell me it'd be better to change these routines to take > unsigned values, without creating extra variants. But guts frequently > misspeak.) My guts are tell

Re: Concurrency bug in UPDATE of partition-key

2018-06-10 Thread Dilip Kumar
On Mon, Jun 11, 2018 at 10:19 AM, Amit Khandekar wrote: > On 8 June 2018 at 16:44, Dilip Kumar wrote: > > On Fri, Jun 8, 2018 at 2:23 PM, Dilip Kumar > wrote: > >> > >> On Tue, Jun 5, 2018 at 8:03 PM, Amit Khandekar > >> wrote: > >>> > >>> Attached is a rebased patch version. Also included it

Re: Concurrency bug in UPDATE of partition-key

2018-06-10 Thread Amit Khandekar
On 8 June 2018 at 16:44, Dilip Kumar wrote: > On Fri, Jun 8, 2018 at 2:23 PM, Dilip Kumar wrote: >> >> On Tue, Jun 5, 2018 at 8:03 PM, Amit Khandekar >> wrote: >>> >>> Attached is a rebased patch version. Also included it in the upcoming >>> commitfest : >>> https://commitfest.postgresql.org/18/

Re: CF bug fix items

2018-06-10 Thread Michael Paquier
On Sun, Jun 10, 2018 at 10:41:26AM -0400, Andrew Dunstan wrote: > Six of them are marked "ready for committer" and all of those have a > committer named as either author or reviewer. It would be good to get those > committed as soon as possible. So Heikki, Michael, Alexander, Simon, Etsuro > and Th

Re: commitfest 2018-07

2018-06-10 Thread Michael Paquier
On Wed, Jun 06, 2018 at 12:38:56AM +0200, Magnus Hagander wrote: > Thus, if we don't want to have to risk doing surgery on the system (or > guarantee we won't bounce any patches from the 07 CF, but that seems like > the wrong thing to do), we should rename the existing 09 CF to 07, so all > patches

Re: why partition pruning doesn't work?

2018-06-10 Thread David Rowley
Thanks for working on and pushing those fixes. On 11 June 2018 at 10:49, Tom Lane wrote: > It's very unclear for example what the subplan_map and subpart_map > arrays really are, eg what are they indexed by? I get the impression > that only one of them can have a non-minus-1 value for a given in

Re: SHOW ALL does not honor pg_read_all_settings membership

2018-06-10 Thread Michael Paquier
On Fri, Jun 08, 2018 at 03:13:57PM -0400, Alvaro Herrera wrote: > And I think this fixes it. -if (conf->source == PGC_S_FILE && superuser()) +if (conf->source == PGC_S_FILE && +is_member_of_role(GetUserId(), DEFAULT_ROLE_READ_ALL_SETTINGS)) Thanks Alvaro! This bit in GetConfigOpt

Re: Loaded footgun open_datasync on Windows

2018-06-10 Thread Michael Paquier
On Sun, Jun 10, 2018 at 10:09:26AM +0530, Amit Kapila wrote: > As per discussion till now, we have two options to proceed: > (a) Remove the define "#ifndef FRONTEND" that prevents pgwin32_open > usage in frontend modules. We have done some research and found that > it was added in the past to allo

Re: pgsql: Fix and document lock handling for in-memory replication slot da

2018-06-10 Thread Michael Paquier
On Sun, Jun 10, 2018 at 10:45:04AM +, Michael Paquier wrote: > Fix and document lock handling for in-memory replication slot data > > [... snip ...] > > Details > --- > https://git.postgresql.org/pg/commitdiff/9e149c847f398793ec1641885434dcd10837d89d My apologies here. This commit has a

Re: Possible bug in logical replication.

2018-06-10 Thread Michael Paquier
On Thu, Jun 07, 2018 at 08:32:10AM +0100, Simon Riggs wrote: > On 6 June 2018 at 17:22, Alvaro Herrera wrote: >> This thread seems to have died down without any fix being proposed. >> Simon, you own this open item. > > Thanks, will look. Petr and I have found a couple of issues about the slot ad

Re: pg_replication_slot_advance to return NULL instead of 0/0 if slot not advanced

2018-06-10 Thread Michael Paquier
On Sun, Jun 10, 2018 at 10:19:23PM +0900, Michael Paquier wrote: > I have been able to look again at 0001 and pushed it as 9e149c8. As > reading inconsistent data from replication slots is rather hard to > trigger, I have just pushed the patch to HEAD. I'll look at 0002 > tomorrow. And pushed 00

Re: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian

2018-06-10 Thread Tom Lane
David Rowley writes: > On 10 June 2018 at 04:48, Tom Lane wrote: >> So, IIUC, the issue is that for partitioning cases Append expects *all* >> its children to be partitions of the *same* partitioned table? That >> is, you could also break it with >> >> select * from partitioned_table_a >> union

Re: why partition pruning doesn't work?

2018-06-10 Thread Tom Lane
David Rowley writes: > I've made a pass over the execPartition.c and partprune.c code > attempting to resolve these issues. I have hopefully fixed them all, > but I apologise if I've missed any. > I also couldn't resist making a few other improvements to the code. By the time this arrived, I'd a

JIT versus standalone-headers checks

2018-06-10 Thread Tom Lane
I find that the JIT stuff has broken cpluspluscheck for me, along with a related script that I use to verify that each header builds cleanly standalone (ie with no prerequisites except postgres.h). There are two problems: (1) Doesn't work on a platform without the llvm header files: ./src/include

Re: PostgreSQL vs SQL Standard

2018-06-10 Thread David Fetter
On Sun, Jun 10, 2018 at 11:32:56AM -0400, Tom Lane wrote: > Andrew Gierth writes: > > I beat at the grammar a bit to see what it would take to fix it at least > > to the extent of allowing a_expr ColId in a select list after removing > > postfix ops. It looked like it was doable by making these ke

Re: assert in nested SQL procedure call in current HEAD

2018-06-10 Thread Dmitry Dolgov
> On 8 June 2018 at 06:20, Andrew Gierth wrote: > Joe> My colleague Yogesh Sharma discovered an assert in nested SQL > Joe> procedure calls after ROLLBACK is used. Minimal test case and > Joe> backtrace below. I have not yet tried to figure out exactly what > Joe> is going on beyond seeing th

Re: PostgreSQL vs SQL Standard

2018-06-10 Thread Tom Lane
Andrew Gierth writes: > I beat at the grammar a bit to see what it would take to fix it at least > to the extent of allowing a_expr ColId in a select list after removing > postfix ops. It looked like it was doable by making these keywords more > reserved (all of which are already reserved words pe

Re: PostgreSQL vs SQL Standard

2018-06-10 Thread Tom Lane
Andrew Gierth writes: > Oh wow, I hadn't noticed that dropping a function referenced from a > domain's default or constraint drops the whole domain rather than just > removing the default or constraint the way it would with a table. Ouch. Seems like possibly a bug ... shouldn't we make only that

CF bug fix items

2018-06-10 Thread Andrew Dunstan
I've been looking over the older items in the CF, specifically those in the "bug fix" category. Six of them are marked "ready for committer" and all of those have a committer named as either author or reviewer. It would be good to get those committed as soon as possible. So Heikki, Michael,

Re: pg_replication_slot_advance to return NULL instead of 0/0 if slot not advanced

2018-06-10 Thread Michael Paquier
On Wed, Jun 06, 2018 at 11:04:39AM +0900, Michael Paquier wrote: > I am attaching as well the patch I sent yesterday. 0001 is candidate > for a back-patch, 0002 is for HEAD to fix the slot advance stuff. I have been able to look again at 0001 and pushed it as 9e149c8. As reading inconsistent dat

Re: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian

2018-06-10 Thread David Rowley
On 10 June 2018 at 04:48, Tom Lane wrote: > So, IIUC, the issue is that for partitioning cases Append expects *all* > its children to be partitions of the *same* partitioned table? That > is, you could also break it with > > select * from partitioned_table_a > union all >

Re: why partition pruning doesn't work?

2018-06-10 Thread David Rowley
On 10 June 2018 at 09:00, Tom Lane wrote: > I wrote: >> One thing I'm wondering about is why in the world are PartitionPruneInfo >> and its subsidiary struct types declared in primnodes.h? That may have been a legacy thing that accidentally wasn't changed from a previous version of the patch. I'v

Re: PostgreSQL vs SQL Standard

2018-06-10 Thread Andrew Gierth
> "Andrew" == Andrew Gierth writes: Andrew> I beat at the grammar a bit to see what it would take to fix it Andrew> at least to the extent of allowing a_expr ColId in a select Andrew> list after removing postfix ops. It looked like it was doable Andrew> by making these keywords more reser

Re: PostgreSQL vs SQL Standard

2018-06-10 Thread Andrew Gierth
> "Tom" == Tom Lane writes: Tom> WRT 3.2 on select-list aliases, the postfix-operator issue is only Tom> one of several reasons why we can't support that. There was some Tom> more-detailed discussion about that awhile back, I beat at the grammar a bit to see what it would take to fix it a

Re: PostgreSQL vs SQL Standard

2018-06-10 Thread Andrew Gierth
> "Tom" == Tom Lane writes: >> I think I got all the issues I currently know of, but there may be >> more, and others may disagree with my classification of issues or the >> rationales for violating the spec. Any feedback? Tom> WRT 1.1 ... I doubt that redefining DROP DOMAIN as you descr

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2018-06-10 Thread Fabien COELHO
Hello Marina, v9-0003-Pgbench-errors-use-the-ereport-macro-to-report-de.patch - a patch for the ereport() macro (this is used to report client failures that do not cause an aborts and this depends on the level of debugging). ISTM that abort() is called under FATAL. - implementation: if poss