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

Re: Fw: BUG #1862: ECPG Connect, host variable trailing blanks

From: Jim(dot)Gray(at)Bull(dot)com
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Ken(dot)Rosensteel(at)Bull(dot)com,pgsql-bugs(at)postgresql(dot)org, Bill(dot)Lawrance(at)Bull(dot)com,Dave(dot)Edwards(at)Bull(dot)com, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: Fw: BUG #1862: ECPG Connect, host variable trailing blanks
Date: 2005-09-20 18:16:04
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
>Does Oracle really munge data on the client side?  Or does it, like
>PostgreSQL, pass the host variable's value as-is to the server, and
>the server considers trailing spaces significant or not depending
>on the context?

The Oracle C preprocessor/client library has an option to strip trailing 
I believe that the Oracle preprocessor/client library always does this, 
and that the Oracle server 
is unaware of any of this and uses whatever characters are sent to it, as 
We couldn't find a similar option for Postgres C.

>Is it the client-side behavior or the server-side
>behavior that's different between PostgreSQL and Oracle?

We haven't found any difference between connect variables and other 
variables in the Oracle server.
There appears to be no context differences in handling variables in the 
Oracle server, like there is for Postgres.

>If Oracle strips trailing spaces on the client side, is that a
>configurable option?

Yes, as described above it affects the client-side only.

>How would you insert significant trailing
>spaces into a VARCHAR column if the client library strips them?

The cobol structure with 2 level 49's  for varchar within a cobol program 
is handled separately 
and is passed as-is to Oracle or Postgres .  This is the way to pass 
trailing spaces to or from Oracle. 

There is a similar structure recognized by the C preprocessor (in both 
Oracle and Postgres). 
This is the way to get trailing spaces to Oracle, since the Oracle 
preprocessor/library is 
stripping trailing spaces.

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2005-09-20 19:00:56
Subject: Re: [PORTS] Solaris - psql returns 0 instead of 1 for file not found.
Previous:From: Alvaro HerreraDate: 2005-09-20 16:13:17
Subject: Re: BUG #1898: Problema En Tipo de dato Real.

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