title: Postgres table visible in psql, not from jdbc
body: <p>I've created a table called inventory in a Postgres 9.1 database. I have been able to select, insert, etc. from psql.</p>
  
  <p>However, I'm trying to access this table from the server of a webapp. I have installed the server code (using JDBC) on the same machine as the Postgres database. When I try to access the inventory table from the JDBC code, I get this error: </p>
  
  <blockquote>
    <p>org.postgresql.util.PSQLException: ERROR: relation &quot;inventory&quot; does not exist</p>
  </blockquote>
  
  <p>I have made sure that I'm using the same username, that I'm being consistent between the properties used to create the connection, the user I'm checking in psql, and by getting the username from the JDBC metadata at runtime.</p>
  
  <p>Oddly, I've had success with a similar setup on my laptop (hosting Tomcat and the webapp and the postgres installation all there), but the setup doesn't work when I host the db and the webapp on a server. </p>
  
  <p>Since it works on one machine and not another, I think the following are possible explanations:</p>
  
  <ol>
  <li>I have something wrong in the user configurations. Perhaps the Postgres user permissions are wrong for access from JDBC on the server (I didn't set up the Postgres installation on the server).</li>
  <li>I'm hitting the wrong schema. How would I know?</li>
  <li>I'm hitting the wrong machine somehow. I tried <code>select inet_server_addr();</code>, but it only says 127.0.0.1, which isn't very useful. Is there a better way to check?</li>
  </ol>
  
  <p>In another conversation (<a href="https://stackoverflow.com/questions/16250744/relation-not-found-using-postgres-within-an-eclipse-hibernate-application">&quot;relation not found&quot; using Postgres within an Eclipse Hibernate application</a>), I saw that many people trying to help wanted to know if the table appeared in psql. For that problem, the answer was no, and he just needed to create the table. For me, the answer is yes, and I just can't see the table.</p>
  
  <p>Any idea why I can connect to a database but not see a table that my user owns?</p>
  
  <p>Thanks</p>