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

From: Jim(dot)Gray(at)Bull(dot)com
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ken(dot)Rosensteel(at)Bull(dot)com, Michael Fuhr <mike(at)fuhr(dot)org>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1862: ECPG Connect, host variable trailing blanks
Date: 2005-09-09 18:02:31
Message-ID: OFB6483CA5.8B82A868-ON07257077.00623A43-07257077.00631B92@us-phx1.az05.bull.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

What do you think of an Postgres option that would enable stripping of
trailing blanks
from connect host variables when turned ON?

This would allow current behavior to be supported by ECPG and the Postgres
server,
but allow applications that need the behavior (like a Cobol/SQL
preprocessor for Postgres),
to make use of it.

When I searched the mail archives, I found that others had run into this
same problem,
in this case with an ODBC driver:
http://archives.postgresql.org/pgsql-interfaces/1998-08/msg00000.php

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
09/08/2005 09:15 PM

To
Michael Fuhr <mike(at)fuhr(dot)org>
cc
Jim(dot)Gray(at)Bull(dot)com, pgsql-bugs(at)postgresql(dot)org, Ken(dot)Rosensteel(at)Bull(dot)com
Subject
Re: [BUGS] BUG #1862: ECPG Connect, host variable trailing blanks

Michael Fuhr <mike(at)fuhr(dot)org> writes:
> If you think this behavior should be changed then propose it on
> pgsql-hackers and discuss it with the developers.

I doubt we'll consider changing it. If I haven't missed any of the
details, the critical points here are

(1) User names containing trailing (or embedded) spaces are legal.
Not a very good idea maybe, but legal both per SQL spec and per
our historical practice.

(2) Making ECPG strip trailing spaces would render it unable to
connect as such a user.

I don't think ECPG has any business deciding that trailing spaces are
insignificant. If that's the case in your application environment,
fine: strip the spaces at the application level. But don't expect a
general-purpose library to make that policy choice for you.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Lee Benson 2005-09-10 04:52:08 BUG #1873: "Invalid username specified" during install
Previous Message Hugo Cesar 2005-09-09 16:06:14 BUG #1872: Failed to create process: 2!