Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
50.2. How Connections Are Established
Prev UpChapter 50. Overview of PostgreSQL InternalsHome Next

50.2. How Connections Are Established#

PostgreSQL implements aprocess per user client/server model. In this model, everyclient process connects to exactly onebackend process. As we do not know ahead of time how many connections will be made, we have to use asupervisor process that spawns a new backend process every time a connection is requested. This supervisor process is calledpostmaster and listens at a specified TCP/IP port for incoming connections. Whenever it detects a request for a connection, it spawns a new backend process. Those backend processes communicate with each other and with other processes of theinstance usingsemaphores andshared memory to ensure data integrity throughout concurrent data access.

The client process can be any program that understands thePostgreSQL protocol described inChapter 53. Many clients are based on the C-language librarylibpq, but several independent implementations of the protocol exist, such as the JavaJDBC driver.

Once a connection is established, the client process can send a query to the backend process it's connected to. The query is transmitted using plain text, i.e., there is no parsing done in the client. The backend process parses the query, creates anexecution plan, executes the plan, and returns the retrieved rows to the client by transmitting them over the established connection.


Prev Up Next
50.1. The Path of a Query Home 50.3. The Parser Stage
pdfepub
Go to PostgreSQL 17
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp