From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: [HACKERS] initdb |
Date: | 2003-10-09 23:37:56 |
Message-ID: | 200310092337.h99NbuV19963@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-patches |
This has been saved for the 7.5 release:
http:/momjian.postgresql.org/cgi-bin/pgpatches2
I know initdb might be in C for 7.5, but this behavior has to be ported
to 7.5 too then.
---------------------------------------------------------------------------
Andrew Dunstan wrote:
> Peter Eisentraut wrote:
>
> >Andrew Dunstan writes:
> >
> >
> >
> >>So if the data directory previously existed and was empty, we don't
> >>clean it out on error, even if we didn't use the noclean flag. Is this
> >>intended behaviour or a bug? (If a bug it's trivially easy to fix.)
> >>
> >>
> >
> >If the data directory already existed, we don't want to delete it. We
> >should possibly delete the content, though.
> >
> >
> >
> yes, that's what I meant.
>
> Here's a patch which should work, I think:
>
> Index: src/bin/initdb/initdb.sh
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/bin/initdb/initdb.sh,v
> retrieving revision 1.203
> diff -c -w -r1.203 initdb.sh
> *** src/bin/initdb/initdb.sh 27 Sep 2003 16:27:57 -0000 1.203
> --- src/bin/initdb/initdb.sh 1 Oct 2003 21:06:07 -0000
> ***************
> *** 44,49 ****
> --- 44,53 ----
> if [ "$made_new_pgdata" = yes ]; then
> echo "$CMDNAME: removing data directory \"$PGDATA\"" 1>&2
> rm -rf "$PGDATA" || echo "$CMDNAME: failed" 1>&2
> + else
> + echo "$CMDNAME: removing contents of data directory
> \"$PGDATA\"" 1>&2
> + rm -rf "$PGDATA"/* || echo "$CMDNAME: failed" 1>&2
> fi
> else
> echo "$CMDNAME: data directory \"$PGDATA\" not removed at
> user's request" 1>&2
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2003-10-09 23:54:42 | Re: [Fwd: [Python-Dev] HP Test Drive systems] |
Previous Message | Bruce Momjian | 2003-10-09 23:15:41 | postgres --help-config |
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2003-10-10 01:35:05 | Re: pg_id.c windows fix |
Previous Message | Bruce Momjian | 2003-10-09 19:07:10 | Re: introduce "default_use_oids" |