By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,934 Members | 1,685 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,934 IT Pros & Developers. It's quick & easy.

Very strange selectproblem

P: n/a
Can't select 3 columns from a table called varer.

The columns are the three first and are called vnummer, puNr and dNr.

The error message is:

indiadan=# select varer.vNummer from varer;
ERROR: No such attribute varer.vnummer
indiadan=#

I'm probably doing something else wrong, but can't figure what…

Help needed,

regards,

Victor

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
See my comments below.

On Tue, 2003-11-04 at 13:10, Victor SpÄng Arthursson wrote:
Can't select 3 columns from a table called varer.

The columns are the three first and are called vnummer, puNr and dNr.

The error message is:

indiadan=# select varer.vNummer from varer; ^^^^^^^^^^
this is upper case N ERROR: No such attribute varer.vnummer

^^^^^^^
this is lower case n in vnummer

The problem could be that you created the table with the name of the vNummer column enclosed in double quotes, like this: "vNummer".
In this case postgres remembers the case of the field name. Names are case sensitive in postgres.
In your query, you don't enclose the field names in double quotes, like: varer.vNummer, which is folded to all lower case by postgres, and won't match the mixed case field you have created.
Try to quote the field names in the query, it will likely work.
A good practice to avoid such errors is to always use lower case names with postgres.

HTH,
Csaba.
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #2

P: n/a
> indiadan=# select varer.vNummer from varer;
ERROR: No such attribute varer.vnummer
indiadan=#


PostgreSQL casts all names to lowercase. To select your field, you need
to use double quotes, as in:

select varer."vNummer" from varer;

Cheers.

---------------
Francois

Home page: http://www.monpetitcoin.com/

"Would Descartes have programmed in Pascal?" - Umberto Eco
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.