Re: initdb and "exit_nicely"... - Mailing list pgsql-general

From Tom Lane
Subject Re: initdb and "exit_nicely"...
Date
Msg-id 862.959298997@sss.pgh.pa.us
Whole thread Raw
In response to Re: initdb and "exit_nicely"...  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
Peter Eisentraut <peter_e@gmx.net> writes:
> How do you find out if a directory is empty?

Good question.

> The best way I could think of is this:

> test x"`ls -A "$PGDATA"`" = x

The embedded quotes might confuse some shells, no?  Perhaps better
    CONTENTS=`ls -A "$PGDATA"`
    if test "x$CONTENTS" = x

> Are we talking 7.0.1 material, btw?

Well, we would be if we were sure of the patch.  I'm a little worried
about portability though.  Given that this isn't a very critical issue
(IMHO) I'd recommend saving it for the 7.1 cycle.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: PG 7.0 vacuum problem
Next
From: Marcin Inkielman
Date:
Subject: Re: PG 7.0 vacuum problem