Tuesday, April 29, 2014

Postgres on Windows...

Yeah, why did I do this to myself? Well, I'm usually on a Mac, but Apple is dumb in that it doesn't support JEE6, which is what I used to write the sign-out app.

So, I needed to get the database onto the Windows machine where I wrote the sign-out app in JEE6.
So, I downloaded Postgres in a one-click exe file. Then it took me forever how to inflate a database from a pg_dump.

Well, after about 30 minutes of tinkering, here's how

how to run it from command line:

"\Program Files\PostgreSQL\9.3\bin\psql.exe" -U postgres ...



http://www.postgresql.org/docs/8.1/static/backup.html#BACKUP-DUMP-RESTORE

23.1.1. Restoring the dump

The text files created by pg_dump are intended to be read in by the psql program. The general command form to restore a dump is
psql dbname < infile
where infile is what you used as outfile for the pg_dump command. The database dbname will not be created by this command, you must create it yourself from template0 before executing psql (e.g., with createdb -T template0 dbname). psql supports options similar to pg_dump for controlling the database server location and the user name. See psql's reference page for more information.

No comments:

Post a Comment