How do I access a table foo in schema bar in database moo through JDBC?

Option 1:

select * from;

Just does not work. The nomenclature is <database name>.<schema name>.<table name>.


Update the search path. PostgreSQL has the concept of search paths in which it tries to find the schemas. For more information check this out.

set search_path to ‘bar’

select * from foo

Put the schema name within single quotes otherwise, you piss the compiler off.