LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   postgresql odd behavior (http://www.linuxquestions.org/questions/linux-software-2/postgresql-odd-behavior-28953/)

doublefailure 08-28-2002 12:09 AM

postgresql odd behavior
 
i have to enclose table user with " " but not for other tables..

this applies even in programs that access this database..


mydb=# \d
List of relations
Name | Type | Owner
---------------------+----------+----------
category | table | postgres
category_id_seq | sequence | postgres
content | table | postgres
content_field | table | postgres
content_type | table | postgres
content_type_id_seq | sequence | postgres
object_id_seq | sequence | postgres
rating | table | postgres
relationship | table | postgres
relationship_type | table | postgres
user | table | postgres
(11 rows)

mydb=# select * from user;
ERROR: parser: parse error at or near "user"
ERROR: parser: parse error at or near "user"
mydb=# select * from rating;
relationship_id | rating
-----------------+--------
128 | 3
(1 row)

mydb=# select * from "user";
user_id | username | first_names | last_name | email | password
---------+----------+-------------+-----------+-----------------------+----------

any idea?


k..... looks like 'user' is keyword of postgresql..
users works fine..
=)

j-ray 08-28-2002 12:40 AM

itīs like that, a reserved one:
http://www.postgresql.org/idocs/inde...-appendix.html
cheers, jens


All times are GMT -5. The time now is 04:13 AM.