Don’t ask “Why Windows?”
Not being a database expert and needing to set up PostgreSQL database in a Windows machine to do simple development with minimal fuss, the following is a simplistic MSDOS script to automate that:
|
|
A few things to note:
- Set the PostgreSQL home directory in line 5
- Change the default superuser name in line 6 if necessary
- Change authentication methods to whatever that’s appropriate:
in this case, it just trusts all connections, so don’t use
trust
in production!
Once the initializing is completed, run pg_ctl start -D %PGDATA% -l logfile
to start the database daemon. To stop it, run pg_ctl stop
.