Partitionning by trigger

Started by Ali Pouyaabout 13 years ago3 messagesgeneral
Jump to latest
#1Ali Pouya
alipouya2@gmail.com

Hi,
I have created a partitionned table and a Pl/PgSQL trigger exactly as
explained here<http://www.postgresql.org/docs/9.2/static/ddl-partitioning.html&gt;in
the documentation.

It works fine but the INSERT and COPY commands return zero instead of the
number of the rows actually inserted. Worse : the RETURNING clause returns
NULL when inserting through the trigger.

I encounter the same problem with a C language trigger function.

Is there anyway to obtain a behavior similar to that of the direct
insertion ?

I use PostgreSQL 9.2.3 in Linux Fedora 2.6 environment.
I can send a simplified self contained test case if required.

Thanks for your answer

Best Regards
Ali Pouya

#2Ali Pouya
alipouya2@gmail.com
In reply to: Ali Pouya (#1)

Hi all,
I sent the following mail yesterday but I do not see it in the list.
So I retry
==============

Hi,
I have created a partitionned table and a Pl/PgSQL trigger exactly as
explained here<http://www.postgresql.org/docs/9.2/static/ddl-partitioning.html&gt;in
the documentation.

It works fine but the INSERT and COPY commands return zero instead of the
number of the rows actually inserted. Worse : the RETURNING clause returns
NULL when inserting through the trigger.

I encounter the same problem with a C language trigger function.

Is there anyway to obtain a behavior similar to that of the direct
insertion ?

I use PostgreSQL 9.2.3 in Linux Fedora 2.6 environment.
I can send a simplified self contained test case if required.

Thanks for your answer

Best Regards
Ali Pouya

#3Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Ali Pouya (#2)
Re: Partitionning by trigger

Ali Pouya wrote:

I sent the following mail yesterday but I do not see it in the list.
So I retry

It is there all right:
/messages/by-id/CAEEEPmwq_3=hGEC69-2EkCWTiwq0dme==8SoU29E9k2DCCgUEw@mail.gmail.com

I have created a partitionned table and a Pl/PgSQL trigger exactly as explained here
<http://www.postgresql.org/docs/9.2/static/ddl-partitioning.html&gt; in the documentation.

It works fine but the INSERT and COPY commands return zero instead of the number of the rows actually
inserted. Worse : the RETURNING clause returns NULL when inserting through the trigger.

I encounter the same problem with a C language trigger function.

Is there anyway to obtain a behavior similar to that of the direct insertion ?

I don't think that is possible.

Yours,
Laurenz Albe

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general