| От | Tom Lane |
|---|---|
| Тема | Re: PK with an expression in field list |
| Дата | |
| Msg-id | 1070.1148499886@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | PK with an expression in field list ("Alejandro Michelin Salomon \( Adinet \)" <alejmsg@adinet.com.uy>) |
| Ответы |
RES: PK with an expression in field list
|
| Список | pgsql-general |
"Alejandro Michelin Salomon \( Adinet \)" <alejmsg@adinet.com.uy> writes:
> I need create a PK for a table.
> This PK has 3 fields.
> PK is : CONSTRAINT ff_navios PRIMARY KEY ( idempresa, idarmador, UPPER( nome
> ) )
> But seems not work.
You can't define a primary key on an expression. The SQL standard says
so, and even if we wanted to generalize the standard here, we'd have a
bit of a problem with how it'd show up in the information_schema.
You can, however, create a unique index over those values and get pretty
much the same effect.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера