DDL partitioning with insert trigger issue

Поиск
Список
Период
Сортировка
Искать

DDL partitioning with insert trigger issue

От:
"mark" <dvlhntr@gmail.com>
Дата:

Hello,

 

I am running PG 8.3. and following the guide found at http://www.postgresql.org/docs/current/static/ddl-partitioning.html

 

 

I have followed the steps outlined here nearly exactly with regards to using an insert trigger to call a function to insert data into the child partition. I am wondering why I am getting the record inserted in both the child and the parent partition when executing an insert into the parent.

 

 

Is there a step missing from the DOC? Something else I need to do?

 

Thank you

 

 

..: Mark

Re: DDL partitioning with insert trigger issue

От:
Scott Marlowe <scott.marlowe@gmail.com>
Дата:
On Mon, Jun 14, 2010 at 4:46 PM, mark  wrote:
> Hello,
>
> I am running PG 8.3. and following the guide found at
> http://www.postgresql.org/docs/current/static/ddl-partitioning.html
>
>
> I have followed the steps outlined here nearly exactly with regards to using
> an insert trigger to call a function to insert data into the child
> partition. I am wondering why I am getting the record inserted in both the
> child and the parent partition when executing an insert into the parent.
>
> Is there a step missing from the DOC? Something else I need to do?

Got a short, self-contained example of how you're doing it?  My guess
is you made an after instead of before trigger.

Re: DDL partitioning with insert trigger issue

От:
Alban Hertroys <dalroi@solfertje.student.utwente.nl>
Дата:
On 15 Jun 2010, at 24:46, mark wrote:

> Hello,
>  
> I am running PG 8.3. and following the guide found athttp://www.postgresql.org/docs/current/static/ddl-partitioning.html
>  
>  
> I have followed the steps outlined here nearly exactly with regards to using an insert trigger to call a function to insert data into the child partition. I am wondering why I am getting the record inserted in both the child and the parent partition when executing an insert into the parent.
>  
>  
> Is there a step missing from the DOC? Something else I need to do?

Are you sure you're not mistaking table inheritance for duplicates? If you're querying the master table without the ONLY keyword then you'll see the data from the child tables as well.

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:737,4c1752e1286215067983550!


FAQ