2

I'm trying to enable windows authentication for Postgresql 9.3 (Windows x64 not in domain, UAC is disabled, my account is local admin). The one click installer set the server running under NETWORKSERVICE which I think is fine. I followed this answer but it does not work:

C:\Program Files\PostgreSQL\9.3\bin>createdb --host=localhost testdb
Password:
Password:
createdb: could not connect to database template1: fe_sendauth: no password supplied

Created Login Roles named exactly as Windows account names - still no luck. What am I doing wrong? All the manuals I found on the net either obsolete or not applicable (require AD).

1

You haven't set the auth type to sspi in pg_hba.conf for the user/host/database combo you're using.

  • Thanks! Shouldn't this entry do the job: host all all 0.0.0.0/0 sspi ? – UserControl Jul 8 '14 at 7:44
  • Yes, but perhaps another entry is matching first? Show the whole file. – Craig Ringer Jul 8 '14 at 7:55
  • My bad! I left the default entries uncommented. Now it's working just fine - God bless you! – UserControl Jul 8 '14 at 8:37
4

If anyone else encounters this like I did so starting from 9.5 you will need to add an optional parameter both to the ipv4 and ipv6 in order for this to work

include_realm=0

so the whole thing will look like

host all your_username 127.0.0.1/32 sspi include_realm=0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.