Postgresql 简明教程
PostgreSQL - Overview
PostgreSQL 是一个功能强大的开源对象关系数据库系统。它拥有超过 15 年的积极开发阶段,并拥有经过验证的架构,使其享有很高的可靠性、数据完整性和正确性声誉。
PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development phase and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness.
本教程将帮助你快速上手 PostgreSQL,让你熟悉 PostgreSQL 编程。
This tutorial will give you a quick start with PostgreSQL and make you comfortable with PostgreSQL programming.
What is PostgreSQL?
PostgreSQL(发音为 post-gress-Q-L )是一个由全球志愿者团队开发的开源关系型数据库管理系统(DBMS)。PostgreSQL 不受任何公司或其他私有实体控制,并且源代码可以免费获取。
PostgreSQL (pronounced as post-gress-Q-L) is an open source relational database management system (DBMS) developed by a worldwide team of volunteers. PostgreSQL is not controlled by any corporation or other private entity and the source code is available free of charge.
A Brief History of PostgreSQL
PostgreSQL 最初称为 Postgres,由 UCB 一位名叫 Michael Stonebraker 的计算机科学教授创建。Stonebraker 在 1986 年启动 Postgres,作为其前身 Ingres 的后续项目(现由 Computer Associates 所有)。
PostgreSQL, originally called Postgres, was created at UCB by a computer science professor named Michael Stonebraker. Stonebraker started Postgres in 1986 as a follow-up project to its predecessor, Ingres, now owned by Computer Associates.
-
1977-1985 − A project called INGRES was developed. Proof-of-concept for relational databases Established the company Ingres in 1980 Bought by Computer Associates in 1994
-
1986-1994 − POSTGRES Development of the concepts in INGRES with a focus on object orientation and the query language - Quel The code base of INGRES was not used as a basis for POSTGRES Commercialized as Illustra (bought by Informix, bought by IBM)
-
1994-1995 − Postgres95 Support for SQL was added in 1994 Released as Postgres95 in 1995 Re-released as PostgreSQL 6.0 in 1996 Establishment of the PostgreSQL Global Development Team
Key Features of PostgreSQL
PostgreSQL 可以在所有主要操作系统上运行,包括 Linux、UNIX(AIX、BSD、HP-UX、SGI IRIX、Mac OS X、Solaris、Tru64)和 Windows。它支持文本、图像、声音和视频,并包括 C/C++、Java、Perl、Python、Ruby、Tcl 和开放式数据库连接 (ODBC) 的编程接口。
PostgreSQL runs on all major operating systems, including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. It supports text, images, sounds, and video, and includes programming interfaces for C / C++, Java, Perl, Python, Ruby, Tcl and Open Database Connectivity (ODBC).
PostgreSQL 支持 SQL 标准的大部分内容,并提供许多现代功能,包括以下功能:
PostgreSQL supports a large part of the SQL standard and offers many modern features including the following −
-
Complex SQL queries
-
SQL Sub-selects
-
Foreign keys
-
Trigger
-
Views
-
Transactions
-
Multiversion concurrency control (MVCC)
-
Streaming Replication (as of 9.0)
-
Hot Standby (as of 9.0)
您可以查看 PostgreSQL 的官方文档来理解上述功能。PostgreSQL 可以通过多种方式由用户扩展。例如,通过添加新的:
You can check official documentation of PostgreSQL to understand the above-mentioned features. PostgreSQL can be extended by the user in many ways. For example by adding new −
-
Data types
-
Functions
-
Operators
-
Aggregate functions
-
Index methods
Procedural Languages Support
PostgreSQL 支持四种标准过程语言,允许用户使用任何语言编写自己的代码,并且可以由 PostgreSQL 数据库服务器执行。这些过程语言是 - PL/pgSQL、PL/Tcl、PL/Perl 和 PL/Python。此外,还支持其他非标准过程语言,如 PL/PHP、PL/V8、PL/Ruby、PL/Java 等。
PostgreSQL supports four standard procedural languages, which allows the users to write their own code in any of the languages and it can be executed by PostgreSQL database server. These procedural languages are - PL/pgSQL, PL/Tcl, PL/Perl and PL/Python. Besides, other non-standard procedural languages like PL/PHP, PL/V8, PL/Ruby, PL/Java, etc., are also supported.