UNIQUE constraints on function results

Поиск
Список
Период
Сортировка
От Markus Schiltknecht
Тема UNIQUE constraints on function results
Дата
Msg-id 4524CD6C.70101@bluegap.ch
обсуждение исходный текст
Ответы Re: UNIQUE constraints on function results  (Emanuele Rocca <ema@linux.it>)
Re: UNIQUE constraints on function results  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi,

I've been trying to add a unique constraint on a row and a function
result of a row. I.e.:

CREATE TABLE test (
    id SERIAL PRIMARY KEY,
    t1 TEXT NOT NULL,
    t2 TEXT NOT NULL,
    UNIQUE (t1, lower(t2)));

That fails with a syntax error (on 8.2beta1). While UNIQUE(t1, t2) works
like a charm, it's not exactly what I want.

I can easily create an index for my needs [1], why can I not add such a
unique constraint? Thanks for clarification.

Regards

Markus


[1]: CREATE INDEX test_idx ON test(t1, lower(t2));


В списке pgsql-general по дате отправления:

Предыдущее
От: Alexander Staubo
Дата:
Сообщение: Re: Major Performance decrease after some hours
Следующее
От: "Peter Bauer"
Дата:
Сообщение: Re: Major Performance decrease after some hours