"existing data directory" error when installing PostreSQL for mac - postgresql

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

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

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.

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

Related

PostgreSQL directory doesn't appear where database says it is

I am newbie in postgres. I am trying change the access type to my local database. I read many blogs about how to do this but when I tried locate the PostgresQL folder, it doesn't appear in any place. I entered to database and write SHOW hba_file then I got the folder path. But, when I am looking for it from bash, the folder doesn't exist. I am not sure what is happening here. I am on Mac Catalina 10.15.6. I am using Iterm2 with ZSH.

Uninstall SQL Developer on Win 10

I might have installed the wrong version of Oracle SQL Developer (Version 4.1.4) on my Win 10 laptop. So I want to uninstall it and install a newer version.
Any idea what´s the easiest way to do it?
Find the directory it was unzipped to, e.g. C:\Program Files\sqldeveloper, though it could be anywhere - quite likely in your downloads directory; and just delete that entire sqldeveloper directory.
There is no installation as such, it's just a Java application sitting in a directory.
Settings are held under your personal home directory, and when you unzip and run the later version (18.2 is current) you'll be asked if you want to migrate those settings, which will include any connections you've already defined.
Read more in the 4.1 documentation.
It is not installed so you can't uninstall it. To remove it from system do following:
Delete base directory, where you unziped it (where you run it).
Delete your user connection data - folder C:\Users\<username>\AppData\Roaming\SQL developer
If you don't have any other oracle software, delete your user configuration data - folder C:\Users\<username>\Oracle

Can I install postgresql without pgAdmin4?

I was packaging an windows application installer by NSIS.
An postgresql binary file was included in this install package.
But the official binary file is too large 172MB.
The zip archive is download from
https://www.enterprisedb.com/download-postgresql-binaries
The inside structure is like
pgsql
bin
doc
include
lib
pgAdmin4
share
StackBuilder
symbols
In my opinion, pgAdmin4 is no need for my installer.
There are only CRUD operations in between application and SQL.
If I remove this directory, the binary zip can down to 41MB.
So could I simply remove directory pgAdmin4 and re-compress
to achieve this?
So could I simply remove directory pgAdmin4 and re-compress to achieve this?
Yes, and you can remove StackBuilder too if you want. Also symbols if you don't want to do in-place debugging if the postgres server crashes.
Please, please install your bundled PostgreSQL on a non-default port (not 5432) and if you run it as a service use a name associated with your application, so users know where it came from. See Installation of postgresql with NSIS . Put the PostgreSQL install directory within your app install directory.

Does Postgresql work after copied to other directory on windows?

I'm new to Postgresql and am going to install on A directory for my Application.
After building a package including the Application and Postgresql, I should deliver it to other user(by Installer but Postresql is not embedded).
I was wondering if it is okay for me to just copy Postgresql to other directory without any consideration of registry or environment variables on Windows.
Does it work by copying the all of directories to other directory or server?
If you stop the running PostgreSQL service, and you preserve file permissions when copying/moving, and the destination is also a NTFS filesystem, it will work. But you'll have to adjust the service definition or create a new one to start from the new location; PostgreSQL won't know where the data directory is until you tell it.
However.
You should simply initdb PostgreSQL where it needs to be in the first place. There's no need to copy or move the data directory. Ask the user where they want it to be put and then put it there from the start.
I strongly recommend that you bundle PostgreSQL binaries in your installer rather than having the user run a PostgreSQL installer first. Then have your app initdb its own private PostgreSQL data directory for its use.
See Installation of postgresql with NSIS (it doesn't matter if you're not using NSIS, the principles are the same).

Connecting existing data folder in fresh installation

I had to reinstall Postgres x64 9.0.18 on Windows 7 from scratch and I have a full copy of the old data folder. How can I weave the existing database folder into the fresh installation of Pg 9.0.18? When I install over the same directory structure, the install routine recognizes the old data folder but claims that it doesn't contain proper database data. I also tried to start the postgres service with a different data directory (pointing -D to the copy of /data), but it won't start. Can I somehow edit or patch something in order to access my old database? In former versions there was a pg_databases file.