This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- A method to have RETURNING work if you are partitioning data using trigger. | |
-- The method to this madness is: | |
-- | |
-- 1) Use the normal trigger mechanism to insert the data into the child tables, but | |
-- Instead of the trigger function returning NULL so that the row does not get⋅ | |
-- inserted into the master table, it returns the row inserted into the child | |
-- table | |
-- | |
-- 2) Postgres will insert the new row from the trigger into the master table | |
-- |
NewerOlder