Re: [GENERAL] Foreign Key question

2009-06-03 Thread Dave Clarke
On Jun 3, 1:04 am, wmo...@potentialtech.com (Bill Moran) wrote: > In response to Dave Clarke : > > > > > > > I have a table that I'm trying to refactor and I'm by no means a SQL > > expert (apologies if I'm posting to the wrong group). The table in > > question has a column that allows NULLs. I wan

Re: [GENERAL] Foreign Key question

2009-06-02 Thread Bill Moran
In response to Dave Clarke : > > I have a table that I'm trying to refactor and I'm by no means a SQL > expert (apologies if I'm posting to the wrong group). The table in > question has a column that allows NULLs. I want to move that column > into a separate table and set up a FK reference back to

Re: [GENERAL] Foreign Key question

2009-06-02 Thread Daniel Schuchardt
Hi Dave, that makes sense. You should read the documentation about FK. They can be 1:n, 1:1, n:1. Normally i would make a unique field in each table to avoid complex PK/FK. Eg a serial column. Dave Clarke schrieb: Hello I have a table that I'm trying to refactor and I'm by no means a SQL ex

[GENERAL] Foreign Key question

2009-06-01 Thread Dave Clarke
Hello I have a table that I'm trying to refactor and I'm by no means a SQL expert (apologies if I'm posting to the wrong group). The table in question has a column that allows NULLs. I want to move that column into a separate table and set up a FK reference back to the original table. My question

Re: [GENERAL] Foreign key question

2004-01-15 Thread Tom Lane
Terry Lee Tucker <[EMAIL PROTECTED]> writes: > From the HTML docs: > "The referenced columns must be the columns of a unique or primary key > constraint in the referenced table." > I personally don't know of a work around. Maybe some of the others do. There is no workaround, because foreign keys

Re: [GENERAL] Foreign key question

2004-01-15 Thread Stephan Szabo
On Thu, 15 Jan 2004, [ISO-8859-1] Victor Spång Arthursson wrote: > New to foreign keys and have some questions > > The first is, i have a language table with a primary key on the fields > lang and relid: > > relid | lang |text > ---+--+- > 1 | uk | hello > 1

Re: [GENERAL] Foreign key question

2004-01-15 Thread Terry Lee Tucker
From the HTML docs: "The referenced columns must be the columns of a unique or primary key constraint in the referenced table." I personally don't know of a work around. Maybe some of the others do. On Thursday 15 January 2004 10:56 am, Victor Spång Arthursson wrote: > New to foreign keys and

[GENERAL] Foreign key question

2004-01-15 Thread Victor Spång Arthursson
New to foreign keys and have some questions… The first is, i have a language table with a primary key on the fields lang and relid: relid | lang |text ---+--+- 1 | uk | hello 1 | dk | hej 1 | de | guten tag 2 | uk | world 2 | dk | værld