Reputation: 1345
Trying to run a psql query of the form
Select * from x where to='...'
Is 'to' a reserved word? Doesn't seem to like it.
Upvotes: 1
Views: 44
Reputation: 311228
"to" is indeed a reserved word in PostgreSQL, as it is in the ANSI standards of SQL-92, SQL:1999 and SQL:2003.
You can escape it by using double-quotes (") if you absolutely have to, although I recommend you just find a non-reserved name for your column:
SELECT *
FROM x
WHERE "to" = 3
-- Here^--^
Upvotes: 2