Skip to content

Instantly share code, notes, and snippets.

@jctosta
Last active April 29, 2024 12:28
Show Gist options
  • Save jctosta/baa4a1ba472a5999f445c0f43fdbe208 to your computer and use it in GitHub Desktop.
Save jctosta/baa4a1ba472a5999f445c0f43fdbe208 to your computer and use it in GitHub Desktop.
A simple guide on initializing the Windows version of Postgres using the zip file instead of msi installer

Postgres (Zip Version) Windows Starting Guide

Download postgresql from https://www.enterprisedb.com/download-postgresql-binaries;

Unzip it;

Open a cmd;

Enter into the ‘bin’ directory;

Init the database:

initdb.exe -D ../data –username=postgres –auth=trust

Start the database:

pg_ctl.exe start -D ../data

Open another cmd;

Enter into the ‘bin’ directory;

Log into the database:

psql.exe –username=postgres

Create a password for your user:

ALTER USER postgres WITH PASSWORD ‘VeryVerySecret’;

Install adminpack extension:

CREATE EXTENSION adminpack;

Reference: https://feilerdev.wordpress.com/2017/12/05/installing-postgresql-on-windows-using-zip-archive-without-the-installer/

@fate02festus
Copy link

The init command come through for me. Cheers

@jgranduel
Copy link

Thanks for this cool cheatsheet!

We must use two dashes in long options --username and --auth (or short options -U or -A):

> initdb.exe --help |  grep "user|auth"
  -A, --auth=METHOD
  -U, --username=NAME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment