]> granicus.if.org Git - postgresql/commitdiff
Add doc example of restricting large object trigger firing to only
authorBruce Momjian <bruce@momjian.us>
Wed, 15 Aug 2012 03:21:13 +0000 (23:21 -0400)
committerBruce Momjian <bruce@momjian.us>
Wed, 15 Aug 2012 03:21:28 +0000 (23:21 -0400)
updates of the column of interest.

doc/src/sgml/lo.sgml

index 3d56ba3f70af7d905116c8d9fcc68af4f10e182f..0c11fdc20aaff9e2eb623860ecfda54c41686c26 100644 (file)
@@ -76,7 +76,15 @@ CREATE TRIGGER t_raster BEFORE UPDATE OR DELETE ON image
   <para>
    For each column that will contain unique references to large objects,
    create a <literal>BEFORE UPDATE OR DELETE</> trigger, and give the column
-   name as the sole trigger argument.  If you need multiple <type>lo</>
+   name as the sole trigger argument.  You can also restrict the trigger
+   to only execute on updates to the column with:
+
+<programlisting>
+CREATE TRIGGER t_raster BEFORE UPDATE OF raster OR DELETE ON image
+    FOR EACH ROW EXECUTE PROCEDURE lo_manage(raster);
+</programlisting>
+
+   If you need multiple <type>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.
   </para>