Re: [SQL] automatic time/user stamp - rule or trigger?

2003-02-05 Thread Neal Lindsay
Jan Wieck wrote: A rule will not work here because rules cannot cause the same action on the same table they are called for. A-ha! I guess that's what I wasn't understanding. Triggers it is then. Thanks, -Neal ---(end of broadcast)--- TIP 1: su

[SQL] automatic time/user stamp - rule or trigger?

2003-02-05 Thread Neal Lindsay
I have a table that I want to keep track of the user who last modified it and the timestamp of the modification. Should I use a trigger or a rule? CREATE TABLE stampedtable ( stampedtableid SERIAL PRIMARY KEY, updatestamp timestamp NOT NULL DEFAULT now(), updateuser name NOT NULL DEFAULT curre

Re: [SQL] Inheritence and Integrity

2003-01-29 Thread Neal Lindsay
Stephan Szabo wrote: On Wed, 29 Jan 2003, Neal Lindsay wrote: I am creating a database that will keep track of several different types of 'events'. I am toying with the idea of making a base 'class' table for the tables because a lot of the information will be the same (also

[SQL] Inheritence and Integrity

2003-01-29 Thread Neal Lindsay
c information about events regardless of their type). My question is: will triggers and rules on the parent table fire when I insert data in the child tables? Are there any other potential pitfalls? Thank you, -Neal Lindsay P.S. Here is a simplified example of my schema: CREATE TABLE parenttabl