pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PostgreSQL delete the blank in the end of the String automatically. how can I avoid it?
8+ messages / 4 participants
[nested] [flat]

* PostgreSQL delete the blank in the end of the String automatically. how can I avoid it?
@ 2004-05-28 10:47 xier@in.tum.de
  0 siblings, 0 replies; 8+ messages in thread

From: xier@in.tum.de @ 2004-05-28 10:47 UTC (permalink / raw)
  To: pgsql-odbc

hello,

my Name is Rong. I am student at TU-Munich. I have some questions for
Postgresql7.2  under SuSe Linux.
Postgresql7.2  under SuSe Linux8.0.
I use PostgreSQL7.2 with PGAdminII1.4.2 under Windows2000.

I insert a String from Teleform6.0 of Cardiff through ODBC in table of
PostgreSQL.
There should be some blank in the End of the String. e.g: "data           
     "
But there ist no blank in the end of the String in the table. e.g: "data"
It means, that PostgreSQL delete the blank in the end of the String
automatically.
But I need the blank in the end of the String.
how can I avoid it?

How can convert TIFF Raw G3 to TIFF G4(image file format) in shell script
of linux.

I hope I can get your Help!
Thank you very much!

best regards!

rong




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* PostgreSQL delete the blank in the end of the String automatically. how can I avoid it?
@ 2004-05-28 12:04 xier@in.tum.de
  2004-05-28 13:39 ` Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? Paul Thomas <paul@tmsl.demon.co.uk>
  2004-05-28 15:56 ` Re: PostgreSQL delete the blank in the end of the String xier@in.tum.de
  2004-05-28 15:58 ` Re: [NOVICE] PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? Manuel Sugawara <masm@fciencias.unam.mx>
  0 siblings, 3 replies; 8+ messages in thread

From: xier@in.tum.de @ 2004-05-28 12:04 UTC (permalink / raw)
  To: pgsql-novice@postgresql.org; +Cc: pgsql-general@postgresql.org; pgsql-odbc

hello,

my Name is Rong. I am student at TU-Munich. I have some questions for
Postgresql7.2  under SuSe Linux.
Postgresql7.2  under SuSe Linux8.0.
I use PostgreSQL7.2 with PGAdminII1.4.2 under Windows2000.

I insert a String from Teleform6.0 of Cardiff through ODBC in table of
PostgreSQL.
There should be some blank in the End of the String. e.g: "data
     "
But there ist no blank in the end of the String in the table. e.g: "data"
It means, that PostgreSQL delete the blank in the end of the String
automatically.
But I need the blank in the end of the String.
how can I avoid it?

How can convert TIFF Raw G3 to TIFF G4(image file format) in shell script
of linux.

I hope I can get your Help!
Thank you very much!

best regards!

rong










^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it?
  2004-05-28 12:04 PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? xier@in.tum.de
@ 2004-05-28 13:39 ` Paul Thomas <paul@tmsl.demon.co.uk>
  2004-05-28 19:46   ` Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? Jeff Eckermann <jeff_eckermann@yahoo.com>
  2 siblings, 1 reply; 8+ messages in thread

From: Paul Thomas @ 2004-05-28 13:39 UTC (permalink / raw)
  To: pgsql-general @ postgresql . org <pgsql-general@postgresql.org>


On 28/05/2004 13:04 xier@in.tum.de wrote:
> hello,
> 
> my Name is Rong. I am student at TU-Munich. I have some questions for
> Postgresql7.2  under SuSe Linux.
> Postgresql7.2  under SuSe Linux8.0.
> I use PostgreSQL7.2 with PGAdminII1.4.2 under Windows2000.
> 
> I insert a String from Teleform6.0 of Cardiff through ODBC in table of
> PostgreSQL.
> There should be some blank in the End of the String. e.g: "data
>      "
> But there ist no blank in the end of the String in the table. e.g: "data"
> It means, that PostgreSQL delete the blank in the end of the String
> automatically.
> But I need the blank in the end of the String.
> how can I avoid it?

AFAICT, it's not PostgreSQL which is causing your problem. I've just 
tested against 7.2.1 using psql and it does _not_ remove trailing spaces. 
I think your problem is with your client code.

HTH

BTW, 7.2 is very old. I'd recommend upgrading.

-- 
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for 
Business             |
| Computer Consultants         | 
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it?
  2004-05-28 12:04 PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? xier@in.tum.de
  2004-05-28 13:39 ` Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? Paul Thomas <paul@tmsl.demon.co.uk>
