Re: [GENERAL] Tr: UNIQUE

Поиск
Список
Период
Сортировка
От José Soares
Тема Re: [GENERAL] Tr: UNIQUE
Дата
Msg-id 37AB08CA.61CF998@sferacarta.com
обсуждение исходный текст
Ответ на Tr: UNIQUE  ("Stéphane FILLON" <fillons@offratel.nc>)
Список pgsql-general
Try this:

create table amount(
  id int4 constraint pk_amount primary key,
  fk_acount int4 not null,
  code char(3) not null,
  constraint unico unique (fk_acount, code)
);

José



Stéphane FILLON ha scritto:

> -----Message d'origine-----
> De : Stéphane FILLON <fillons@offratel.nc>
> À : pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>;
> pgsql-novice@postgresql.org <pgsql-novice@postgresql.org>
> Date : dimanche 1 août 1999 09:12
> Objet : Tr: UNIQUE
>
> >>Hi !
> >>
> >>I have a table with a primary key id to have a unique tuple and
> >>
> >>I want to check that (fk_acount + code) is unique.
> >>
> >>I don't know how to create this CHECK CONSTRAINT
> >>
> >>create table amount(
> >>  id int4 constraint pk_amount primary key,
> >>  fk_acount int4 not null,
> >>  code char(3) not null
> >>);
> >>
> >>Thanks in advance.
> >>
> >>Stephane
> >>
> >>
> >


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] What is R_PLANS?
Следующее
От: Dustin Sallings
Дата:
Сообщение: Re: [GENERAL] Database on read only directory