Re: Error message: Ralation X does not have attribute Y

Started by Peter Eisentrautover 22 years ago4 messagesgeneral
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Jan Oksfeldt Jonasen writes:

The error simply can't be true :-) I've also tried using "correct" case on
the various letters in both table and column names, but without any luck so
far.

You need to double-quote the names or they will be converted to lower
case.

--
Peter Eisentraut peter_e@gmx.net

#2Shridhar Daithankar
shridhar_daithankar@persistent.co.in
In reply to: Peter Eisentraut (#1)

On 6 Aug 2003 at 14:34, Jan Oksfeldt Jonasen wrote:

Hi,
I'm a very new user of the PostgreSQL database, but I've quickly
encountered what I consider an pretty odd error. Let it be said, this is
using the PeerDirect PostgreSQL Beta 4 using Win2K SP3, so it's bound to
have certain issues. The following is from a simple console session with psql.

pgtestdb=# CREATE TABLE SMT_PROPERTIES ( "PropertyKey" varchar (50) NOT
NULL,"PropertyValue" varchar (255) ) WITHOUT OIDS;
CREATE

Why are you quoting column names? Is that required? What happens if you don't?

Bye
Shridhar

--
understand, v.: To reach a point, in your investigation of some subject, at
which you cease to examine what is really present, and operate on the basis of
your own internal model instead.

#3Jan Oksfeldt Jonasen
joj@northmann.com
In reply to: Peter Eisentraut (#1)
Re: Error message: Ralation X does not have

At 01:40 PM 8/6/2003, Peter Eisentraut wrote:

You need to double-quote the names or they will be converted to lower
case.

Thank you both. The reason why the initial table creation have quoted
columns names is that it's generated by a program we use for schema
creation. I'm currently adding to it so it can support Postgres too and the
way columns are set up was more or less copied from the MS Sql implementation.

I'm really not used to databases being so case sensitive, neither Oracle or
MS Sql Server is that, but I'll keep this thing in mind moving along. Quite
impressed with the response time, or maybe it was just a too easy question :-)

Best regards

Jan Oksfeldt Jonasen
Northmann A/S
web: http://www.northmann.com
newsgroup: news:news.northmann.com

#4Martijn van Oosterhout
kleptog@svana.org
In reply to: Jan Oksfeldt Jonasen (#3)
Re: Error message: Ralation X does not have

On Wed, Aug 06, 2003 at 03:06:12PM +0100, Jan Oksfeldt Jonasen wrote:

At 01:40 PM 8/6/2003, Peter Eisentraut wrote:

You need to double-quote the names or they will be converted to lower
case.

Thank you both. The reason why the initial table creation have quoted
columns names is that it's generated by a program we use for schema
creation. I'm currently adding to it so it can support Postgres too and the
way columns are set up was more or less copied from the MS Sql
implementation.

I'm really not used to databases being so case sensitive, neither Oracle or
MS Sql Server is that, but I'll keep this thing in mind moving along. Quite
impressed with the response time, or maybe it was just a too easy question
:-)

Well, it's only case-sensetive if you ask for it, ie by quoting. The basic
rule is:

Either always quote or never quote.

Always quote = case-sensetive
Never quote = case-insensetive

--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

"All that is needed for the forces of evil to triumph is for enough good
men to do nothing." - Edmond Burke
"The penalty good people pay for not being interested in politics is to be
governed by people worse than themselves." - Plato