Database Reference
In-Depth Information
The pg:push command
This command sends the structure and data from a local database your computer to the
database application on Heroku. This command expects you to supply the name of your
local database and the name of the database on Heroku.
Note
If your environment is Windows, you must first create the variables that indicate the user
and password of PostgreSQL locally. For working on Windows, execute the following
commands in the Command Prompt:
$ SET PGUSER=your_postgres_username_locally
$ SET PGPASSWORD=your_postgres_password_locally
$ heroku pg:push my_local_database DATABASE_URL --app
your-app-name
Tip
You must enter the password of your local PostgreSQL if your operating system is Win-
dows. A prompt asking for the password will appear:
Password: your_postgres_password_locally
For Linux and Mac OS X, in some cases it is necessary to specify the username and pass-
word to access your PostgreSQL locally. In this case, you can proceed in this way:
$ PGUSER=your_postgres_username_locally
PGPASSWORD=your_postgres_password_locally heroku pg:push
my_local_database DATABASE_URL --app your-app-name
The DATABASE_URL variable is the default database of your application, if you want to
send to another database, you must provide the appropriate URL:
$ heroku pg:push my_local_database
HEROKU_POSTGRESQL_[COLOR]_URL --app your-app-name
Search WWH ::




Custom Search