Re: [PATCHES] [Patch] - Fix for bug #2558, InitDB failed

From: "dror" <dror_b(at)hotmail(dot)com>
To: "Andreas Pflug" <pgadmin(at)pse-consulting(dot)de>; "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Bruce Momjian" <bruce(at)momjian(dot)us>; pgsql-hackers(at)postgresql(dot)org; "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Subject: Re: [PATCHES] [Patch] - Fix for bug #2558, InitDB failed
Date: 2006-08-15 18:50:40
Message-ID: BAY124-W8734AD5E276C516D22CE1F94F0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In addition to Andreas respond:
1+2) Currently the initDB is used the tmp folder to write other "Helper files" that are deleted afterwards.

The fix is suggested only for win machines ,I think that redirection is more risky (as we saw with this bug) than to do redirect output to a log file that you created and control it ,you gave the permission to and know exactly what its status (even if the reason is that some virus scanner or any other software blocked access to one device or another).
But, I suggest a new improvement:
Check the status and if the command failed than run it without redirection at all, (actually no redirection is needed in this case , you can always run the process in silent mode).

The interesting question that didn't get any answer yet is:
Why EnterpriseDB (which is based on postgress) find it important to change the redirection?Regards
Dror,

> Date: Tue, 15 Aug 2006 19:10:27 +0200> From: pgadmin(at)pse-consulting(dot)de> To: tgl(at)sss(dot)pgh(dot)pa(dot)us> CC: bruce(at)momjian(dot)us; pgsql-hackers(at)postgresql(dot)org; andrew(at)dunslane(dot)net> Subject: Re: [HACKERS] [PATCHES] [Patch] - Fix for bug #2558, InitDB failed to run> > Tom Lane wrote:> > Andreas Pflug <pgadmin(at)pse-consulting(dot)de> writes:> > > >> what issues might arise if the output is redirected to a legal tmp file?> >> > >> > Well, (1) finding a place to put the temp file, ie a writable directory;> > (2) ensuring the file is removed afterwards; (3) not exposing the user> > to security hazards due to unsafe use of a temp file (ye olde> > overwrite-a-symlink risk). Perhaps a few more I didn't think of.> > > > AFAICS all DEVNULL usages result from redirecting postmaster's output,> which usually goes to $DATADIR/serverlog at runtime. If this would be> used here too, (1) is as safe as any $DATADIR, (2) is as safe as> cleaning up after failure usually is, (3) can't happen because the> directory is checked to be empty before initdb anyway. Additionally,> there's might be cases when a meaningful logfile from initdb is> desirable too. So why no redirection to initlog or so?> > Regards,> Andreas> > > > ---------------------------(end of broadcast)---------------------------> TIP 6: explain analyze is your friend
_________________________________________________________________
Try Live.com: where your online world comes together - with news, sports, weather, and much more.
http://www.live.com/getstarted

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2006-08-15 18:55:22 Re: [HACKERS] Forcing current WAL file to be archived
Previous Message Jim C. Nasby 2006-08-15 18:50:16 Re: An Idea for planner hints