Re: how to modify a field

Поиск
Список
Период
Сортировка
От Jason Earl
Тема Re: how to modify a field
Дата
Msg-id 87y9ja81jf.fsf@npa01zz001.simplot.com
обсуждение исходный текст
Ответ на how to modify a field  ("Terry BD7NQ" <bd7nq@hellocq.net>)
Список pgsql-novice
Unfortunately there isn't really a good way to do this in PostgreSQL.
What you are probably going to end up doing is creating a temporary
table with the new schema that you want, copying that data to this new
table with an 'insert into' query, delete the old table, and rename
the new table.

You will probably also want to get rid of the sequence object that
your serial type created, and heaven help you if you had a pile of
triggers set for this table.

Good Luck,
Jason

"Terry BD7NQ" <bd7nq@hellocq.net> writes:

> Hi Gentleman,
>
> 1. How to modify a field in the table structure, such I have a filed name
> 'userid', its type is serial, now I want to change ti to varchar?
> 2. How to delete a field in the table structure?
>
> Terry
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

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

Предыдущее
От: "Terry BD7NQ"
Дата:
Сообщение: how to modify a field
Следующее
От: David Link
Дата:
Сообщение: Postgres and XML