Re: Partitioning option for COPY - Mailing list pgsql-hackers

From Emmanuel Cecchet
Subject Re: Partitioning option for COPY
Date
Msg-id 4B07353A.2050308@asterdata.com
Whole thread Raw
In response to Re: Partitioning option for COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Jan Urbański <wulczer@wulczer.org> writes:
>   
>> that got broken by the WHEN triggers patch
>> (c6e0a36243a54eff79b47b3a0cb119fb67a55165), which changed the
>> TriggerEnabled function signature, the code currently does not compile.
>>     
>
> [ squint... ]  What is that patch doing touching the innards of
> trigger.c in the first place?  I can't see any reason for trigger.c
> to be associated with partitioning.
>   
The problem I had is that if I used the standard trigger mechanism for 
after row inserts on a child table where the trigger is called 
asynchronously, I had a relcache leak on the child table. I tried to ask 
for help on that earlier on but it got lost with other discussions on 
the patch. So I tried to call the after trigger synchronously on the 
child table and it worked.
So the patch is just adding a synchronous call to after row insert 
triggers that is called when the tuple is moved to a child table (also 
allows to detect for triggers that are messing with the routing).

I would be happy to follow any recommendation for a more elegant 
solution to the problem.

Emmanuel

-- 
Emmanuel Cecchet
Aster Data
Web: http://www.asterdata.com



pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Summary and Plan for Hot Standby
Next
From: Josh Berkus
Date:
Subject: Re: DEFAULT of domain ignored in plpgsql (8.4.1)