Search Postgresql Archives
Deleted Flag/Unique Constraint
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: pgsql-general@xxxxxxxxxxxxxx
- Subject: Deleted Flag/Unique Constraint
- From: "Bryan Murphy" <bryan.murphy@xxxxxxxxx>
- Date: Thu, 29 Mar 2007 16:39:58 -0500
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=IH1MSg9t8MKcYv+EkqpRkvd4nj8uy6EXyjv+yf8VsC6hEzSZlUZ0nQ6rI1zQr/hlK4AfSieF0ooeB84AifXgKqCCB2nFrekv0TsTex+cQIWZtXF916x00xX1/Ct1MnIDAhjUpExTDjXirCi42/ToKzoiifRDardPaXvVsrsKKUI=
Is it possible to declare a unique constraint in combination with a deleted flag?
For example, if I have a table like this:
CREATE TABLE
(
ID NOT NULL PRIMARY KEY,
Key VARCHAR(32) NOT NULL,
Value VARCHAR(32) NOT NULL,
Deleted INT NOT NULL DEFAULT 0
);
can I declare a unique constraint that only checks Key and Value when Deleted = 0?
Thanks,
Bryan
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]
[Postgresql Jobs]
[Postgresql Admin]
[Postgresql Performance]
[Linux Clusters]
[PHP Home]
[PHP on Windows]
[Kernel Newbies]
[PHP Classes]
[PHP Books]
[PHP Databases]
[Postgresql & PHP]
[Yosemite]