Ansh Day
Ansh Day

Reputation: 51

"existing data directory" error when installing PostreSQL for mac

Hey guys i have been trying to download it from the below link http://www.enterprisedb.com/products-services-training/pgdownload

But once i download it, and try to run the set up it is giving me an error saying

An existing data directory has been selected but its neither empty, or a recognizable date directory,I tried changing the path on which it has to be downloaded it is not letting me do so

Upvotes: 0

Views: 6792

Answers (4)

John B
John B

Reputation: 9

I found that if I create an empty folder and install into that it works.

Upvotes: 0

kt-0
kt-0

Reputation: 377

Recently had this issue after attempting a reinstall of PostgreSQL on macOS 11.6 Removing the contents of the /Library/PostgreSQL/14/data directory seemed to resolve the issue and was able to successfully reinstall

Upvotes: 0

user330315
user330315

Reputation:

Disclaimer: I have no experience with Postgres on Mac (or with a Mac at all).

The installer will create a directory where PostgreSQL stores all the database data and information. Without this so called "data directory" PostgreSQL does not work.

This data directory has nothing to do with your download directory.

Apparently you are pointing the installer to a directory that already exists and contains some data (not necessarily Postgres related data).

When being prompted for the "data directory" during installation you have to select an empty directory.

I don't know if the selection dialog of the installer will let you create a new directory, so you might want to create that directory manually before starting the installer.

Upvotes: 1

Kevin Sylvestre
Kevin Sylvestre

Reputation: 38092

I'd recommend trying a package manager such as brew. Once you have it installed simply:

brew install postgres

Upvotes: 1

Related Questions