- No password localhost windows users
- Usefull for on the command line: type <some_file>.psql | psql
- Windows Binary 12.X as of writing https://www.postgresql.org/download/
- Remember the postgress password for the step when opening pgAdmin later
Default install path: C:\Program Files\PostgreSQL\12\
Add pgsql path to command line Windows search 'Path' ahnd select: Environment Variables... For all users edit the System path variable for user only edit the User path variable New and add C:\Program Files\PostgreSQL\12\bin
To trust local users for no password on command line required replace C:\Program Files\PostgreSQL\12\data\pg_hba.conf with: https://gist.github.com/bradkrane/e5da73561b8f6c3dcce000d20bbd7eb8
host all all 127.0.0.1/32 trust host all all ::1/128 trust
Now on the command line you should get:
C:\Users\Brad Krane>psql psql: error: could not connect to server: FATAL: role "Brad Krane" does not exist https://stackoverflow.com/questions/17633422/psql-fatal-database-user-does-not-exist
Add your Windows username as a roll in the admin console roll Open pgAdmin and edit add the role. Login/Group Roles -> Create -> Login/Group Role Set the name as the FATAL role above: Brad Krane Privledges -> Can login? and Superuser? or whatever works
- When setting up users/roles in pgAdmin they are case sensitive and should match your Windows username exactly.
Create DB for your role same name Databases -> Create -> Databases... Call Database the same as the role/user name
Now on the command line you should get:
C:\Users\Brad Krane>psql psql (12.4) WARNING: Console code page (437) differs from Windows code page (1252) 8-bit characters might not work correctly. See psql reference page "Notes for Windows users" for details. Type "help" for help.
Brad Krane=#