PostgreSQL Connection To Database

in this tutorial, we will show you how PostgreSQL connection to the database is established.

How PostgreSQL connection to the database is established

PostgreSQL is implemented using a simple “process per user” client/server model. In this model, every client process is connected to exactly one server process.

postgres connection

 

  1. Client process requests the master server process called POSTMASTER process for a connection to the database instance.
  2. The postmaster process creates a new backend process called postgres process.
  3. Then the details in connection string will undergo authentication check and if everything is fine, the postmaster process will assign the newly created backend process to the client process.
  4. Once a connection is established the client process can send a query to the backend (server). The query is transmitted using plain text, i.e., there is no parsing done in the frontend (client).
  5. The server parses the query, creates an execution plan, executes the plan and returns the retrieved rows to the client by transmitting them over the established connection

Example.,

postgresql connection

Here, I tried to establish a connection, as still the connection is not yet created, but a backend is created with PID 26190

Then I passed a wrong password and connection disappeared.

postgres connection establised

 

Words from postgreshelp

Thank you for giving your valuable time to read the above information. I hope the content served your purpose in reaching out the blog.
Suggestions for improvement of the blog are highly appreciable. Please contact us for any information/suggestion/feedback.

If you want to be updated with all our articles

please follow us on Facebook Twitter
Please subscribe to our newsletter.

 

Leave a Reply