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: OFE9CB9C5D.82B06BEE-ON07257082.0063D4D6-07257082.00645981@us-phx1.az05.bull.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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
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.

Browse pgsql-bugs by date

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