Hi,
I have a patch that I'm hoping might be useful to PHP developers, at least
those using PostgreSQL. The patch provides case folding of string keys
during hash lookups. The need for this comes from ...

We're transitioning from MySQL to PostgreSQL, and like many, we use camel
casing for naming tables and columns in our db. In PostgreSQL, (unquoted)
table and column names are case folded to lower case, so where we currently
have $row['someForeignId'], we would need to rewrite the key to
'someforeignid'. Besides being a lesson that we should use _ naming in the
future, it was clear there was no quick solution, we'd be forced to modify
many lines of code, and possibly end up with less readability. Instead, I
added a caseFold flag to the HashTable struct, which is later checked
in zend_hash_find() where, if configured, case folding of the key is
performed before hash lookup.

My question to the list is, can this functionality be added in a way that
doesn't adversely effect developers who won't use it, but helps us
PostgreSQL users and anyone else who might find it useful?  Judging from my
searches on the subject, it's not an uncommon impedance for PHP/PostgreSQL
users.

thanks,
Dave

Reply via email to