Select Stament Issue??

Started by DracKewlalmost 21 years ago3 messagesgeneral
Jump to latest
#1DracKewl
bradbudge@hotmail.com

Trying out PostgreSQL for the first time and running into a minor
problem.
I created two tables one with the Add table wizard the other hard-core
script.

Script made table:
Select * from Example
--This works as expected
Select * from EXAMPLE
--This works as expected

Wizard made table:
Select * from Example
--ERROR: relation "Example" does not exist
Select * from "Example"
--This works as expected

The wizard table has created a case sensitive restriction on me and
forced me to use quotes. How do I turn this off?

#2DracKewl
bradbudge@hotmail.com
In reply to: DracKewl (#1)
Re: Select Stament Issue??

I did a couple of tests and found that occationally when using the
wizard it added "" to my names. When this happens it forces the whole
table to be case sensitive. Anyway I think I'll just stick to manually
creating my tables.

#3Scott Marlowe
smarlowe@g2switchworks.com
In reply to: DracKewl (#1)
Re: Select Stament Issue??

On Tue, 2005-07-26 at 13:54, DracKewl wrote:

Trying out PostgreSQL for the first time and running into a minor
problem.
I created two tables one with the Add table wizard the other hard-core
script.

Script made table:
Select * from Example
--This works as expected
Select * from EXAMPLE
--This works as expected

Wizard made table:
Select * from Example
--ERROR: relation "Example" does not exist
Select * from "Example"
--This works as expected

The wizard table has created a case sensitive restriction on me and
forced me to use quotes. How do I turn this off?

When you created the table you likely did this:

create table Example (...

While the wizard actually did this:

create table "Example" (...

So, postgresql folded case on your create table, and actually created a
table called example, while the wizard's quoting the table name meant
the table was named Example. This should fix you up:

alter table "Example" rename to example;