Correction, it does not work. At least not the way i think it should. The database does not start when i register the service with pg_ctl. I can only start the cluster with the postgres2 user. I get the prompt back, but i can not close the window. The dos command "exit" causes all interaction with the dos window to disappear. Postgres will keep on running undisturbed, but when i kill the window, it is killed too. But i can stop the postgres server with the admin user.
I simply want to start a new cluster on windows. after a lot of frustration, the solution is too stupid for words: restart windows. and then they actually make us pay for it :( WBL On Thu, Nov 6, 2008 at 1:10 PM, Willy-Bas Loos <[EMAIL PROTECTED]> wrote: > ok, when i start a new cmd window from runas, and run the pg_ctl command > from there, the process will start. > btw you also have to change the ownership and permissions on the > postgresql.conf, pg_hba.conf and pg_ident.conf files. > > C:\Program Files\PostgreSQL\8.3\bin>runas /user:postgres2 "cmd /k" > Will open a cmd window that stays open. > It starts in the wron folder, so i change it to the Postgres bin. From > there i can run the pg_ctl command and it works. > It also works when i use pg_ctl register as an admin user, specipying the > -U and -P options. > BTW this is all on Windows NT 4.0 > > It works now, but i think the error message could be improved somewhat. > > cheers, > > WBL > > > > On Wed, Nov 5, 2008 at 2:36 PM, Willy-Bas Loos <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> I have a pgsql 8.3.3 cluster running on windows. >> I want to install another cluster, so i use initdb. >> Because the postgres user must own the files, i use runas to run initdb as >> postgres2 (the correct user here). >> I've created a separate folder for the data files of this cluster. The >> folder is owned by the admin user, but posgres2 has full control of it (ok, >> maybe i should squeeze that down a little strictly speaking) >> As far as i can see, that is the preferred way to create a cluster in ms >> windows. Is that correct? >> >> The resulting cluster does not start with pg_ctl. The postgres executable >> is in the bin folder, just like pg_ctl. >> The other cluster is running. >> >> ##====in the cmd window:===== >> C:\Program Files\PostgreSQL\8.3\bin>runas /user:mydomain\postgres2 "initdb >> -D \"C:\Program Files\PostgreSQL\8.3\data_5433\" --no-locale" >> Enter the password for mydomain\postgres2: >> Attempting to start initdb -D "C:\Program Files\PostgreSQL\8.3\data_5433" >> --no-locale as user "mydomain\postgres2" ... >> ## remark from me: starts a new window in which it does initdb. window >> closes after execution :( >> >> C:\Program Files\PostgreSQL\8.3\bin>pg_ctl start -D "C:\Program >> Files\PostgreSQL\8.3\data_5433" >> server starting >> FATAL: postgres: could not locate matching postgres executable >> >> C:\Program Files\PostgreSQL\8.3\bin>pg_ctl start -D "C:\Program >> Files\PostgreSQL\8.3\data_5433" -p "C:\Program >> Files\PostgreSQL\8.3\bin\postgres.exe" >> server starting >> C:\Program Files\PostgreSQL\8.3\bin>FATAL: postgres: could not locate >> matching postgres executable >> >> C:\Program Files\PostgreSQL\8.3\bin>pg_ctl start -D "C:\Program >> Files\PostgreSQL\8.3\data_5433" -o "-p \"C:\Program >> Files\PostgreSQL\8.3\bin\"" >> server starting >> FATAL: ongeldige waarde voor parameter "port": "C:\Program >> Files\PostgreSQL\8.3\bin" >> >> C:\Program Files\PostgreSQL\8.3\bin>pg_ctl status -D "C:\Program >> Files\PostgreSQL\8.3\data" ## <-- the other cluster >> pg_ctl: server is running (PID: 2056) >> ##===================== >> >> Cheers, >> WBL >> -- >> "Patriotism is the conviction that your country is superior to all others >> because you were born in it." -- George Bernard Shaw >> > > > > -- > "Patriotism is the conviction that your country is superior to all others > because you were born in it." -- George Bernard Shaw > -- "Patriotism is the conviction that your country is superior to all others because you were born in it." -- George Bernard Shaw