Re: Associative arrays and case sensitivity
| From: | Tomas V.V.Cox | Date: | Mon, 10 Sep 2001 23:26:46 +0000 |
| Subject: | Re: Associative arrays and case sensitivity | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-1874@lists.php.net to get a copy of this message | ||
Edin Kadribasic wrote:
>
> > > My quick fix was to patch pgsql module to add a configuration parameter
> that
> > > forces return of uppercase associative arrays.
> >
> > I haven't used the oci driver, but if all the backends returns columns
> > lowercase, the logic step is to change oci8 to do the same. Perhaps we
> > could add a "portability" options to do that? For example the phplib
> > guys are "strlowering" column names.
>
> The trouble is that not all backends do that. Postgres is always returning
> lowercase, Oracle uppercase, MySQL the same mix as when you created the
> database. Lowering column names would be very expensive to do in php code,
> therefore my C hack.
Sorry I haven't see any patch so didn't know that it was in C. Yes, I
know that rename keys with php is a expensive task, but for the moment
it's the only way to maintain a good level of "abstraction". Could be
nice to have a "key_rename" native function.
> > > I would really hate to have to go through the whole code and change all
> sql
> > > statements to put double quotes around each column name (we're talking
> some
> > > 50.000 lines of php code).
> >
> > Why do that?
>
> If you create table like:
>
> create table "TEST" ("ID" numeric(1));
>
Ah ok, I understand now. IMHO the normal practise is using lowered case
table names, so if we want to stadarize it my vote will be to use lower
case. Any way if your patch is for the php postgres extension you should
try to send it to php-dev.
Tomas V.V.Cox