Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] PostgreSQL ?



Ahmed Sarwar wrote:

> Hi,
> I've been trying to add a column to the table with a big a(A) with
> "AddressBook=# ALTER TABLE addresses ADD column Address varchar(80);"

Postgres need quotes around the column name in order to preserver case.
You would need to write:

ALTER TABLE addresses ADD column "Address" varchar(80);

I recommend against using column names with a mix of upper and
lower-case. Postgres *is* case sensitive but you will need to always
quote your column identifiers. Simply writing:

SELECT * from addresses where Address is null;

will *not* work as Postgres will fold Address into address and then
throw an error since there is no such column.

Just my 2 cents but you really need to stay away from using
case-sensitive identifiers. They're a real pain in the ...

Jc

PS the Postgres mailing list at pgsql-general@example.com is a great
place to ask this sort of question.
Note: This e-mail contains privileged and confidential information and is for the sole use of the intended recipient(s).  If you are not an intended recipient, you are hereby kindly requested to refrain from printing, copying, or distributing the information contained herein.  Furthermore, any other use of the information contained herein is strictly prohibited.  If you have received this transmission in error, please kindly notify the sender immediately and destroy all copies of the original message.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links