By default, postgresql will convert unquoted identifiers in a SQL statement to lower-case; which isn't the same as doing a case-insensitive match.
So if you have defined a table called "TABLE", then you need to address it as "TABLE", since just TABLE will be interpreted as "table".
Quite simply, the best tactic is to avoid using upper-case identifiers in postgresql: the catalogues and most examples I've seen use lower-case words separated by underscores (the_thing). You can use mixed-case identifiers, but in that case you have two alternatives:
- you can use mixed-case identifiers in your statements and simply accept that they all get folded to lower-case when they're actually stored.
- you can commit to quoting them all the time, and being consistent with the case all the time.
These outline my recommendations in preference order: stick to lower case style, mix case and accept the folding, insist on mixed case and deal with quoting identifiers everywhere.
PS don't get me started on calling a table "table". I'm assuming that was just a (silly) example. It's also a bad example since "select * from table" produces a syntax error, so clearly that's not the statement you're actually trying to run.