[SQL] Simple plpgsql question

2006-04-13 Thread Todd Kennedy
Hi, I have, what I hope to be, a simple question about plpgsql. I have a trigger on a table right now that updates a count everytime that a new record is entered into a database (or removed). What I'd also like to do is have it create a new row in a different table using the automatically

[SQL] Question about One to Many relationships

2006-03-24 Thread Todd Kennedy
Hi, This should be a simple idea, but I've been going back and forth on it with various people in my tech group. So I've got two tables, one for albums and one for bands, for simplicity's sake, they look like this: CREATE TABLE bands ( id serial PRIMARY KEY, name varchar(64) NOT NULL CHECK(

Re: [SQL] Question about One to Many relationships

2006-03-24 Thread Todd Kennedy
for your help. On 3/24/06, Joe [EMAIL PROTECTED] wrote: Todd Kennedy wrote: They haven't responded me as of yet. There should be a band associated with each album -- this is handled in code, but other than that this is the only relational db way I can think of to do it. But if a band can