pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
SqlServer to PostgreSql
3+ messages / 3 participants
[nested] [flat]

* SqlServer to PostgreSql
@ 2002-07-09 20:31  Luis Felipe Acevedo Fernandez <luis.felipe@unibase.com.mx>
  0 siblings, 2 replies; 3+ messages in thread

From: Luis Felipe Acevedo Fernandez @ 2002-07-09 20:31 UTC (permalink / raw)
  To: pgsql-admin

Hi!
I triyed to migrate a database from SqlServer to PostgreSql, but I have a 
problem with char or varchar data types cos If I try to insert or select some 
information from a table the program retrieve blank spaces, my program was 
develop in PowerBuilder 7

Example If there is a table with a column char(5) and I insert the word "Hi" 
with 2 character when the program try to retrieve the information 
it gets "Hi   " 

thats my problem i hope some one  can help 



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

* Re: SqlServer to PostgreSql
@ 2002-07-10 15:58  Kevin Brannen <kevinb@nurseamerica.net>
  parent: Luis Felipe Acevedo Fernandez <luis.felipe@unibase.com.mx>
  1 sibling, 0 replies; 3+ messages in thread

From: Kevin Brannen @ 2002-07-10 15:58 UTC (permalink / raw)
  To: luis.felipe@unibase.com.mx; +Cc: pgsql-admin

Luis Felipe Acevedo Fernandez wrote:
> Hi!
> I triyed to migrate a database from SqlServer to PostgreSql, but I have a 
> problem with char or varchar data types cos If I try to insert or select some 
> information from a table the program retrieve blank spaces, my program was 
> develop in PowerBuilder 7
> 
> Example If there is a table with a column char(5) and I insert the word "Hi" 
> with 2 character when the program try to retrieve the information 
> it gets "Hi   " 
> 
> thats my problem i hope some one  can help 

That is proper behavior for the "char" datatype.  Change your column to 
"varchar(5)" and you should get what you want--no padding with spaces.

HTH,
Kevin




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

* Re: SqlServer to PostgreSql
@ 2002-07-11 00:58  Ludwig Lim <lud_nowhere_man@yahoo.com>
  parent: Luis Felipe Acevedo Fernandez <luis.felipe@unibase.com.mx>
  1 sibling, 0 replies; 3+ messages in thread

From: Ludwig Lim @ 2002-07-11 00:58 UTC (permalink / raw)
  To: Luis Felipe Acevedo Fernandez <luis.felipe@unibase.com.mx>; +Cc: pgsql-admin


--- Luis Felipe Acevedo Fernandez
<luis.felipe@unibase.com.mx> wrote:
> Hi!
> I triyed to migrate a database from SqlServer to
> PostgreSql, but I have a 
> problem with char or varchar data types cos If I try
> to insert or select some 
> information from a table the program retrieve blank
> spaces, my program was 
> develop in PowerBuilder 7
> 
> Example If there is a table with a column char(5)
> and I insert the word "Hi" 
> with 2 character when the program try to retrieve
> the information 
> it gets "Hi   " 
> 

  I also encountered the same problem in Oracle when
porting char(n) datatypes.  Since char(n) datatypes
pads the string with spaces until it has n number of
characters.  What you can do is you can use either
ltrim,rtrim in selecting the data from SQL Server, or
use the trim() function in the PowerBuilder before
inserting it to a postgres database.

ludwig



__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com



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


end of thread, other threads:[~2002-07-11 00:58 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-07-09 20:31 SqlServer to PostgreSql Luis Felipe Acevedo Fernandez <luis.felipe@unibase.com.mx>
2002-07-10 15:58 ` Kevin Brannen <kevinb@nurseamerica.net>
2002-07-11 00:58 ` Ludwig Lim <lud_nowhere_man@yahoo.com>

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