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.
- Client process requests the master server process called POSTMASTER process for a connection to the database instance.
- The postmaster process creates a new backend process called postgres process.
- 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.
- 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).
- 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.,
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.
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.