apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Fosdick <b...@bfoz.net>
Subject Case-munging in apr_dbd_pgsql.c
Date Mon, 16 Apr 2007 01:24:21 GMT
When using apr_dbd_pquery() to prepare a statement for PostgreSQL the statement name loses
it's case, and then can't be found. For example, if I prepare a statement named "A", and then
try to use that statement I get an error telling me that the statement doesn't exist. However,
the same statement works when named "a".

The problem appears to be in dbd_pgsql_prepare(), which doesn't enclose the statement name
in quotes when generating the PREPARE statement. For some reason postgres then forces the
name to lower-case, but the name stored in the apr_dbd_prepared_t still has the original case.
Consequently, _pquery() tries to execute the statement using the original name which postgres
seems to have forgotten about.

I'm still fairly new to postgres and dbd, so I'm wondering if this is desired behavior (it's
certainly an annoying behavior)? If not, the fix is simple and I can easily generate a patch
if needed.

View raw message