From 52ca2ab26852caf5715f92fa8457eaad4be5e9cc Mon Sep 17 00:00:00 2001 From: "Thomas G. Lockhart" Date: Tue, 22 Sep 1998 15:48:03 +0000 Subject: Editing and markup cleanup. --- doc/src/sgml/ref/create_trigger.sgml | 85 +++++++++++++++++------------------- 1 file changed, 40 insertions(+), 45 deletions(-) (limited to 'doc/src/sgml/ref/create_trigger.sgml') diff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgml index b98c90aa21e..891cf209fd8 100644 --- a/doc/src/sgml/ref/create_trigger.sgml +++ b/doc/src/sgml/ref/create_trigger.sgml @@ -14,30 +14,24 @@ - 1998-04-15 + 1998-09-21 - CREATE TRIGGER name { BEFORE | AFTER } - { event [OR ...] } - ON table FOR EACH { ROW | STATEMENT } - EXECUTE PROCEDURE funcname ( arguments ) +CREATE TRIGGER name { BEFORE | AFTER } + { event [OR ...] } + ON table FOR EACH { ROW | STATEMENT } + EXECUTE PROCEDURE funcname ( arguments ) - 1998-04-15 + 1998-09-21 Inputs - - - - - - @@ -80,14 +74,11 @@ - - - - 1998-04-15 + 1998-09-21 Outputs @@ -97,6 +88,7 @@ <VARIABLELIST> <VARLISTENTRY> <TERM> +<replaceable>status</replaceable> </TERM> <LISTITEM> <PARA> @@ -120,23 +112,17 @@ <REFSECT1 ID="R1-SQL-CREATETRIGGER-1"> <REFSECT1INFO> - <DATE>1998-04-15</DATE> + <DATE>1998-09-21</DATE> </REFSECT1INFO> <TITLE> Description - CREATE TRIGGER will enter a new trigger into the current + CREATE TRIGGER will enter a new trigger into the current data base. The trigger will be associated with the relation relname and will execute the specified function funcname. - - Only the relation owner may create a trigger on this relation. - - - At release 6.3.2, STATEMENT triggers are not implemented. - The trigger can be specified to fire either before the operation is attempted on a tuple (before constraints @@ -147,24 +133,32 @@ skip the operation for the current tuple, or change the tuple being inserted (for INSERT and UPDATE operations only). If the trigger fires after the event, all changes, including the - last INSERTion, UPDATE or DELETion, are "visible" to the trigger. + last insertion, update, or deletion, are "visible" to the trigger. - Refer to the SPI and trigger programming guides for more + Refer to the chapters on SPI and Triggers in the +PostgreSQL Programmer's Guide for more information. - 1998-04-15 + 1998-09-21 Notes - CREATE TRIGGER statement is a PostgreSQL language extension. + CREATE TRIGGER is a Postgres + language extension. + + Only the relation owner may create a trigger on this relation. + + + As of the current release (v6.4), STATEMENT triggers are not implemented. + - Refer to the DROP TRIGGER statement for information on how to + Refer to DROP TRIGGER for information on how to remove triggers. @@ -179,18 +173,18 @@ table before appending or updating a row in the table films: - CREATE TRIGGER if_dist_exists - BEFORE INSERT OR UPDATE ON films FOR EACH ROW - EXECUTE PROCEDURE check_primary_key ('did', 'distributors', 'did'); +CREATE TRIGGER if_dist_exists + BEFORE INSERT OR UPDATE ON films FOR EACH ROW + EXECUTE PROCEDURE check_primary_key ('did', 'distributors', 'did'); Before cancelling a distributor or updating its code, remove every reference to the table films: - CREATE TRIGGER if_film_exists - BEFORE DELETE OR UPDATE ON distributors FOR EACH ROW - EXECUTE PROCEDURE check_foreign_key (1, 'CASCADE', 'did', 'films', 'did'); +CREATE TRIGGER if_film_exists + BEFORE DELETE OR UPDATE ON distributors FOR EACH ROW + EXECUTE PROCEDURE check_foreign_key (1, 'CASCADE', 'did', 'films', 'did'); @@ -203,29 +197,30 @@ - 1998-04-15 + 1998-09-21 SQL92 - There is no CREATE TRIGGER statement in SQL92. + There is no CREATE TRIGGER in SQL92. The second example above may also be done by using a FOREIGN KEY constraint as in: - CREATE TABLE distributors ( - did DECIMAL(3), - name VARCHAR(40), - CONSTRAINT if_film_exists FOREIGN KEY(did) REFERENCES films - ON UPDATE CASCADE ON DELETE CASCADE - ); +CREATE TABLE distributors ( + did DECIMAL(3), + name VARCHAR(40), + CONSTRAINT if_film_exists + FOREIGN KEY(did) REFERENCES films + ON UPDATE CASCADE ON DELETE CASCADE +); - However, foreign keys are not yet implemented at version 6.3.2 of - PostgreSQL. + However, foreign keys are not yet implemented (as of version 6.4) in + Postgres. -- cgit v1.2.3