@ 2004-05-28 19:46   ` Jeff Eckermann <jeff_eckermann@yahoo.com>
  2004-05-29 08:58     ` Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? Paul Thomas <paul@tmsl.demon.co.uk>
  0 siblings, 1 reply; 8+ messages in thread

From: Jeff Eckermann @ 2004-05-28 19:46 UTC (permalink / raw)
  To: pgsql-general @ postgresql . org <pgsql-general@postgresql.org>


--- Paul Thomas <paul@tmsl.demon.co.uk> wrote:
> 
> On 28/05/2004 13:04 xier@in.tum.de wrote:
> > hello,
> > 
> > my Name is Rong. I am student at TU-Munich. I have
> some questions for
> > Postgresql7.2  under SuSe Linux.
> > Postgresql7.2  under SuSe Linux8.0.
> > I use PostgreSQL7.2 with PGAdminII1.4.2 under
> Windows2000.
> > 
> > I insert a String from Teleform6.0 of Cardiff
> through ODBC in table of
> > PostgreSQL.
> > There should be some blank in the End of the
> String. e.g: "data
> >      "
> > But there ist no blank in the end of the String in
> the table. e.g: "data"
> > It means, that PostgreSQL delete the blank in the
> end of the String
> > automatically.
> > But I need the blank in the end of the String.
> > how can I avoid it?
> 
> AFAICT, it's not PostgreSQL which is causing your
> problem. I've just 
> tested against 7.2.1 using psql and it does _not_
> remove trailing spaces. 
> I think your problem is with your client code.

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.

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.

> 
> HTH
> 
> BTW, 7.2 is very old. I'd recommend upgrading.
> 
> -- 
> Paul Thomas
>
+------------------------------+---------------------------------------------+
> | Thomas Micro Systems Limited | Software Solutions
> for 
> Business             |
> | Computer Consultants         | 
> http://www.thomas-micro-systems-ltd.co.uk   |
>
+------------------------------+---------------------------------------------+
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org



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



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it?
  2004-05-28 12:04 PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? xier@in.tum.de
  2004-05-28 13:39 ` Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? Paul Thomas <paul@tmsl.demon.co.uk>
  2004-05-28 19:46   ` Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? Jeff Eckermann <jeff_eckermann@yahoo.com>
@ 2004-05-29 08:58     ` Paul Thomas <paul@tmsl.demon.co.uk>
  2004-05-30 17:19       ` Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? Jeff Eckermann <jeff_eckermann@yahoo.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Paul Thomas @ 2004-05-29 08:58 UTC (permalink / raw)
  To: pgsql-general @ postgresql . org <pgsql-general@postgresql.org>


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.

> 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.

-- 
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for 
Business             |
| Computer Consultants         | 
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it?
  2004-05-28 12:04 PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? xier@in.tum.de
  2004-05-28 13:39 ` Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? Paul Thomas <paul@tmsl.demon.co.uk>
  2004-05-28 19:46   ` Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? Jeff Eckermann <jeff_eckermann@yahoo.com>
  2004-05-29 08:58     ` Re: PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? Paul Thomas <paul@tmsl.demon.co.uk>
@ 2004-05-30 17:19       ` Jeff Eckermann <jeff_eckermann@yahoo.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Jeff Eckermann @ 2004-05-30 17:19 UTC (permalink / raw)
  To: Paul Thomas <paul@tmsl.demon.co.uk>; pgsql-general @ postgresql . org <pgsql-general@postgresql.org>

--- Paul Thomas <paul@tmsl.demon.co.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/ 



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL delete the blank in the end of the String
  2004-05-28 12:04 PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? xier@in.tum.de
