What is the difference between pgAdmin and Postgres.app? - postgresql

After reading official websites as well as conducting Google research I still do not clearly understand how pgAdmin and Postgres.app relate to one another?
For example, I can simultaneously run two different local postgres servers on different ports from both pgAdmin and Postgres.app, which is confusing. I thought that those application depend on one another, but it does not seem so.

Postgres.app is a full-featured PostgreSQL installation packaged as a standard Mac app. It sets up a PostgreSQL database server on your computer when you install it.
PgAdmin is graphical user interface administration tool for PostgreSQL. It is a client tool for working with existing local or remote PostgreSQL servers. It does not include a PostgreSQL database server.

Related

Different users in PGAdmin Web and PGAdmin Desktop Application

When I was trying to access PGAdmin Web and PGAdmin Desktop (maybe called as Client), I found that Web version and Desktop version are showing different users. I want to have same user across both the versions. Though I used different accounts, I got access to same server.
I'm using Ubuntu 22.04, PGAdmin4 version: 6.18, PostgreSQL version:14.6
Any help is highly appreciated.

Why is PostgreSQL remembering my previous instalations?

Recently I installed PostgreSQL 10.4, but it was losing connection all the time. I uninstalled it, removed the data folder and installed version 9.6, which didn't help, so I uninstalled it as well and removed the data folder. I installed 10.4 again hoping that it will work well this time.
When I opened pgAdmin it showed as if version 9.6 was still installed apart form the 10.4 (which should be there). I tried creating a user in it (to see if it really works) and it created it successfully, but after further investigation I realized that it created the same user in the 10.4 installation. It must have been the same installation, but pgAdmin saw it as two separate ones. I deleted both installations form pgAdmin and reinstalled version 10.4.
Everything works fine now, but I still wanted to ask what might have caused this issue? Can it cause problems for my existing db in the future?
It's not "PostgreSQL" that remembered the installation. It's pgAdmin where you simply didn't delete the configured connection. Connection information is something specific to the SQL client, not the database server.
The existing connection definition uses the same hostname, port and apparently password that was valid for a running 9.6 server or the new Postgres 10 server. The name of that "server" is something that is specified in pgAdmin and has nothing to do with the actual Postgres installation. You could have named the "9.6 Server" connection "Connect to some nice DBMS" instead.
That information is not stored together with the PostgreSQL installation, but in your user profile.

Which PostgreSQL Package to Install

We have the following requirements. Could anyone suggest which PostgreSQL package to choose?
Server supporting multiple connections on the same port
Trigger
GUI to interact with the server
Features to support back up & restore database
Ability to connect to a remote postgreSQL server
We would require it for both Windows 7 & OS X El Capitan
UPDATE:
The below link contains multiple links to download PostgreSQL. As we can not download all of them & try out, require someone's help to point us to the right package with the above mentioned components/features
postgres
postgres
pgAdmin
pg_dump, pg_restore, psql
psql lets you specify database (including remote) to connect to
All above works both windows and osX
EnterpriseDb has free packages for postgres that include commonly used components like pgAdmin (a GUI). They have packages for both Windows and OS X but I would use homebrew instead for OS X. Homebrew is an OS X package manager. There's several tutorials for installing postgres via Homebrew. Here is one.
You would install pgAdmin separately.
Installing via Homebrew is a little more complex but gives you more flexibility and capability.
If you're just starting out with postgres, the EnterpriseDB packages will be easier.

PostgreSQL default cluster?

I am running PostgreSQL 9.3 on Ubuntu 14.04 LTS. I didn't remember creating a cluster but directly went to create database.
Using pg_lsclusters, I found that I have a cluster as following with my db
Ver Cluster Port Status Owner Data directory
9.3 main 5432 online postgres /var/lib/postgresql/9.3/main
I was reading the PostgreSQL documentation but couldn't find relevant info.
I have the following questions:
Does PostgreSQL automatically create default cluster? And if so, is it good practice to use it?
Does PostgreSQL also automatically start the default cluster? I never started but its status is online and I can see it in system-monitor.
Thanks for any clarifications!
You're really asking about "PostgreSQL on Debian or Ubuntu", as it's the packaging and wrapper utilities doing this, not PostgreSQL its self.
See the PostgreSQL help on the Ubuntu community wiki for information. This mostly applies to Debian too, since it uses the same style of packaging for PostgreSQL.
To your specific questions:
Does PostgreSQL automatically create default cluster? And if so, is it good practice to use it?
Strictly pg_wrapper, the Ubuntu/Debian tool that manages PostgreSQL installs, creates it. Yes, it's fine to use it and there's generally not much reason not to.
Does PostgreSQL also automatically start the default cluster?
This depends on your operating system and its PostgreSQL packages, not on PostgreSQL its self. For information on how to configure what starts on Ubuntu, see Boot Howto - Ubuntu Community Wiki.

Unable to install PostgreSQL on dev machine

I'm trying to install PGSQL 8.3 (and 8.4 and 9.0) on my work laptop. At the end of the installation, the installer complains it can't init the cluster. Investigating more, I noticed that the service is not even installed. I did use the "OneClick Installer", not the pgAdmin stand alone install. I tried installing as Administrator and as a regular user. In all the cases, the pgsql system account is created and the files copied, but the service is not.
I successfully installed PGSQL many times on my home PC. Both the laptop and desktop use Windows 7 64 bits (former is Professional, later is Ultimate). The only differences I can think of are that the laptop is part of an Active Directory and uses McAfee, while the desktop is only on a workgroup and uses Windows Security Essentials.
Are you sure the postgres user is allowed to create files in the data directory? The installer defaults to putting the data directory where the binaries are installed (e.g. c:\Program Files) which is usually not writeable by a regular user (and I never understood why the installer contains such an idiotic default).
McAffee could be an issue though. I have heard several stories about virus scanners infering with the Postgres (or other DBMS). Can you turn McAffee off - at least for the data directory?
Another problem could be that the installer is not able to create the postgres windows user (that is used to run the service).
If you are a local administrator on that machine, try to create the user before the installer does it. The installer will then not try to create the user account.
As a last ressort, you could install PostgreSQL without the installer (this is what I usually do).
Download the ZIP file from http://www.enterprisedb.com/products-services-training/pgbindownload
Unzip it into a convenient location
Run initdb (make sure you do that using the postgres user account - the one that is used to run the service later!)
run pg_ctlr register to create the Windows service
If any of those steps fails you'll see a proper error message which is not always the case with the installer.
Anti-virus is a well known issue:
http://wiki.postgresql.org/wiki/Running_&_Installing_PostgreSQL_On_Native_Windows#Antivirus_software
PostgreSQL connection problems
(answer is from one the core developers)
Postgresql 8.4 and BitDefender 11
With earlier versions of PostgreSQL, I found I had to delete the user "postgres" before reinstalling would work. Not sure what versions had that problem, though.