PostgreSQL 与 MySQL 有何不同?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/724867/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 13:03:27  来源:igfitidea点击:

How different is PostgreSQL to MySQL?

sqlmysqlpostgresql

提问by

I've been asked to support and take on a PostgreSQL app, but am a MySQL guy - is this a realistic task?

我被要求支持和使用 PostgreSQL 应用程序,但我是一个 MySQL 人 - 这是一项现实的任务吗?

回答by Quassnoi

PostgreSQLhas some nice features like generate_series, custom aggregate functions, arrays etc, which can ease your life greatly if you take some time to learn them.

PostgreSQL有一些不错的功能,例如generate_series自定义聚合函数、数组等,如果您花一些时间来学习它们,可以极大地减轻您的生活。

On the other hand it lacks some features of MySQLlike using and assigning session variables in queries, FORCE INDEX, etc., which is quite annoying if you are used to these features.

另一方面,它缺少一些功能,MySQL例如在查询中使用和分配会话变量FORCE INDEX等,如果您习惯了这些功能,这会很烦人。

If you just use basic SQL, then you will hardly notice any difference.

如果您只使用 basic SQL,那么您几乎不会注意到任何区别。

回答by vartec

How different is PostgreSQL to MySQL?

PostgreSQL 与 MySQL 有何不同?

That depends if you're talking about SQL only (which is mostly the same) or the stored procedures (which are quite different).

这取决于您是只讨论 SQL(大部分相同)还是存储过程(完全不同)。

is this a realistic task?

这是一项现实的任务吗?

Absolutely. PostgreSQL has very good documentation and community. There are also lot of ppl, who have experience with MySQL and PostgreSQL.

绝对地。PostgreSQL 有很好的文档和社区。也有很多人,他们有 MySQL 和 PostgreSQL 的经验。

"MySQL vs PostgreSQL wiki"— centers on "which is better", but gives you some idea of differences.

“MySQL 与 PostgreSQL wiki”——以“哪个更好”为中心,但让您了解一些差异。

回答by Edmund

PostgreSQL compared to MySQL is as any other pair of DBMSs compared. What they have in common is non-functional, specifically the consequences of each being open source. In terms of features, use, and strengths they are no closer to each other than PostgreSQL is to Oracle or DB2 is to Sybase.

PostgreSQL 与 MySQL 的比较就像任何其他 DBMS 的比较。它们的共同点是非功能性的,特别是每个开源的后果。在特性、用途和优势方面,它们之间的距离并不比 PostgreSQL 与 Oracle 或 DB2 与 Sybase 更接近。

Now on to your real question: you are a SQL guy, albeit one who has not yet had experience with PostgreSQL. This is a completely realistic task for you, and a good one since you'll expand your understanding of the varieties of DBMSs and gain a perspective on MySQL that you can't get from working solely within its sphere.

现在回到你真正的问题:你是一个SQL 人,尽管你还没有使用 PostgreSQL 的经验。这对您来说是一项完全现实的任务,而且是一项很好的任务,因为您将扩展对各种 DBMS 的理解并获得对 MySQL 的看法,而这是仅在其领域内工作无法获得的。

As someone who was once in exactly the same position, my guess is that you'll quickly pick up PostgreSQL and might even hesitate to return to MySQL ;-).

作为曾经处于完全相同位置的人,我的猜测是您会很快拿起 PostgreSQL,甚至可能会犹豫是否要返回 MySQL ;-)。

回答by VirtuosiMedia

If you're interested in the different flavors of SQL, here are a few resources (though some may be outdated):

如果您对 SQL 的不同风格感兴趣,这里有一些资源(尽管有些可能已经过时):

回答by JeeBee

I didn't take very long to switch from MySQL to PostgreSQL back when I first started using PostgreSQL in anger at a previous company. I found it very nice and very refreshing (not that MySQL was bad) compared to MySQL which I had used previously. PostgreSQL was also a good stepping stone to Oracle which I use at my current company. I liked that it had a proper command line application like MySQL, but the configuration options are harder - but if you're not setting it up then there is no problem.

当我第一次开始使用 PostgreSQL 时,我对以前的公司感到愤怒,并没有花很长时间就从 MySQL 切换到 PostgreSQL。与我之前使用的 MySQL 相比,我发现它非常好,非常令人耳目一新(不是说 MySQL 不好)。PostgreSQL 也是我在目前公司使用的 Oracle 的一个很好的垫脚石。我喜欢它有一个像 MySQL 这样合适的命令行应用程序,但配置选项更难 - 但如果你没有设置它,那就没有问题。

回答by Rick J

I faced the same situation about a month ago.... I have been doing fine with postgres. There is a strong online community for postgres and you should be able to find help if you run into any trouble and learn stuff easily :)

大约一个月前我遇到了同样的情况......我在 postgres 上做得很好。postgres 有一个强大的在线社区,如果您遇到任何麻烦并轻松学习,您应该能够找到帮助:)