Re: moving char() to varchar() - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: moving char() to varchar()
Date
Msg-id Pine.LNX.4.33L2.0109071706070.5974-100000@aguila.protecne.cl
Whole thread Raw
In response to Re: moving char() to varchar()  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: What Is The Firing Order?
Next
From: Alvaro Herrera
Date:
Subject: Re: Problem w/ dumping huge table and no disk space