From: Bruce Momjian Date: Wed, 15 Aug 2012 03:21:13 +0000 (-0400) Subject: Add doc example of restricting large object trigger firing to only X-Git-Tag: REL9_3_BETA1~1096 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e84cccff28e52ab76aa3d3e88bd815dc36d24d8;p=thirdparty%2Fpostgresql.git Add doc example of restricting large object trigger firing to only updates of the column of interest. --- diff --git a/doc/src/sgml/lo.sgml b/doc/src/sgml/lo.sgml index 3d56ba3f70a..0c11fdc20aa 100644 --- a/doc/src/sgml/lo.sgml +++ b/doc/src/sgml/lo.sgml @@ -76,7 +76,15 @@ CREATE TRIGGER t_raster BEFORE UPDATE OR DELETE ON image For each column that will contain unique references to large objects, create a BEFORE UPDATE OR DELETE trigger, and give the column - name as the sole trigger argument. If you need multiple lo + name as the sole trigger argument. You can also restrict the trigger + to only execute on updates to the column with: + + +CREATE TRIGGER t_raster BEFORE UPDATE OF raster OR DELETE ON image + FOR EACH ROW EXECUTE PROCEDURE lo_manage(raster); + + + If you need multiple lo columns in the same table, create a separate trigger for each one, remembering to give a different name to each trigger on the same table.