On Wed, 24 Oct 2007 09:43:10 +0200
Nis Jørgensen <[EMAIL PROTECTED]> wrote:
> Well, I have a couple of times had the "need" to have a primary
> key/uniqueness constraint with one column nullable (indicating "Not
> Applicable"). The "problem" is that we have only one NULL, which for
> comparison pur
Forgive my butting in, but frankly, most of the times, whenever I find
myself in a very 'exceptional problem' such as this one, I always end up
questioning the basic design due to which I am stuck in the first place.
Paul, it seems that probably there is a basic design issue here.
All the best :)
Paul Lambert wrote:
It's marked not null as a result of being part of the primary key for
that table which I can't really get around.
I can get away with not having the foreign key though, so I'll have to
go down that path.
Cheers,
P.
Ignore this whole thread actually.
I need to rethin
D'Arcy J.M. Cain skrev:
> On Wed, 24 Oct 2007 11:00:47 +0800
> Paul Lambert <[EMAIL PROTECTED]> wrote:
>> It's marked not null as a result of being part of the primary key for
>> that table which I can't really get around.
>>
>> I can get away with not having the foreign key though, so I'll have t
On Wed, 24 Oct 2007 11:00:47 +0800
Paul Lambert <[EMAIL PROTECTED]> wrote:
> It's marked not null as a result of being part of the primary key for
> that table which I can't really get around.
>
> I can get away with not having the foreign key though, so I'll have to
> go down that path.
It can
Tom Lane wrote:
If I'm understanding you correctly, the problem is not the foreign key,
it's that you marked the column NOT NULL. A foreign key constraint by
itself will allow a NULL in the referencing column to pass. You choose
whether you want to allow that or not by separately applying a NO
Paul Lambert <[EMAIL PROTECTED]> writes:
> I have a table where one column references by foreign key a column from
> another table. However, the column in this first table does not always
> contain data which results in a not-null constraint violation when I
> attempt an insert.
> My question t
> My question therefore is, is it possible to create a foreign key that is
> conditional, i.e. only enforce the foreign key where the value in that
> table is not null.
My understanding from reading previous threads on this topic is the answer
is no, however you could make your own pseudo-foreign
I have a table where one column references by foreign key a column from
another table. However, the column in this first table does not always
contain data which results in a not-null constraint violation when I
attempt an insert.
My question therefore is, is it possible to create a foreign ke