Bug 456969 - backslash quoting error for Postgres (patch included)
backslash quoting error for Postgres (patch included)
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: unixODBC (Show other bugs)
All Linux
low Severity low
: rc
: ---
Assigned To: Tom Lane
Depends On:
  Show dependency treegraph
Reported: 2008-07-28 19:02 EDT by Jay Berkenbilt
Modified: 2013-03-19 11:34 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-03-19 11:34:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch relative to 2.2.11 (904 bytes, patch)
2008-07-28 19:02 EDT, Jay Berkenbilt
no flags Details | Diff
patch relative to 2.2.12 (904 bytes, patch)
2008-07-28 19:03 EDT, Jay Berkenbilt
no flags Details | Diff

  None (edit)
Description Jay Berkenbilt 2008-07-28 19:02:27 EDT
Description of problem:

The convert_from_pgbinary functions in convert.c for the Postgre7.1 and
PostgreSQL drivers in unixODBC handle \nnn octal quoting, but they fail to
handle \\ for quoting of the backslash character.  I have been assured by a
local user that it should be doing so, but I have not independently confirmed this.

Version-Release number of selected component (if applicable):

2.2.11-7.1.  Bug applies to straight upstream 2.2.11 as well as newer 2.2.12. 
I'm attaching a patch for both versions.

Unfortunately, I do not have a recipe for reproducing the problem at this time.
 The patch is "obvious", but I cannot guarantee that it is correct.  I am not
myself a user of unixODBC.  I am reporting this bug on behalf of another user. 
I can say that we have been running in production with this patch for two years.

Ideally, someone should forward this bug report to unixODBC upstream.  I may try
to do that myself if I can find out how.  The best way seems to be with an email

I'm attaching two patches.  One applies cleanly to 2.2.11 (the version in RHEL),
and the other applies cleanly to 2.2.12, the latest upstream version, released
in 2006.
Comment 1 Jay Berkenbilt 2008-07-28 19:02:27 EDT
Created attachment 312828 [details]
patch relative to 2.2.11
Comment 2 Jay Berkenbilt 2008-07-28 19:03:00 EDT
Created attachment 312829 [details]
patch relative to 2.2.12
Comment 3 Tom Lane 2008-07-28 19:24:35 EDT
I've really got no interest in fixing the built-in postgres (and mysql) drivers in unixODBC; they are 
horrendously obsolete and unmaintained, and I believe upstream is just going to rip them out in their next 
release.  You should be using the separately distributed postgresql-odbc package, instead.  See the 
package description for unixODBC.
Comment 4 Jay Berkenbilt 2008-07-29 10:56:16 EDT
Thanks for this helpful response.  I had overlooked this information.  I'll try
to find the person who made the patch and get them to switch to the external
postgres odbc drivers.  Feel free to close this if you wish.  I also emailed the
patch to the unixODBC-dev mailing list, so we'll see what they do.  If there are
better postgres and mysql drivers, I hope they will drop the built-in ones since
it obviously causes confusion.
Comment 5 Jay Berkenbilt 2008-07-29 11:40:20 EDT
I have checked the source code for postgresql-odbc and have verified that bug
fixed by these patch is in fact fixed in that code, and it is fixed in exactly
the same way.  I would say that this both confirms the correctness of the patch
and its irrelevance.  I will leave this bug open for the moment, however,
suggesting that the patch either be included in the unixODBC rpm or the drivers
be dropped entirely.  However, if someone decided to ahead and mark this as
WONTFIX, I would consider that a suitable resolution under the circumstances.
Comment 6 Honza Horak 2013-03-19 11:34:53 EDT
I am sorry, but it is now too late in the RHEL-5 release cycle. RHEL-5.10 (the next RHEL-5 minor release) is going to be the first production phase 2 [1] release of RHEL-5. Since phase 2 we'll be addressing only security and critical issues.
As per comments #3 and #5, I am closing the bug as WONTFIX.

Note You need to log in before you can comment on or make changes to this bug.