Reputation: 27
I just run postgresql_17.3_1_windows_x64 installer from their website. Agree on admin window, and then this error pops up. Maybe it is because of Win - 10 user name on my local machine. Anyways this is what I get:
This is what I get on [System.Globalization.CultureInfo]::InstalledUICulture:
LCID Name DisplayName
1033 en-US English (United States)
Upvotes: -1
Views: 110
Reputation: 1
I tried multiple ways to resolve this error, but none worked. However, I was able to successfully install PostgreSQL using its ZIP version, which is available on the official website.
You can download it directly from the following link:
https://www.enterprisedb.com/download-postgresql-binaries
Once downloaded, extract the ZIP file into a folder of your choice, either Downloads, Documents or any preferred location.
Inside the extracted folder, locate the bin directory, and add this bin path in your Path in environment variables.
Now, we are going to create a database cluster directory, so first off, create a folder called How You Want to, after that, you must turn that folder into a database cluster.
So, open a cmd tab with admin privilege and run the following command to initialize the cluster:
initdb -D /path/to/your/database
Now, we are going to start the server with the following command:
pg_ctl -D "path/to/your/database" start
You check whether your server is up or down with the following command:
pg_ctl -D "path/to/your/database" status
Now, we are going to connect to our database without a specific user with the following command:
psql -d postgres
Once we get in, we will create a new user role with its password using the following command:
CREATE ROLE new_user WITH LOGIN PASSWORD 'new_password';
Now, let's exit the PostgreSQL console using:
\q
Now, we are going to connect it to our database using the name created with the following command:
psql -U new_user -d postgres
Now, for obvious reasons, we would like to use PostgreSQL with graphical Interface, so we must install the last version of pgAdmin4 on its official webpage which link is:
https://www.pgadmin.org/download/
After that, we are going to open it up and by adding a new server: You will a pop-up where you have to enter a name of your choice in the 'Name' field, then go to the 'Connection' tab:
In the 'Host/Address' field, enter the localhost. For 'Username' and 'Password', use the credentials you created earlier in the command prompt.
EXTRA:
Give privilege to your created username:
GRANT CREATE ON SCHEMA public TO your_username;
GRANT CONNECT ON DATABASE your_db TO your_username;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO your_username;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON TABLES TO your_username;
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO my_user;
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO my_user;
ALTER ROLE your_username CREATEDB;
ALTER ROLE your_username SUPERUSER;
Upvotes: 0
Reputation: 48
Looks like a permission issue. try install it via a package manager like Chocolatey.
https://community.chocolatey.org/packages/postgresql
Upvotes: -1