Skip site navigation (1) Skip section navigation (2)

Significant spaces

From: Steve Tucknott <steve(at)retsol(dot)co(dot)uk>
To: PostGre <pgsql-novice(at)postgresql(dot)org>
Subject: Significant spaces
Date: 2004-07-30 12:35:56
Message-ID: 1091190958.1299.19.camel@retsol1 (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
PostGreSQL 7.2.4

Can anyone tell me where trailing spaces are significant in CHAR,
VARCHAR and TEXT fields?

We pass a VARCHAR variable into a 3rd party language product 'function'
as a CHAR(250). The CHAR(250) field is then used to interrogate a table
to see if that value exists. If not, a row with that value is inserted
into the table as a VARCHAR(N). The issue is that the value when
inserted into the VARCHAR in the table appears to carry trailing spaces,
so when a subsequent lookup is performed with the same value, the value
is not 'found' and a further insert occurs.
The problem appears to disappear if I change the definition of the
passed parameter to a VARCHAR as well.
Is this a known issue?


Steve Tucknott

ReTSol Ltd

DDI: 01903 828769


pgsql-novice by date

Next:From: Joel RodriguesDate: 2004-07-30 17:42:30
Subject: contrib/xml make error on Mac OS X 10.3.4
Previous:From: Tom LaneDate: 2004-07-29 22:01:07
Subject: Re: catching up an id sequence

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group