The following bug has been logged online:
Bug reference: 1862
Logged by: James Gray
Email address: jim.gray@bull.com
PostgreSQL version: 8.0.3
Operating system: Red Hat Enterprise Linux AS release 4 (Nahant Update 1),
Kernel 2.6.9-11.EL on an ia64
Description: ECPG Connect, host variable trailing blanks
Details:
We are processing a COBOL/SQL program, and feeding the results to ECPG as
C/SQL
(since Postgres does not yet have a Cobol/Sql preprocessor).
The problem that we are having involves a connect statement with host
variables:
EXEC SQL CONNECT TO :target AS :user
Our problem is that we are passed Cobol strings which are blank padded.
Our string strategy works fine for Oracle, but not for Postgres CONNECTs.
For example, if we are trying to connect to:
- database: demo
- user: scott
- password: tiger
the strings must be "demo", "scott" and "tiger".
With trailing blanks user "scott" will not match user "scott ",
which is what we will present if the user had defined the Cobol variable as
PIC X(10).
There does not seem to be an option for Postgres to ignore trailing blanks
in the CONNECT host variables.
This only applies to CONNECT host variables, since trailing blanks in a
CHAR column are ignored in comparisons for all other interactions with
Postgres.
Since this is inconsistent behavior, and also doesn't match Oracle's
behavior,
we are requesting a fix or an option.