Re: moving char() to varchar()

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: moving char() to varchar()
Дата
Msg-id Pine.LNX.4.33L2.0109071706070.5974-100000@aguila.protecne.cl
обсуждение исходный текст
Ответ на Re: moving char() to varchar()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Fri, 7 Sep 2001, Tom Lane wrote:

> Andrew Sullivan <andrew@libertyrms.com> writes:
> > 1.    I thought the SQL spec required varchar() not to pad.  Is it
> > just that, because of the way pg_dump saved the char() data (as
> > blank-padded) that the varchar() field preserves the padded data?
>
> You could possibly make an argument that trailing blanks in a char()
> column (which ARE known to be padding) should be stripped during dumping,
> primarily for convenience in reloading into varchar columns.  But this
> seems a tad weird and unexpected to me.  An explicit trim() operation
> sounds like a better idea.

Maybe you can modify the pg_dump source to use trim() on the output
columns when given a --trim-char-columns :-)

--
Alvaro Herrera (<alvherre[@]atentus.com>)


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: What Is The Firing Order?
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Problem w/ dumping huge table and no disk space