cannot use column references in default expression?

From: Jignesh Shah <jignesh(dot)shah1980(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: cannot use column references in default expression?
Date: 2010-05-28 17:20:29
Message-ID: AANLkTik7etizTd5h8sZScZc5er-XRIT-BtEga2kVQvLY@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Could anyone please help me to get rid of following error? I want to set the
'ishuman' column based on the value of 'ID' column but it is not allowing me
to do so. Any alternatives?

techdb=> CREATE TABLE Users (
ID INTEGER,
isHuman BOOLEAN NOT NULL
DEFAULT (ID IS NULL)
CHECK (isHuman = ID IS NULL),
Name VARCHAR NOT NULL);
ERROR: cannot use column references in default expression
techdb=>

Thanks,
Jignesh

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-05-28 17:27:39 Re: INSERTing lots of data
Previous Message Tatsuo Ishii 2010-05-28 17:06:02 Re: No lidbl.so in libpq.so (postgresql 8.4.4)