Re: changeing type of column

Поиск
Список
Период
Сортировка
От wsheldah@lexmark.com
Тема Re: changeing type of column
Дата
Msg-id 200204021956.OAA18342@interlock2.lexmark.com
обсуждение исходный текст
Ответ на changeing type of column  ("Yuri A. Kabaenkov" <sec@artofit.com>)
Список pgsql-general

Use the pg_dump command to dump both the schema and data to an ascii file. Make
a backup of that file, then edit it and change the column definition to varchar
(any reason not to use text instead?).

Then you'll want to write a short script to put single quotes around every
integer value of that column; I would probably use perl, but there are lots of
ways to do this.

Then just run pg_restore and you should be set. Hope this helps,

Wes




"Yuri A. Kabaenkov" <sec%artofit.com@interlock.lexmark.com> on 04/02/2002
01:18:48 PM

Please respond to "Yuri A. Kabaenkov" <sec%artofit.com@interlock.lexmark.com>

To:   pgsql-general%postgresql.org@interlock.lexmark.com
cc:    (bcc: Wesley Sheldahl/Lex/Lexmark)
Subject:  [GENERAL] changeing type of column



I've know that there is no function to change type of column in postgresql
table.
But i have a table with serial field (sequence) and many other field.
And i need to change one field from int4 to varchar.

What is the best way to do it ?








--
Best regards,
 Yuri                          mailto:sec@artofit.com


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org







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

Предыдущее
От: Bill Gribble
Дата:
Сообщение: How to handle sequences and replication?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: retun cursor