| От | Tom Lane |
|---|---|
| Тема | Re: An easy question about creating a primary key |
| Дата | |
| Msg-id | 20774.1007431941@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: An easy question about creating a primary key ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>) |
| Список | pgsql-sql |
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> I have submitted code for 7.2b3 that allows ADD UNIQUE after table creation,
> but you'll have to wait until 7.3 for ADD PRIMARY KEY after table createion.
I think you've forgotten your own work, Chris.
regression=# create table foo (bar int not null);
CREATE
regression=# alter table foo add primary key (bar);
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'foo_pkey' for table 'foo'
CREATE
regression=#
Having to have marked the columns as "not null" from the beginning is a
painful limitation, but it's not like the feature doesn't exist at all.
regards, tom lane
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера