Re: Issues with patitionning and triggers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Samuel Gilbert <samuel(dot)gilbert(at)ec(dot)gc(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Issues with patitionning and triggers
Date: 2014-02-19 17:19:52
Message-ID: 10600.1392830392@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Samuel Gilbert <samuel(dot)gilbert(at)ec(dot)gc(dot)ca> writes:
> Here is a complete example demonstrating the issue I am encountering :

What seems to be happening is:

1. The parent table has a NOT NULL constraint on modificationDate.

2. parent_dispatcher_trigger does RETURN NEW, so the tuple will be
inserted into the parent table as well as the selected child (presumably
this is not what you wanted ...)

3. There is no trigger that will replace the modificationDate for an
insertion into the parent. So the parent insertion fails, after all
the triggers have run.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Leonardo M. Ramé 2014-02-19 17:57:22 pg_dump/pg_restore issues
Previous Message salah jubeh 2014-02-19 17:15:41 Re: Support for Alert