@ 2004-05-28 15:56 ` xier@in.tum.de
  2 siblings, 0 replies; 8+ messages in thread

From: xier@in.tum.de @ 2004-05-28 15:56 UTC (permalink / raw)
  To: vancel@winfreeacademy.com; +Cc: pgsql-general@postgresql.org

hi,

thank you very much for your tips!
As your tip: use a char() field instead of a varchar() field.
The problem is solved. Thanks!

have a good time!

rong

> xier@in.tum.de wrote:
>
>>hello,
>>
>>my Name is Rong. I am student at TU-Munich. I have some questions for
>>Postgresql7.2  under SuSe Linux.
>>Postgresql7.2  under SuSe Linux8.0.
>>I use PostgreSQL7.2 with PGAdminII1.4.2 under Windows2000.
>>
>>I insert a String from Teleform6.0 of Cardiff through ODBC in table of
>>PostgreSQL.
>>There should be some blank in the End of the String. e.g: "data
>>     "
>>But there ist no blank in the end of the String in the table. e.g: "data"
>>It means, that PostgreSQL delete the blank in the end of the String
>>automatically.
>>But I need the blank in the end of the String.
>>how can I avoid it?
>>
> If you know how long you need to field to be, use a char() field instead
> of a varchar() field or some other varying-length field.  If the length
> of the fields needs to be variable, then try putting some sort of
> termination character at the end of the blank space... such as a period
> (.), then have your program strip it out when it's reading it.
>
>>How can convert TIFF Raw G3 to TIFF G4(image file format) in shell script
>>of linux.
>>
> You can use a program called Image Magick for the image conversion.  The
> software has several programs that are installed as a result, and it's
> all usable via the shell.  The specific program that you'll want to read
> about is called "convert".  A program that I have set up that part of
> its function is to create thumbnail pictures uses convert like this:
>
> convert -geometry 221x164 sourcefile newfile
>
> Good luck!
>
>>
>>I hope I can get your Help!
>>Thank you very much!
>>
>>best regards!
>>
>>rong
>>
>>
> --
> Thanks,
> Laura Vance
> Systems Engineer
> Winfree Academy Charter Schools, Data-Business Office
> 1711 W. Irving Blvd. Ste 310
> Irving, Tx  75061
> Web: www.winfreeacademy.com
>
>





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: [NOVICE] PostgreSQL delete the blank in the end of the String automatically. how can I avoid it?
  2004-05-28 12:04 PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? xier@in.tum.de
@ 2004-05-28 15:58 ` Manuel Sugawara <masm@fciencias.unam.mx>
  2 siblings, 0 replies; 8+ messages in thread

From: Manuel Sugawara @ 2004-05-28 15:58 UTC (permalink / raw)
  To: xier@in.tum.de; +Cc: pgsql-novice@postgresql.org; pgsql-general@postgresql.org; pgsql-odbc

xier@in.tum.de writes:

> hello,
> 
> my Name is Rong. I am student at TU-Munich. I have some questions for
> Postgresql7.2  under SuSe Linux.
> Postgresql7.2  under SuSe Linux8.0.
> I use PostgreSQL7.2 with PGAdminII1.4.2 under Windows2000.
> 
> I insert a String from Teleform6.0 of Cardiff through ODBC in table of
> PostgreSQL.
> There should be some blank in the End of the String. e.g: "data
>      "
> But there ist no blank in the end of the String in the table. e.g: "data"
> It means, that PostgreSQL delete the blank in the end of the String
> automatically.
>
> But I need the blank in the end of the String.  how can I avoid it?

Let me guess, the offending column's type is char(x), right?. If
that's the case you must change it to something else, varchar or text.

Regards,
Manuel.



^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2004-05-30 17:19 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-05-28 10:47 PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? xier@in.tum.de
2004-05-28 12:04 PostgreSQL delete the blank in the end of the String automatically. how can I avoid it? xier@in.tum.de
2004-05-28 13:39 ` Paul Thomas <paul@tmsl.demon.co.uk>
2004-05-28 19:46   ` Jeff Eckermann <jeff_eckermann@yahoo.com>
2004-05-29 08:58     ` Paul Thomas <paul@tmsl.demon.co.uk>
2004-05-30 17:19       ` Jeff Eckermann <jeff_eckermann@yahoo.com>
2004-05-28 15:56 ` Re: PostgreSQL delete the blank in the end of the String xier@in.tum.de
2004-05-28 15:58 ` Manuel Sugawara <masm@fciencias.unam.mx>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox