Emmanuel Cecchet <m...@frogthinker.org> wrote: > In the meantime, I have made some more tests with the trigger in C (see > attached patch).
Hmm... The inserting partition is passed by trigger arguments. Users must replace triggers when the target is changed (ex. every month). Is it possible to expand all of child paritions from pg_inherits and determine a suitable parition by checking their constraints? We can also use it when there are multiple inserting paritions, something like hash or list paritioning. Fixed target is only applicable to time-based range paritioning. BTW, there is another issue in trigger approach. If INSERT commands are interrupted by triggers, server says "INSERT 0 row" though rows are inserted into child tables. Since using C, we could use some back doors to modify a variable counting affected rows. We could use partitioned tables more transparently if we have it. Regards, --- ITAGAKI Takahiro NTT Open Source Software Center -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers