Re: Trailing spaces in char or varchar fields

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Huy Do" <huy(at)travel(dot)com(dot)au>
Cc: "PostgreSQL-Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Trailing spaces in char or varchar fields
Date: 2001-01-05 01:26:11
Message-ID: 25262.978657971@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Huy Do" <huy(at)travel(dot)com(dot)au> writes:
> Is there a way to get postgres to keep the trailing spaces
> in a field. I have an existing database which I am porting
> to postgresql. This database allows fields to have trailing
> spaces and many key fields have trailing spaces to distinguish
> uniqueness (i know this is bad but it's legacy stuff).
> When I dump my database and try to copy it into postgresql, it
> complains about duplicate keys because postgres is trimming the
> spaces.

Postgres does not trim trailing spaces. I suspect that that behavior
is coming from whatever tool you used to transfer the data.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Huy Do 2001-01-05 02:15:41 RE: Trailing spaces in char or varchar fields
Previous Message Huy Do 2001-01-05 00:38:13 Trailing spaces in char or varchar fields