Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 292168553CF for ; Mon, 11 Jun 2012 23:23:19 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SeGlG-00038a-JM for pgsql-bugs@postgresql.org; Tue, 12 Jun 2012 02:23:18 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q5C2N0h3009941; Mon, 11 Jun 2012 22:23:00 -0400 (EDT) From: Tom Lane To: Edmund Horner cc: pgsql-bugs@postgresql.org, Bruce Momjian Subject: Re: 9.2 beta2 - pg_ctl crashes on Win32 when neither PGDATA nor -D specified In-reply-to: References: Comments: In-reply-to Edmund Horner message dated "Mon, 11 Jun 2012 18:40:18 +1200" Date: Mon, 11 Jun 2012 22:23:00 -0400 Message-ID: <9940.1339467780@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/112 X-Sequence-Number: 33339 Edmund Horner writes: > In 9.1, if I run "pg_ctl start" without providing way for it to find > the datadir, it prints the error: > C:\ehorner\pgsql-old\bin>pg_ctl start > pg_ctl: no database directory specified and environment variable > PGDATA unset > Try "pg_ctl --help" for more information. > In 9.2 (beta1 and beta2), it runs for a couple of seconds and then > Windows pops up an error box saying it has "encountered a problem". I > ... > I think it could be something in > http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=aaa6e1def292cdacb6b27088898793b1b879fedf#patch5 Hm, that patch seems to be several bricks shy of a load. I will fix two obvious bugs in it: (1) not dump core on boxes where printf("%s", NULL) dumps core; (2) not try to call adjust_data_dir before complaining for lack of a -D switch; since adjust_data_dir does not do anything to the value of pg_config, it's just silly to do things in that order. However, > I note that "postgres -C data_directory" will refuse to run on the > command line because I've got admin privileges in Windows, and that > pg_ctl normally starts postgres.exe using CreateRestrictedProcess. > But it does not do so for the popen call in adjust_data_dir. if that actually is a third bug, as seems likely, somebody with access to a windows environment will need to deal with it. regards, tom lane