Re: [HACKERS] char(8) vs char8

From: Byron Nikolaidis <byronn(at)insightdist(dot)com>
To: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] char(8) vs char8
Date: 1998-05-14 14:55:08
Message-ID: 355B05CC.350843F1@insightdist.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

D'Arcy J.M. Cain wrote:

> This was an unexpected difference between these two types and I wonder
> if it was meant to be this way. Previously, a char8 field with the
> string 'abc' would return 'abc' as expected. Now, with char(8), I get
> back 'abc ' instead. You can see this with my PygreSQL module
> or the C interface (which my module uses, of course.) This causes a
> lot of my programs to break.
>

char(x) is the datatype 'bpchar' (blank padded char). Thus it is padded
with spaces to the field width.

Couldn't you use something like "select rtrim(column) from table". This
will trim the spaces off.

Byron

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-05-14 14:55:34 Re: AW: [HACKERS] mmap and MAP_ANON
Previous Message Bruce Momjian 1998-05-14 14:54:09 Re: [HACKERS] Sequential scan speed, mmap, disk i/o