1

I'm trying to deploy a basic java application with Postgres integration in Heroku. I've cloned this project https://github.com/heroku/devcenter-java-database. I was able to make the app work in a proper way locally. It creates a table called ticks within the database and a tuple is inserted in it.

When I deploy the app to Heroku, it seems to work as well. In fact, it works. I can run a select query and get the right result. The strange thing comes up when I try to check my postgres db in Heroku. It seems nothing has been created. I don't know if it's caused because I have a Heroku's Dev plan. But I don't have any ideas why Heroku behaves different than my local env.

::term>run "sh devcenter-java-database-plain-jdbc/target/bin/main"
  Running sh devcenter-java-database-plain-jdbc/target/bin/main attached to terminal...      up, run.6018
  Read from DB: 2013-02-03 12:51:42.110186

The app works, but it doesn't save anything in my Heroku db.

::term>pg:info
  ===HEROKU_POSTGRESQL_WHITE (DATABASE_URL)
  Plan         Dev
  Status       available
  Connections  0
  PG Version   9.1.6
  Created      2013-02-03 11:58 UTC
  Data Size    5.9 MB
  Tables       0
  Rows         0/10000 (In compliance)
  Fork/Follow  Unsupported

Any ideas?

1
  • 1
    Just find the dataclip utility in Heroku: postgres.heroku.com/dataclips. It returns the correct data. But still don't know why heroku pg:info shows nothing ... Commented Feb 3, 2013 at 14:05

1 Answer 1

1

pg:info queries Heroku's Postgres management systems, which is only periodically polling your dev db. pg:info is not real time, but your app is. If it works, your table and data is there.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you Greg!. Where did you find this info?. I've searched in the Heroku help pages and find nothing about it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.