BUG #5347: initdb does not work when a data directory has been deleted - Mailing list pgsql-bugs

From David Andersen
Subject BUG #5347: initdb does not work when a data directory has been deleted
Date
Msg-id 201002261141.o1QBfp4o031577@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5347: initdb does not work when a data directory has been deleted  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      5347
Logged by:          David Andersen
Email address:      david.andersen@andersen-innovation.com
PostgreSQL version: 8.4.2
Operating system:   Windows 7 64-bit
Description:        initdb does not work when a data directory has been
deleted
Details:

I had my database placed at /data. The data in that database was somehow
corrupted (my mistake) so I dropped the database with the following
warnings:

postgres=# drop database adatabase;
WARNING:  could not remove file or directory "base/16397": Directory not
empty
WARNING:  some useless files may be left behind in old database directory
"base/16397"
DROP DATABASE

I then deleted the whole directory /data and attempted to run initdb again
as seen below. A workaround, which worked was to run initdb -D ..\data3. So
the severity of this bug is very low, but I want postgresql to be perfect!

C:\Program Files (x86)\PostgreSQL\8.4\bin>initdb -D ..\data
The files belonging to this database system will be owned by user "David
Andersen".
This user must also own the server process.

The database cluster will be initialized with locale Danish_Denmark.1252.
The default database encoding has accordingly been set to WIN1252.
The default text search configuration will be set to "danish".

initdb: directory "../data" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "../data" or run initdb
with an argument other than "../data".

C:\Program Files (x86)\PostgreSQL\8.4\bin>dir ..
 Volume in drive C is OS
 Volume Serial Number is 2A35-DFB6

 Directory of C:\Program Files (x86)\PostgreSQL\8.4

26-02-2010  12:34    <DIR>          .
26-02-2010  12:34    <DIR>          ..
22-02-2010  15:16    <DIR>          bin
02-02-2010  11:07    <DIR>          csv
04-02-2010  11:11       321.557.856 csv.zip
23-02-2010  19:57    <DIR>          data2
29-01-2010  21:36    <DIR>          doc
29-01-2010  21:36    <DIR>          include
29-01-2010  21:36    <DIR>          installer
29-01-2010  21:36    <DIR>          lib
29-01-2010  21:36    <DIR>          pgAdmin III
29-01-2010  21:37               358 pg_env.bat
08-02-2010  11:10    <DIR>          scripts
29-01-2010  21:36    <DIR>          share
29-01-2010  21:36    <DIR>          StackBuilder
29-01-2010  21:37    <DIR>          symbols
29-01-2010  21:37         2.914.462 uninstall-postgresql.exe
               3 File(s)    324.472.676 bytes
              14 Dir(s)  197.489.139.712 bytes free

C:\Program Files (x86)\PostgreSQL\8.4\bin>

pgsql-bugs by date:

Previous
From: Oleg Serov
Date:
Subject: Re: Diffrent column ordering after dump/restore tables with INHERITS
Next
From: Greg Stark
Date:
Subject: Re: Diffrent column ordering after dump/restore tables with INHERITS