pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neal Lindsay <neal.lindsay@peaofohio.com>
To: pgsql-sql@postgresql.org
Subject: Inheritence and Integrity
Date: Wed, 29 Jan 2003 14:56:10 -0500
Message-ID: <b19bkt$5t9$1@news.hub.org> (raw)

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 
there will probably be times I just need to get the basic 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 parenttable (
	recordid SERIAL PRIMARY KEY,
	recordname text
);

CREATE TABLE childtablea (
	afield int4
) INHERITS parenttable;

CREATE TABLE childtableb (
	bfield text
) INHERITS parenttable;

CREATE TABLE extrainfo (
	extrainfoid SERIAL PRIMARY KEY,
	record_fkey int4 NOT NULL REFERENCES parenttable(recordid),
	extrainfotext text
);




view thread (5+ messages)  latest in thread

Message-ID: <b19bkt$5t9$1@news.hub.org>
Permalink:  ../b19bkt$5t9$1@news.hub.org/
Also on:    postgresql.org/message-id/b19bkt$5t9$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: neal.lindsay@peaofohio.com
  Subject: Re: Inheritence and Integrity
  In-Reply-To: <b19bkt$5t9$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox