On my own machine I modify postgresql.conf, but I don't think Heroku gives access to that file. Does anyone know any alternative methods to set the default schema?
Setting it on every connection seems kinda ugly.
Create user in postgres db with same name as schema name. Login with this new user, it will automatically point to schema with user.
<GlobalNamingResources>
<Resource name="jdbc/DatabaseName" auth="Container" type="javax.sql.DataSource"
username="acme" password="dbPasswd"
url="jdbc:postgresql://localhost/mydb"
driverClassName="org.postgresql.Driver"
initialSize="5" maxWait="5000"
maxActive="120" maxIdle="5"
validationQuery="select 1"
poolPreparedStatements="true"/>
</GlobalNamingResources/>
with this configuration, jndi lookup for resource "jdbc/DatabaseName" with return database connection pointing to schema name matching user "acme", ie acme.
alter user set schema 'default_schema'