Reputation: 133
I'm using postgresql database, in a table, I have a column named date. The problem occurs when I try making some operations with this column (date).
For example:
create index tg_index ON table_replay using btree(date);
here is my error:
ERROR: column "date" does not exist
****** Error ******
ERROR: column "date" does not exist SQL state: 42703
PS: I cannot change this column name because this is a big database so i need many years to perform any change. Thanks for understanding.
Upvotes: 0
Views: 1724
Reputation: 13527
Change your column name from date to another such as date
because date is a reserved word. You can easily achieve this by using alter commmand. Using alter command dosen't take too much time because alter command only affects the table structure reather than the data of the table. alter command have no concern with the data of the table.
Upvotes: 1
Reputation: 369
http://www.postgresql.org/docs/current/static/sql-keywords-appendix.html says date is a reserved keyword. You can try quoting it. That may not work.
I agree witht he above comment - use of plain keywords that have a generic sense is generally a bad practice - column names should help to describe the purpose of the column.
Upvotes: 1