Ajay_Sharma
Ajay_Sharma

Reputation: 51

Some help regarding Postgres on Heroku

i have just started working on an application in PHP. I have configured the Postgres add on in my application on Heroku. But i am still not sure how to start working on the DATABASE. what i mean is that there is a thing called DATACLIP on the POSTGRES DB window on Heroku and when i try to create a table there, it gives me some weird errors. But no matter what query i write there, it always gives me some error. So, i am not sure whether i can create the Tables and insert my data from DATACLIP or not. and If not, from where can i do this?

Upvotes: 2

Views: 502

Answers (1)

hgmnz
hgmnz

Reputation: 13306

Dataclips are only useful for read-only queries. Think gist for SQL and data.

To create data on your database, you can:

  • Use database migrations that run within the heroku platform itself
  • Connect to your database using the provided credentials from anywhere (you must use SSL). To get credentials, either run heroku pg:credentials <DATABASE_COLOR> --app <YOUR_APP>, or go to your database in http://postgres.heroku.com. You should be able to use pg_admin or any other postgres front end to connect and create tables.
  • You can connect directly using the heroku toolbelt (and assuming you have a proper psql installation in your dev box) with heroku pg:psql --app <YOUR_APP>. From there just use SQL to create your data (CREATE TABLE, etc)

Upvotes: 3

Related Questions