Book Image

Learning Heroku Postgres

By : Patrick Rafael de Oliveira Espake
Book Image

Learning Heroku Postgres

By: Patrick Rafael de Oliveira Espake

Overview of this book

Table of Contents (17 chapters)
Learning Heroku Postgres
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Keyword List
Index

Using the Heroku client with Postgres


The Heroku Postgres add-on is integrated with the Heroku client, which provides commands that allow you to automate and perform tasks to manage your PostgreSQL database hosted on Heroku.

All these commands are available through the namespace pg. You will get an overview of each of these commands in upcoming sections. Open a Terminal and type the following commands.

The pg:info command

This command provides the following statistics and information on your database:

  • The connection variable

  • The current database plan

  • The number of connections

  • The PostgreSQL version

  • The database's creation date

  • The database size

  • The number of tables

  • The number of available lines if the database plan is Hobby tier

It also informs whether Fork/Follow/Rollback are enabled for this database.

$ heroku pg:info --app your-app-name
=== HEROKU_POSTGRESQL_GOLD_URL (DATABASE_URL)
Plan:        Hobby-dev
Status:      Available
Connections: 0
PG Version:  9.3.3
Created:     2014-05-25 14:03 UTC...