Re: Fw: BUG #1862: ECPG Connect, host variable trailing blanks - Mailing list pgsql-bugs

From Jim.Gray@Bull.com
Subject Re: Fw: BUG #1862: ECPG Connect, host variable trailing blanks
Date
Msg-id OFE9CB9C5D.82B06BEE-ON07257082.0063D4D6-07257082.00645981@us-phx1.az05.bull.com
Whole thread Raw
List 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
blanks.
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
is.
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:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #1898: Problema En Tipo de dato Real.
Next
From: "Ing. Jhon Carrillo - Caracas, Venezuela"
Date:
Subject: problem start database