Dear Readers,
Happy new year 2021!!!
This is my first day of learning PostgreSQL and I faced issue while installing version 13.1 on windows. After almost spending 3 hours of troubleshooting I was able to identify the issue & fix it.
In this post will explain basic steps to install Postgresql 13.1 on windows 10 & possible resolution in case you face similar issue.
First step is to download required software from required software from enterprisedb website. I downloaded version 13.1 for Windows x86-64.
Once the intended software is downloaded, you can run it as administrator. This will open setup screen. Click on next
You can choose to use default location & click next:
I wanted to install complete pg setup so checked all options & clicked next:
You can choose default location and click next:
You need to remember this password to connect to you postgresql cluster. Click next:
5432 is default port. You can keep it & click next:
Choose default option & click next:
You will see pre installation summary here:
Now we are ready to begin installation:
Installation in progress:
And it failed with below error:
I saw one more error after pressing OK button:
Though it shown me below screen at the end showing setup completion:
As expected installation was incomplete. DATA folder was empty.
I tried connecting to postgresql cluster using psql CLI. It failed connecting with below error:
I tried googling about all 3 errors, tried different solutions, but nothing worked. So though of trying lower version 12 but it ended with same story.
After lot of investigation, I found some movement in antivirus software whenever the setup was about to finish. After checking antivirus scan report, I was able to find the issue. Every time setup was about to complete, antivirus tried to clean possible threats it was identifying.
This time I decided to stop antivirus services during setup install & it worked without any issue :-). This time after setup completion, I was able to see number of files in DATA folder.
I tried connecting to postgresql cluster & it was working as expected;
Hope u will find this post very useful.
Cheers
Regards,
Adityanath
If you are having trouble installing PostgreSQL on Windows 10, here are a few steps that may help:
1. Check to make sure that your computer meets the minimum system requirements for PostgreSQL.
2. Download the PostgreSQL installer from the PostgreSQL website.
3. Run the installer and follow the prompts.
4. If you run into any errors during the installation process, try looking for a solution in the PostgreSQL documentation or online.
5. Once PostgreSQL is installed, you can start using it by creating a database.
Why PostgreSQL is not installing?
Installing PostgreSQL on Windows 10 is a fairly simple process. You can either install it using the Windows installer, or you can use the more traditional method of installing it from source.
If you want to install PostgreSQL from source, you will first need to download the source code. You can do this from the PostgreSQL website (https://www.postgresql.org/download/). Once you have downloaded the source code, you will need to unzip it and navigate to the unzipped folder. From here, you will need to run the following commands:
./configure
make
make install
This will install PostgreSQL on your system. Once it is installed, you will need to initialize the database by running the following command:
initdb -D /usr/local/pgsql/data
This will create the necessary files and folders for your database. Once the database is initialized, you can start it by running the following command:
pg_ctl -D /usr/local/pgsql/data -l logfile start
You can then connect to the database using a tool like psql or pgAdmin.
Does PostgreSQL work on Windows 10?
Yes, PostgreSQL works on Windows 10. You can install it using the Microsoft Windows Installer for PostgreSQL, available from the PostgreSQL website. Once installed, you can use the psql command-line tool to connect to your PostgreSQL database.
Is Stack Builder necessary for PostgreSQL?
No, Stack Builder is not necessary for PostgreSQL.
Can I use PostgreSQL without install?
No, you cannot use PostgreSQL without installing it.
How do I enable PostgreSQL on Windows?
1. Download and install PostgreSQL from https://www.postgresql.org/download/windows/.
2. Follow the instructions provided by the installer.
3. Once installation is complete, open the PostgreSQL command line client and connect to the database server.
4. Enable the PostgreSQL server to start automatically when Windows starts by opening the Services control panel and setting the «PostgreSQL Server» service to «Automatic«.
Is psql the same as PostgreSQL?
No, psql is a command-line interface for PostgreSQL.
Which tool is best for PostgreSQL?
There are many tools available for PostgreSQL, and the best one for you will depend on your specific needs and preferences. Some of the most popular tools include pgAdmin, phpPgAdmin, and PgBouncer. If you are looking for a tool with a graphical user interface (GUI), then pgAdmin or phpPgAdmin may be a good option for you. If you are looking for a tool to help manage database performance, then PgBouncer may be a good option for you.
How to setup PostgreSQL in Windows?
1. Go to the PostgreSQL website and download the installer for your version of Windows.
2. Run the installer and follow the prompts.
3. Once the installation is complete, open the PostgreSQL command line interface.
4. Type in the following command to create a new database:
createdb mydatabase
5. You can now connect to your database using a tool like pgAdmin or psql.
How to manually install PostgreSQL?
1. Download PostgreSQL from the official website (https://www.postgresql.org/).
2. Run the installer and follow the prompts.
3. Choose the location for the installation and select the components you want to install.
4. Click «Finish» to complete the installation.
If you have any problems during the installation, please consult the PostgreSQL documentation (https://www.postgresql.org/docs/).
How much RAM is needed for PostgreSQL?
There is no definitive answer to this question as it depends on a number of factors, such as the size of your database, the number of concurrent users, the nature of your workload, etc. However, a good rule of thumb is to start with at least 4GB of RAM and then scale up from there as needed.
How to install Postgres locally?
Assuming you are using a Mac, you can install Postgres locally using Homebrew.
1. Install Homebrew if you don’t already have it installed (https://brew.sh/).
2. Use Homebrew to install Postgres: `brew install postgresql`
3. Initialize the database: `initdb /usr/local/var/postgres`
4. Start the database server: `pg_ctl -D /usr/local/var/postgres -l logfile start`
For more detailed instructions, see the Postgres documentation: https://www.postgresql.org/docs/9.3/static/tutorial-install.html
Is Postgres available for Windows?
Yes, Postgres is available for Windows. You can download it from the Postgres website (https://www.postgresql.org/download/). Once you have downloaded and installed Postgres, you can use the psql command-line tool to connect to your Postgres database.
Follow these steps to solve errors when installing Postgresql on Windows 8.1 and Windows 10.
- Create a new user account, called postgres
- Add the new account to the Administrators and Power Users groups.
- Restart the computer. The next step will not work without doing so.
- Run a command prompt as the Postgres user, using the command:
runas /user:postgres cmd.exe - Run the installer from the Postgres command window.
- Delete the Postgres user account, as well as the user directory, as it is not required after installation.
Updated on June 16, 2023
Related Articles
This page is intended to help people collect information to troubleshoot problems with the PostgreSQL Installers supplied by EnterpriseDB.
Many problems have already been identified and fixed, so make sure you’re using the installer for the latest point-release of PostgreSQL before reporting a problem.
Because some problems can’t be fixed in the installer, but are issues with the Windows installation or how it is being used, there is also a list of frequently asked questions and frequently encountered problems with PostgreSQL on Windows. Please read the common installation errors section, or preferably the whole document. You’ll probably save some time and hassle by doing so.
If you’ve tried all that, and you’re still having problems getting PostgreSQL installed, please read on to find out how you can collect the information we need to be able to help you with installation problems.
Make sure you’re installing on a supported platform
See the installer download page and (for Windows) the Running & Installing PostgreSQL On Native Windows for platform support details.
Please do not ask the mailing list for help with installation on unsupported Windows platforms. However, one of the paid PostgreSQL consultants, or EnterpriseDB (who make the PostgreSQL installer) may be able to help you on a paid basis.
Try again without your virus scanner or 3rd-party firewall
The Windows FAQ discusses potential issues with antivirus software and 3rd-party firewalls. If you’re encountering any installation issues, please try again with your virus scanner uninstalled (not just disabled) to see if the problem goes away. If it does, please report the fact to the mailing list and to the vendor of your antivirus product.
Read about other common installation problems
Before reporting a problem, please read the windows FAQ to see if your problem is one we’ve already seen and found a workaround or fix for.
Reporting an installation error
To be able to help you with an installation problem, we will need you to collect some basic details about your computer and the problem. Please see the instructions below.
Note down the basic information about your system
Any problem report must include:
- The exact words of any error message you see when the installation fails
- The exact version of PostgreSQL you are installing
- Whether you installed a 32-bit or 64-bit release of PostgreSQL
- The operating system and version you are using, eg:
- «Windows XP Professional with Service Pack 3»
- «Mac OS X 10.4.2»
- «Fedora Core 14»
- Whether you are running a 32-bit or 64-bit version of your operating system
- How you ran the installer. Command-line arguments, what user account you ran it from, etc.
- What antivirus and/or software firewall products you have installed, if any, even if they are disabled
- Which, if any, of the troubleshooting instructions you have already tried
- Whether a previous version of PostgreSQL was installed, and if so:
- whether you uninstalled it before running the new installer
- If you uninstalled a previous version, whether you did it with the uninstaller or some other way
- Whether you removed the postgres user/service account when you uninstalled
- Additional details and platform-specific information as described below
Collect the installer log file
The installer creates a log file in the system ‘temp’ directory. This will log all manner of data about the installation, and is invaluable when troubleshooting. The log will be called install-postgresql.log if the installation completed successfully. If not, the installer may not have been able to rename it, in which case the name will be either bitrock_installer.log or bitrock_installer_xxx.log, where xxx is a number (actually the process ID of the installation attempt).
On Linux and Mac systems, the logfile will almost always be found in the /tmp/ directory.
On Windows, the easiest way to find the logfile is to click Start -> Run, enter %TEMP% in the box and then click OK (these instructions apply to Windows XP and 2003 — adjust as necessary for other versions).
Get the contents of the PostgreSQL server error log
The PostgreSQL server has its own error log. This may not exist if installation failed early on, but it can be very informative for errors that happened later in installation. You can find it in the «pg_log» folder inside the data directory you chose for PostgreSQL. If it exists, please include it in any problem reports.
Windows users must collect additional Windows-specific details to help troubleshoot installation issues:
- (On Windows Vista and Windows 7): The UAC security level
- Whether you started the installer by logging in as Administrator, started it from from your own normal user account, or ran it using the «Run As Administrator» menu option.
- Whether your computer is a part of a Windows domain. Home computers usually are not, business computers usually are.
- Whether your computer and network has any Group Policy configured. If you’re on a corporate windows domain you probably have group policy and need to ask your network administrator for details about it.
Windows: Check for messages in the Windows event log
Please check the Windows Event Viewer for messages that might be related to installation problems or service startup problems.
TODO: detail on how to collect and save events.
Windows: Check what Group Policy, if any, is active on your computer
TODO: instructions for collecting domain and local group policy.
Windows: Take a copy of the environment variables set on the computer
Open a command prompt and run «set». Then copy and paste the results into your problem report.
I’d be better to collect the «all users» environment from the system control panel, but it’s not easy to just dump this information.