From: Justin Clift <justin@postgresql.org>
To: Zhidian Du <duzhidian@hotmail.com>
Cc: pgsql-php@postgresql.org
Subject: Re: Display the orginal Upper cases
Date: Wed, 25 Sep 2002 14:28:40 +1000
Message-ID: <3D913B78.31118007@postgresql.org> (raw)
References: <F454imZ4nlrKVjEzI83000055df@hotmail.com>
Hi Zhidian,
You could quote (put " around them) the uppercase table names when you
create them.
For example:
CREATE TABLE Foo (idnum serial, something varchar(10))
would really create a table called "foo", as PostgreSQL automatically
lowercases it.
But if you do this:
CREATE TABLE "Foo" (idnum serial, something varchar(10))
then it will create a table called "Foo", because PostgreSQL respects
the quotes.
This does have the side effect that all your queries for the "Foo" table
must be quoted from then on:
i.e. INSERT INTO "Foo" (something) VALUES ("Hello")
And if you do this:
CREATE TABLE "Foo" (idnum serial, something varchar(10))
CREATE TABLE Foo (idnum serial, something varchar(10))
Then you'll end up with two separate tables, one called "Foo" and the
other called "foo", both of which you can use separately as long as you
always get the quoting of names right.
An alternative approach is to use any of PHP's string functions that
automatically uppercase text. No good examples are coming to mind at
the moment, but if they are in the PHP manual in the "strings" section
of the Function Reference.
:-)
Regards and best wishes,
Justin Clift
Zhidian Du wrote:
>
> When I create a talbe and want to use pg_fieldname to display them, all the
> upper cases bacame lower cased
>
> How can I display the orginal cases,
>
> Thanks.
>
> Z. Du
>
> _________________________________________________________________
> Join the world’s largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi
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: justin@postgresql.org, duzhidian@hotmail.com
Subject: Re: Display the orginal Upper cases
In-Reply-To: <3D913B78.31118007@postgresql.org>
References: <F454imZ4nlrKVjEzI83000055df@hotmail.com> <3D913B78.31118007@postgresql.org>
* 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