2017-03-03 43 views

回答

2

下面是一个比较MySQL的术语和PostgreSQL的表格。每行包含等效的术语。

+----------------------+-----------------------+ 
|  MySQL   |  PostgreSQL  | 
+----------------------+-----------------------+ 
| user     | login role (user)  | 
| table    | relation (or table) | 
| database    | schema    | 
| (N/A)    | database    | 
| instance    | cluster    | 
+----------------------+-----------------------+ 

在MySQL中,一台完整的绝对名称为database.table,而PostgreSQL的,全名是database.schema.table

*对于PostgreSQL中的角色,PostgreSQL用于区分用户和组,但在较新版本的PostgreSQL中只有一个概念:角色。看到这个问题:in PostgreSQL, what is the difference between user and role?

+0

MySQL数据库对应PostgreSQL模式。在MySQL中没有相当于PostgreSQL数据库。我会编辑答案。 –

+0

@LaurenzAlbe谢谢,这真的很有帮助,我只是自己启动PostgreSQL。对我而言,PostgreSQL中的“模式”看起来像是关系的命名空间,而数据库只是模式的命名空间。 PostgreSQL对于数据库的独特之处在于让你确信MySQL不具备相同的功能? PostgreSQL中的数据库和模式不仅仅是不同级别的命名空间吗? – Flimm

+0

@LaurenzAlbe我想在MySQL列中添加“数据库(或模式)”(而不是“数据库”)。 MySQL文档确实涉及到模式([示例](https://dev.mysql.com/doc/workbench/en/wb-default-schema.html)),而在MySQL中,数据库和模式基本上是相同的。 – Flimm

相关问题