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

Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it?

From: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
To: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>,"pgsql-general (at) postgresql (dot) org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it?
Date: 2004-05-30 17:19:23
Message-ID: 20040530171923.67166.qmail@web20807.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-novicepgsql-odbc
--- Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk> wrote:
> 
> On 28/05/2004 20:46 Jeff Eckermann wrote:
> > I had a thought that the ODBC driver could be
> > stripping the trailing spaces, but the test I just
> did
> > (using MS Access via ODBC) worked fine.
> 
> But that's using a different ODBC driver so won't
> show a possible bug in 
> the PG driver.

PgAdminII uses the psqlodbc driver.  It's pgAdminIII
that does not.

> 
> > Thinking some more, I used a "text" type field for
> my
> > test.  I have some recollection that varchar(n)
> fields
> > _will_ strip trailing spaces.  But I'm too lazy to
> > test that right now.
> 
> I was testing using a varchar(n) field.

Which I just tested, and found to work fine.  My
recollection of the space-stripping behaviour of
varchar(n) appears to be off.

All of which is academic, seeing that the OP solved
his problem by using char(n).  But that leaves wide
open the question of why that would work, when
varchar(n) or text do not.

> 
> -- 
> Paul Thomas
>
+------------------------------+---------------------------------------------+
> | Thomas Micro Systems Limited | Software Solutions
> for 
> Business             |
> | Computer Consultants         | 
> http://www.thomas-micro-systems-ltd.co.uk   |
>
+------------------------------+---------------------------------------------+
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the
> postmaster-------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

In response to

pgsql-novice by date

Next:From: Derrick BettsDate: 2004-05-31 05:31:17
Subject: Dynamic Array into pl/pgSQL function
Previous:From: Martin HamplDate: 2004-05-30 10:30:14
Subject: Turn off Wal for bulk loaf input

pgsql-odbc by date

Next:From: HÃ¥kon ClausenDate: 2004-05-31 13:05:01
Subject: 7.4 backend protocol
Previous:From: Paul ThomasDate: 2004-05-29 08:58:56
Subject: Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it?

pgsql-general by date

Next:From: John WellsDate: 2004-05-30 17:55:01
Subject: Large table search question
Previous:From: Jurgen DefurneDate: 2004-05-30 16:29:55
Subject: Error handling in stored functions/procedures

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