How to specify capitalization for column names in pg_fetch_object?

From: David McMath <mcdave(at)stanford(dot)edu>
To: pgsql-php(at)postgresql(dot)org
Subject: How to specify capitalization for column names in pg_fetch_object?
Date: 2012-11-19 16:45:49
Message-ID: 50AA623D.9090400@stanford.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Dear List,

I'm converting a PHP project from using Oracle to using Postgres.
Apparently, pg_fetch_object() wants to create an object with field names
lowercase by default. In the Oracle analogue, they're uppercase. So
all my code's "$obj->FIELD" references need to change to "$obj->field".

Is there any way to tell PHP or Postgres to change the default
capitalization?

In Perl, I'd use DBI and set FetchHashKeyName to "NAME_uc". In PHP,
we're using "DB" (not MDB2) for the database connections, and I don't
see a similar-looking lever to pull on

Any advice is appreciated,

dave

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Andrew McMillan 2012-11-19 19:52:23 Re: How to specify capitalization for column names in pg_fetch_object?
Previous Message John DeSoi 2012-10-11 13:05:25 Re: Storing large files in multiple schemas: BLOB or BYTEA