Display the orginal Upper cases
am 25.09.2002 04:54:52 von Zhidian Du
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 worlds 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
Re: Display the orginal Upper cases
am 25.09.2002 06:28:40 von Justin Clift
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 worlds 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
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly