Re: trimming a column - Mailing list pgsql-general

From Michael P. Soulier
Subject Re: trimming a column
Date
Msg-id 20120504031342.GT5230@mitel.com
Whole thread Raw
In response to Re: trimming a column  (Adrian Klaver <adrian.klaver@gmail.com>)
Responses Re: trimming a column
List pgsql-general
On 03/05/12 Adrian Klaver said:

> Works here:
> test=> SELECT version();
>                                         version
> ---------------------------------------------------------------------------------------
>  PostgreSQL 9.0.7 on i686-pc-linux-gnu, compiled by GCC gcc (SUSE
> Linux) 4.6.2, 32-bit

eventsdb=# select version();
                                                  version

--------------------------------------------------------------------------------
----------------------------
 PostgreSQL 8.4.10 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.4.5
2011021
4 (Red Hat 4.4.5-6), 32-bit
(1 row)


Perhaps it how the fields are displayed...

eventsdb=# select length(id), id from application_events;
 length |                                                  id

--------+-----------------------------------------------------------------------
-------------------------------
     48 | vmbg-msoulier3.nssg.mitel.com_1-1335549662-26268

     44 | vmbg-msoulier3.nssg.mitel.com_1-1335549687-0

     27 | tug-manage-ssl-1335549693-0

     46 | vmbg-msoulier3.nssg.mitel.com_1-1335553128-344

     44 | vmbg-msoulier3.nssg.mitel.com_1-1335553152-0

     27 | tug-manage-ssl-1335553155-0

     44 | vmbg-msoulier3.nssg.mitel.com_1-1336056097-0

     46 | vmbg-msoulier3.nssg.mitel.com_1-1336058939-285

     44 | vmbg-msoulier3.nssg.mitel.com_1-1336058940-0

(9 rows)

eventsdb=# select trim(id) from application_events;
                      btrim
--------------------------------------------------
 vmbg-msoulier3.nssg.mitel.com_1-1335549662-26268
 vmbg-msoulier3.nssg.mitel.com_1-1335549687-0
 tug-manage-ssl-1335549693-0
 vmbg-msoulier3.nssg.mitel.com_1-1335553128-344
 vmbg-msoulier3.nssg.mitel.com_1-1335553152-0
 tug-manage-ssl-1335553155-0
 vmbg-msoulier3.nssg.mitel.com_1-1336056097-0
 vmbg-msoulier3.nssg.mitel.com_1-1336058939-285
 vmbg-msoulier3.nssg.mitel.com_1-1336058940-0
(9 rows)

still, in my app I see a lot of trailing whitespace after reading from the
db...

Mike

Attachment

pgsql-general by date:

Previous
From: Evan Martin
Date:
Subject: Re: SQL functions not being inlined
Next
From: "Michael P. Soulier"
Date:
Subject: Re: trimming a column