RE: Trailing spaces in char or varchar fields

Поиск
Список
Период
Сортировка
От Huy Do
Тема RE: Trailing spaces in char or varchar fields
Дата
Msg-id NEBBIHDFCLBAILBDEADCAEDMCAAA.huy@travel.com.au
обсуждение исходный текст
Ответ на Re: Trailing spaces in char or varchar fields  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Trailing spaces in char or varchar fields
Список pgsql-novice

> -----Original Message-----
> From: pgsql-novice-owner@postgresql.org
> [mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Tom Lane
> Sent: Friday, January 05, 2001 11:26 AM
> To: Huy Do
> Cc: PostgreSQL-Novice
> Subject: Re: Trailing spaces in char or varchar fields
>
>
> "Huy Do" <huy@travel.com.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
>

Sorry, i just got a bit mixed up. What I really meant was that postgres
pads char fields. Varchar fields aren't padded so my question now is,
is there any major disadvantages of changing all my char fields to
varchar fields or should i just stick to changing those that are absolutely
necessary. The fields which I will be changing will be primary keys so I
think there should be some performance trade offs.

Thanks

Huy

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Trailing spaces in char or varchar fields
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Trailing spaces in char or varchar fields