Re: Display the orginal Upper cases

From: Justin Clift <justin(at)postgresql(dot)org>
To: Zhidian Du <duzhidian(at)hotmail(dot)com>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: Display the orginal Upper cases
Date: 2002-09-25 04:28:40
Message-ID: 3D913B78.31118007@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

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

In response to

Browse pgsql-php by date

  From Date Subject
Next Message arun kv 2002-09-25 08:55:27 How to display an image (Image generation)
Previous Message Zhidian Du 2002-09-25 02:54:52 Display the orginal Upper cases