Re: [SQL] Foreign Key for multi PK or design question

2007-12-11 Thread PostgreSQL Admin
No problems with the design - I was not thinking with the DB hat on at first. I have been working on clustering for a while... just adjusting. Thanks everyone. :) ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] Foreign Key for multi PK or design question

2007-12-11 Thread A. Kretschmer
am Tue, dem 11.12.2007, um 14:12:38 -0500 mailte PostgreSQL Admin folgendes: > This is my layout so far: > [ table-layout] > ... > Does this look correct? Yes, why not? Do you have problems? Which? I can't see problems, it's a normalized design IMHO. Andreas -- Andreas Kretschmer Kontakt: Hey

Re: [SQL] Foreign Key for multi PK or design question

2007-12-11 Thread Alvaro Herrera
PostgreSQL Admin wrote: > This is my layout so far: > > CREATE TABLE users ( > id serial NOT NULL, > --question REFERENCES questions(id) ON DELETE CASCADE ## ON REMOVED## > ); > > CREATE TABLE questions ( > id serial NOT NULL, > questions varchar(450) NOT NULL > ); > > CREATE TABLE answers ( > i

Re: [SQL] Foreign Key for multi PK or design question

2007-12-11 Thread PostgreSQL Admin
This is my layout so far: CREATE TABLE users ( id serial NOT NULL, --question REFERENCES questions(id) ON DELETE CASCADE ## ON REMOVED## ); CREATE TABLE questions ( id serial NOT NULL, questions varchar(450) NOT NULL ); CREATE TABLE answers ( id serial NOT NULL, question_id int REFERENCES questi

Re: [SQL] Foreign Key for multi PK or design question

2007-12-11 Thread A. Kretschmer
am Tue, dem 11.12.2007, um 13:20:52 -0500 mailte PostgreSQL Admin folgendes: > I have a table in which people will have a number of questions to > answer. I want those pk to be placed in my user table. So if a user > answers three question I want those 3 pk's in the user table (fk). > What s

Re: [SQL] Foreign Key for multi PK or design question

2007-12-11 Thread Erik Jones
On Dec 11, 2007, at 12:20 PM, PostgreSQL Admin wrote: I have a table in which people will have a number of questions to answer. I want those pk to be placed in my user table. So if a user answers three question I want those 3 pk's in the user table (fk). What should I be doing? You're goi

[SQL] Foreign Key for multi PK or design question

2007-12-11 Thread PostgreSQL Admin
I have a table in which people will have a number of questions to answer. I want those pk to be placed in my user table. So if a user answers three question I want those 3 pk's in the user table (fk). What should I be doing? Thanks in advance, J ---(end of broadcast)