Fix a comment in CreateLockFile

2019-12-07 Thread Hadi Moshayedi
It seems that explanation for the contents of the pid file has moved to pidfile.h, but the comments in CreateLockFile() still point to miscadmin.h. The attached patch updates those pointers. diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c index 83c9514856..de554e

REL_12_STABLE crashing with assertion failure in ExtractReplicaIdentity

2019-08-16 Thread Hadi Moshayedi
It seems that sometimes when DELETE cascades to referencing tables we fail to acquire locks on replica identity index. To reproduce, set wal_level to logical, and run 1.sql. I can look into this, but I thought first I should send it here in case someone who is more familiar with these related fun

Re: Multitenancy optimization

2019-03-29 Thread Hadi Moshayedi
On Thu, Mar 28, 2019 at 5:40 AM Konstantin Knizhnik < k.knizh...@postgrespro.ru> wrote: > Certainly it is possible to create multicolumn statistics to notify > Postgres about columns correlation. > But unfortunately it is not good and working solution. > > First of all we have to create multicolum

Re: Fix foreign key constraint check for partitioned tables

2019-03-26 Thread Hadi Moshayedi
Posted this at the commitfest tool: https://commitfest.postgresql.org/23/2075/ >

Re: Fix foreign key constraint check for partitioned tables

2019-03-25 Thread Hadi Moshayedi
Hello Edmund, Thanks for the review. > I was a bit curious about the need for "set role" in the reproduction, > but I see that it's because RI_Initial_Check does some checks to see > if a simple SELECT can be used, and one of the checks is for basic > table permissions. > I think to reproduce t

Fix foreign key constraint check for partitioned tables

2019-03-22 Thread Hadi Moshayedi
Yesterday while doing some tests, I noticed that the following doesn't work properly: create role test_role with login; create table ref(a int primary key); grant references on ref to test_role; set role test_role; create table t1(a int, b int) partition by list (a); alter table t1 add constraint

Re: [PATCH] Fix crash in int8_avg_combine().

2017-11-27 Thread Hadi Moshayedi
On Sat, Nov 25, 2017 at 10:47 PM, Andres Freund wrote: > diff --git a/src/include/utils/memutils.h b/src/include/utils/memutils.h > > index 869c59dc85..2dc59e89cd 100644 > > --- a/src/include/utils/memutils.h > > +++ b/src/include/utils/memutils.h > > @@ -189,7 +189,7 @@ extern MemoryContext Slab

Re: [PATCH] Fix crash in int8_avg_combine().

2017-11-27 Thread Hadi Moshayedi
On Sat, Nov 25, 2017 at 10:55 PM, Tom Lane wrote: > I believe we already dealt with this: > > Author: Tom Lane > Branch: REL_10_STABLE [619a8c47d] 2017-11-14 17:49:49 -0500 > Branch: REL9_6_STABLE [4a15f87d2] 2017-11-14 17:49:49 -0500 > Branch: REL9_5_STABLE [d4e38489f] 2017-11-14 17:49:49 -0500

[PATCH] Fix crash in int8_avg_combine().

2017-11-25 Thread Hadi Moshayedi
While doing some tests on REL_10_STABLE, I was getting run-time exceptions at int8_avg_combine() at the following line: state1->sumX = state2->sumX; After some debugging, I noticed that palloc()’s alignment is 8-bytes, while this statement (which moves a __int128 from one memory location to anoth