BUG #1862: ECPG Connect, host variable trailing blanks

From: "James Gray" <jim(dot)gray(at)bull(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1862: ECPG Connect, host variable trailing blanks
Date: 2005-09-06 20:02:47
Message-ID: 20050906200247.DF149F1159@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1862
Logged by: James Gray
Email address: jim(dot)gray(at)bull(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2005-09-06 21:01:33 Re: Serialization errors on single threaded request
Previous Message Tom Lane 2005-09-05 17:25:58 Re: extra columns in intermediate nodes not being removed by top level of executor