X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A074ED1B28B for ; Sun, 30 May 2004 14:19:27 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 55640-10 for ; Sun, 30 May 2004 14:19:26 -0300 (ADT) Received: from web20807.mail.yahoo.com (web20807.mail.yahoo.com [216.136.226.196]) by svr1.postgresql.org (Postfix) with SMTP id BA49ED1B289 for ; Sun, 30 May 2004 14:19:23 -0300 (ADT) Message-ID: <20040530171923.67166.qmail@web20807.mail.yahoo.com> Received: from [68.107.248.174] by web20807.mail.yahoo.com via HTTP; Sun, 30 May 2004 10:19:23 PDT Date: Sun, 30 May 2004 10:19:23 -0700 (PDT) From: Jeff Eckermann Subject: Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? To: Paul Thomas , "pgsql-general @ postgresql . org" In-Reply-To: <20040529095856.A16618@bacon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200405/893 X-Sequence-Number: 61327 --- Paul Thomas 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/