pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David McMath <mcdave@stanford.edu>
To: pgsql-php@postgresql.org
Subject: How to specify capitalization for column names in pg_fetch_object?
Date: Mon, 19 Nov 2012 10:45:49 -0600
Message-ID: <50AA623D.9090400@stanford.edu> (raw)

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




view thread (3+ messages)  latest in thread

Message-ID: <50AA623D.9090400@stanford.edu>
Permalink:  ../50AA623D.9090400@stanford.edu/
Also on:    postgresql.org/message-id/50AA623D.9090400@stanford.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: mcdave@stanford.edu
  Subject: Re: How to specify capitalization for column names in pg_fetch_object?
  In-Reply-To: <50AA623D.9090400@stanford.edu>
  References: <50AA623D.9090400@stanford.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox