| От | Tom Lane |
|---|---|
| Тема | Re: character type modification |
| Дата | |
| Msg-id | 25915.1071648138@sss.pgh.pa.us обсуждение |
| Ответ на | character type modification (Jodi Kanter <jkanter@virginia.edu>) |
| Список | pgsql-admin |
Jodi Kanter <jkanter@virginia.edu> writes:
> Can I alter a column from character varying(128) to text without having
> to create a temp table? I am running 7.3.3.
Yeah, if you're brave enough: change the column's atttypid to 'text'
(25, I think, but check it) and atttypmod to -1 in pg_attribute.
This is sufficient since the two datatypes have the same representation
--- in general you can't just hack atttypid at random, but it will
work in this case.
Highly advisable to practice this maneuver in a scratch database.
BTW, if you're running 7.3.3 and not 7.3.4 (even better 7.3.5), you are
not being brave but foolish. 7.3.3's WAL-startup-failure bug will get
you sooner or later.
regards, tom lane
В списке pgsql-admin по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера