diff options
author | Bruce Momjian <bruce@momjian.us> | 2012-08-14 23:21:13 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2012-08-14 23:21:28 -0400 |
commit | 9e84cccff28e52ab76aa3d3e88bd815dc36d24d8 (patch) | |
tree | 5fa8e6cbba4e16f63866296ffca5771f4419be41 /doc/src | |
parent | e45ae401811e4fe07d2fc6ca8e44e9e38e0b3ba2 (diff) | |
download | postgresql-9e84cccff28e52ab76aa3d3e88bd815dc36d24d8.tar.gz postgresql-9e84cccff28e52ab76aa3d3e88bd815dc36d24d8.zip |
Add doc example of restricting large object trigger firing to only
updates of the column of interest.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/lo.sgml | 10 |
1 files changed, 9 insertions, 1 deletions
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 <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> |