Re: Changing column modifiers?

Поиск
Список
Период
Сортировка
От missive@frontiernet.net (Lee Harr)
Тема Re: Changing column modifiers?
Дата
Msg-id 9njlp5$219s$1@news.tht.net
обсуждение исходный текст
Ответ на Changing column modifiers?  (Tim Boring <tboring@insight.rr.com>)
Список pgsql-admin
On Mon, 10 Sep 2001 01:25:59 +0000 (UTC), Tim Boring <tboring@insight.rr.com>:
> Can you change a column modifier after you've created the table?  For
> example, I have a table called "authors" with the following columns:
> authorid, authorfirstname, authorlastname, authormi, statecode, country,
> born, deceased.
>
> When I created the table, I forgot to make the "authorfirstname" and
> "authorlastname" columns NOT NULL.  I've looked at ALTER TABLE but I
> don't see a way to use it to add NOT NULL...maybe I'm just missing the
> obvious?
>

How about creating a new table as you like it, then
selecting the data from the old table into the new one
dropping the old table and renaming the new one?

Roundabout, but might be useful.


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

Предыдущее
От: "Michael Baker"
Дата:
Сообщение: Transaction Aborting on sql call failure
Следующее
От: "Nick Fankhauser"
Дата:
Сообщение: Can't get postmaster to restart after removing WAL files