Postgresql 中文操作指南

1.2. Architectural Fundamentals #

在我们继续之前,您应该了解基本的 PostgreSQL 系统架构。了解 PostgreSQL 的各个部分如何交互可以让本章更加清晰。

Before we proceed, you should understand the basic PostgreSQL system architecture. Understanding how the parts of PostgreSQL interact will make this chapter somewhat clearer.

在数据库术语中,PostgreSQL 使用客户端/服务器模型。PostgreSQL 会话包括以下协作进程(程序):

In database jargon, PostgreSQL uses a client/server model. A PostgreSQL session consists of the following cooperating processes (programs):

与客户端/服务器应用程序一样,客户端和服务器可以位于不同的主机上。在这种情况下,它们通过 TCP/IP 网络连接进行通信。您应该记住这一点,因为在客户端计算机上可以访问的文件可能无法在数据库服务器计算机上访问(或者只能使用不同的文件名访问)。

As is typical of client/server applications, the client and the server can be on different hosts. In that case they communicate over a TCP/IP network connection. You should keep this in mind, because the files that can be accessed on a client machine might not be accessible (or might only be accessible using a different file name) on the database server machine.

PostgreSQL服务器可以处理来自客户机的多个并发连接。为实现这一目的,它为每个连接启动(“分叉”)一个新进程。从那时起,客户端和新服务器进程在原始_postgres_进程的干预下进行通信。因此,监督服务器进程始终在运行,等待客户端连接,而客户端和关联的服务器进程则来来去去。(当然,所有这些对用户都是不可见的。我们在这里提到它只是为了完整起见。)

The PostgreSQL server can handle multiple concurrent connections from clients. To achieve this it starts (“forks”) a new process for each connection. From that point on, the client and the new server process communicate without intervention by the original postgres process. Thus, the supervisor server process is always running, waiting for client connections, whereas client and associated server processes come and go. (All of this is of course invisible to the user. We only mention it here for completeness.)