Constraint?

From: David Fetter <david(at)fetter(dot)org>
To: SF Postgres <sfpug(at)postgresql(dot)org>
Subject: Constraint?
Date: 2002-12-12 00:36:28
Message-ID: 20021212003628.GA16838@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: sfpug

Kind people,

I'm trying to create a table as follows:

CREATE TABLE media (
media_id SERIAL NOT NULL PRIMARY KEY
, media_type_id INTEGER NOT NULL REFERENCES media_type(media_type_id)
, media_title VARCHAR(255) NOT NULL
, UNIQUE(LOWER(media_title), media_type_id)
);

This barfs with a parse error.

If I leave out the LOWER() part, it works, but I want the thing to be
unique up to case. What's to do?

Big TIA for any hints on this, and I hope to see at least some of you
this evening :)

Cheers,
D
--
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 cell: +1 415 235 3778

Responses

Browse sfpug by date

  From Date Subject
Next Message Stephan Szabo 2002-12-12 01:04:26 Re: Constraint?
Previous Message Josh Berkus 2002-12-11 18:02:07 Re: bookpool.com