Update compatibility information.
authorPeter Eisentraut
Thu, 13 Sep 2001 18:17:44 +0000 (18:17 +0000)
committerPeter Eisentraut
Thu, 13 Sep 2001 18:17:44 +0000 (18:17 +0000)
doc/src/sgml/ref/create_trigger.sgml
doc/src/sgml/ref/drop_trigger.sgml

index 9079bda9a7ec6cada4027c378c98144f13a18327..35701b0aecef089b93574138715ebd61cde477f2 100644 (file)
@@ -1,9 +1,13 @@
 
 
 
+  2001-09-13
+
  
   CREATE TRIGGER
   SQL - Language Statements
@@ -134,78 +138,55 @@ CREATE
    PostgreSQL Programmer's Guide  for  more
    information.
   
 
-  
-   
-    1998-09-21
-   
-   </div> <div class="diff rem">-    Notes</div> <div class="diff rem">-   
-   
-    CREATE TRIGGER is a Postgres
-    language extension.
-   
-   
-    Only the relation owner may create a trigger on this relation.
-   
-   
-    As of the current release, STATEMENT triggers are not implemented.
-   
-   
-    Refer to DROP TRIGGER for information on how to 
-    remove triggers.
-      
-  
+  Notes
+
+  
+   To create a trigger on a table, the user must have the
+   TRIGGER privilege on the table.
+  
+
+  
+   As of the current release, STATEMENT triggers are not implemented.
+  
+
+  
+   Refer to the  command for
+   information on how to remove triggers.
+  
  
 
  
-  </div> <div class="diff rem">-   Usage</div> <div class="diff rem">-  
+  Examples
+
   
    Check if the specified distributor code exists in the distributors
    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');
-   
+
   
+
   
    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');
-   
+
   
-
-  </div> <div class="diff rem">-   Compatibility</div> <div class="diff rem">-  
-  
-  
-   
-    1998-09-21
-   
-   </div> <div class="diff rem">-    SQL92</div> <div class="diff rem">-   
 
-   
-    There is no CREATE TRIGGER in SQL92.
-   
-
-   
-    The second example above may also be done by using a FOREIGN KEY
-    constraint as in:
+  
+   The second example can also be done by using a foreign key,
+   constraint as in:
 
-    
+
 CREATE TABLE distributors (
     did      DECIMAL(3),
     name     VARCHAR(40),
@@ -213,9 +194,84 @@ CREATE TABLE distributors (
     FOREIGN KEY(did) REFERENCES films
     ON UPDATE CASCADE ON DELETE CASCADE  
 );
-    
-   
-  
+
+  
+
+  Compatibility
+  
+  
+   
+    SQL92
+    
+     
+      There is no CREATE TRIGGER statement in SQL92.
+     
+    
+   
+
+   
+    SQL99
+    
+     
+      The CREATE TRIGGER statement in
+      PostgreSQL implements a subset of the
+      SQL99 standard.  The following functionality is missing:
+      
+       
+        
+         SQL99 allows triggers to fire on updates to specific columns
+         (e.g., AFTER UPDATE OF col1, col2).
+        
+       
+
+       
+        
+         SQL99 allows you to define aliases for the old
+         and new rows or tables for use in the definiton
+         of the triggered action (e.g., CREATE TRIGGER ... ON
+         tablename REFERENCING OLD ROW AS somename NEW ROW AS
+         othername ...).  Since
+         PostgreSQL allows trigger
+         procedures to be written in any number of user-defined
+         languages, access to the data is handled in a
+         language-specific way.
+        
+       
+
+       
+        
+         PostgreSQL only has row-level
+         triggers, no statement-level triggers.
+        
+       
+
+       
+        
+         PostgreSQL only allows the
+         execution of a stored procedure for the triggered action.
+         SQL99 allows the execution of a number of other SQL commands,
+         such as CREATE TABLE as triggered action.
+         This limitation is not hard to work around by creating a
+         stored procedure that executes these commands.
+        
+       
+      
+     
+    
+   
+  
+
+  See Also
+
+  
+   
+   
+   PostgreSQL Programmer's Guide
+  
  
 
 
index 81a9219f100c87eaa03727c87b0037cf5462e08a..f1bfdadf61f95ccd8257c44a4945bd917807cc0c 100644 (file)
@@ -1,9 +1,13 @@
 
 
 
+  2001-09-13
+
  
   
    DROP TRIGGER
@@ -101,58 +105,58 @@ ERROR: DropTrigger: there is no trigger name
   
    DROP TRIGGER will remove all references to an existing
    trigger definition. To execute this command the current
-   user must be the owner of the trigger.
+   user must be the owner of the table for which the trigger is defined.
   
-
-  
-   
-    1998-09-22
-   
-   </div> <div class="diff rem">-    Notes</div> <div class="diff rem">-   
-   
-    DROP TRIGGER is a Postgres
-    language extension.
-   
-   
-    Refer to CREATE TRIGGER for
-    information on how to create triggers.
-   
-  
  
-  
-  </div> <div class="diff rem">-   Usage</div> <div class="diff rem">-  
+
+  Examples
+
   
    Destroy the if_dist_exists trigger
    on table films:
 
-   
+
 DROP TRIGGER if_dist_exists ON films;
-   
+
   
  
  
-  </div> <div class="diff rem">-   Compatibility</div> <div class="diff rem">-  
+  Compatibility
   
-  
-   
-    1998-09-22
-   
-   </div> <div class="diff rem">-    SQL92</div> <div class="diff rem">-   
-   
-    There is no DROP TRIGGER statement in
-    SQL92.
-   
-  
+  
+   
+    SQL92
+    
+     
+      There is no DROP TRIGGER statement in
+      SQL92.
+     
+    
+   
+
+   
+    SQL99
+    
+     
+      The DROP TRIGGER statement in
+      PostgreSQL is incompatible with
+      SQL99.  In SQL99, trigger names are not local to tables, so the
+      command is simply DROP TRIGGER
+      name.
+     
+    
+   
+  
+
+  See Also
+
+  
+   
+