Enable Postgresql in Cygwin

I installed Cygwin with the Perl and Postgresql packages included.

Then printed:

  /usr/bin/cygserver-config (This will install the service) 

Then enter:

 net start cygserver(This starts the service) 

Next, I need to enable Postgresql in Cygwin, so I tried the commands mentioned below:

 cygrunsrv -S cygserver initdb -D /usr/share/postgresql/data pg_ctl start -D /usr/share/postgresql/data -l /var/log/postgresql.log createdb psql 

I get an error message:

 $ initdb -D /usr/share/postgresql/data -bash: initdb: command not found $ pg_ctl start -D /usr/share/postgresql/data -l /var/log/postgresql.log -bash: pg_ctl: command not found 

Can someone please tell me how to do it right.

+8
cygwin
source share
1 answer

Postgresql initdb and pg_ctl executables are located under /usr/sbin .

I assume /usr/sbin not in the PATH setting. Adding it should do the trick.

I am using a start / stop script that I am holding under $HOME/bin called pg . Here is the gist .

+12
source share

All Articles