Modifying existing tables

Поиск
Список
Период
Сортировка
От Steve Doerr
Тема Modifying existing tables
Дата
Msg-id 3B6A1C81.2D9D4E70@swbell.net
обсуждение исходный текст
Список pgsql-admin
Is this the only way to add attributes to an existing table, and add
unique and a default(for example) to existing attributes?

Just wondered if there are alternatives.  I didn't really see this in
the docs or mailing lists.

Thanks for any input.
Steve

original table:
CREATE TABLE table (
    attrib1 int,
    attrib2 int,
);


table edit:
CREATE TABLE newtable (
    attrib1 int UNIQUE,
    attrib2 int DEFAULT 1,
    attrib3 int
);

INSERT INTO newtable (attrib1, attrib2)
SELECT attrib1, attrib2 FROM table;

DROP TABLE table;
ALTER TABLE newtable RENAME TO table;



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Memory exhausted errors
Следующее
От: "Jason"
Дата:
Сообщение: A replication like process