Re: Casting bytea to varchar

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Casting bytea to varchar
Дата
Msg-id 25980.1358264400@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Casting bytea to varchar  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Ответы Re: Casting bytea to varchar  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Список pgsql-admin
Albe Laurenz <laurenz.albe@wien.gv.at> writes:
> You cannot specify a conversion function while altering
> a column's type, you'd have to use a new column like this:

Sure you can; that's the whole point of the USING option.
It'd look something like

ALTER TABLE test ALTER COLUMN val TYPE varchar(255) USING convert(val);

with whatever is appropriate in place of convert().

But the real question of course is what is "appropriate" for the OP's
situation --- he didn't specify exactly what he's got in his bytea
column or how that should be converted to varchar.

            regards, tom lane


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Postgres WAL Recovery Fails... And Then Works...
Следующее
От: Albe Laurenz
Дата:
Сообщение: Re: Casting bytea to varchar