【译】PostgreSQL

581 阅读3分钟

在写完《赞美Alpine Linux》之后,我决定继续写更多赞美好软件的文章。今天,我想告诉你一些关于PostgreSQL的情况。

许多人不了解Postgres真正的历史有多长:第一个版本1是在1996年7月。它使用了这个标志。

A “logo” which depicts the word “PostgreSQL” in a 3D chrome font bursting through a brick wall from space. No, seriously.

经过25年的坚持,以及一个更好的标志设计,Postgres今天已经成为自由软件中最重要的深刻成就的支柱之一,与Linux和Firefox等并列。PostgreSQL将一个复杂的问题_解决_到如此有效的程度,以至于它的所有竞争对手基本上都被淘汰了,也许只有SQLite是例外。

首先,Postgres是一个令人难以置信的强大、稳健和可靠的软件,提供了SQL的最佳实现。2它对自己的行为提供了大量的洞察力,并允许有经验的操作者对其进行微调以达到最佳性能。它支持广泛的SQL功能和数据类型,我一直都能用它来有效地存储和检索我的数据。SQL通常是网络应用中的第一大瓶颈,而Postgres在为你提供管理该瓶颈所需的工具方面做得很好。

这些工具的文档也非常好。PostgreSQL的文档是_非常_深入的。它使我们其他人感到羞愧,真的。他们不仅有全面的参考文档,详尽地描述了每一个功能,而且还有大量的散文,解释了Postgres的内部设计、架构和操作,以及详细的关于如何完成各种高级任务的纯英文解释,并提供了_理解_这些任务的必要背景。基本上没有理由去阅读关于如何使用Postgres的博文或Stack Overflow答案--官方文档非常深入地涵盖了系统的每一个方面。

该项目是由一个高度严谨的工程师团队维护的。我对他们处理性能、回归测试和安全问题的能力完全有信心。他们每周都会发布一丝不苟的详细开发更新,以及详尽的发布说明,使你有足够的知识自信地在你的部署上运行更新。他们的git纪律也是传奇性的--这是写作时的最新提交

postgres_fdw: Fix issues with generated columns in foreign tables.

postgres_fdw imported generated columns from the remote tables as plain
columns, and caused failures like "ERROR: cannot insert a non-DEFAULT
value into column "foo"" when inserting into the foreign tables, as it
tried to insert values into the generated columns.  To fix, we do the
following under the assumption that generated columns in a postgres_fdw
foreign table are defined so that they represent generated columns in
the underlying remote table:

* Send DEFAULT for the generated columns to the foreign server on insert
  or update, not generated column values computed on the local server.
* Add to postgresImportForeignSchema() an option "import_generated" to
  include column generated expressions in the definitions of foreign
  tables imported from a foreign server.  The option is true by default.

The assumption seems reasonable, because that would make a query of the
postgres_fdw foreign table return values for the generated columns that
are consistent with the generated expression.

While here, fix another issue in postgresImportForeignSchema(): it tried
to include column generated expressions as column default expressions in
the foreign table definitions when the import_default option was enabled.

Per bug #16631 from Daniel Cherniy.  Back-patch to v12 where generated
columns were added.

Discussion: https://postgr.es/m/16631-e929fe9db0ffc7cf%40postgresql.org

他们都是这样的

归根结底,PostgreSQL是一个技术复杂的程序,需要一个有经验和熟练的操作者才能有效。学习使用它是一项昂贵的投资,即使它的回报很丰厚。尽管Postgres偶尔会让我感到沮丧或困惑,但总的来说,我对它的感觉是压倒性的积极。它是一个制作精良的产品,它的巨大和仍在增长的成功是非常值得的。当我想到那些对自由软件生态系统和整个世界产生了最重大影响的项目时,PostgreSQL在这个名单上占有一席之地。


  1. PostgreSQL的第一个版本。它的血统可以追溯到更远的地方。

  2. 没有限定词。它是SQL的最佳实现。