1

I have a Postgres database, and I connect to it via a rest webservice. However, I get an error saying:

Could not find relation 'mytablename'

I believe this is because I have used camel casing in my database and the tables are named like myTableName. Is there anyway I can disable case sensitivity in postgresql? Or would I have to (if this is possible) make my rest calls case sensitive?

toing_toing
  • 2,030
  • 1
  • 34
  • 72

1 Answers1

2

This answer started off as a comment but then evolved when I realized I might have an explanation for your problem.

All identifiers that are not double-quoted fall to lowercase in Postgres (q.v. here). So SELECT * FROM MYTABLENAME should behave identically to SELECT * FROM mytablename.

I think a likely cause of this is that Postgres is looking in the wrong schema for the mytablename table. Try this instead:

SELECT * FROM myschema.mytablename

where myschema is the name of the schema containing the mytablename table. If this doesn't fix the problem, you should make sure that the table actually exists.

Community
  • 1
  • 1
Tim Biegeleisen
  • 451,927
  • 24
  • 239
  • 318