django - 为什么 Django 更喜欢 Postgresql?

标签 django database postgresql

<分区>

我在这里阅读了它的官方文档:

https://docs.djangoproject.com/en/1.8/topics/migrations/

PostgreSQL

PostgreSQL is the most capable of all the databases here in terms of schema support; the only caveat is that adding columns with default values will cause a full rewrite of the table, for a time proportional to its size.

For this reason, it’s recommended you always create new columns with null=True, as this way they will be added immediately.

但是并没有解释什么是“schema support”。为什么 Postgresql 在 Django 上比其他(MySQL 等)更强大?

最佳答案

此引用来自迁移文档。它指的是 PostgreSQL 是 Django 中唯一支持事务性 DDL 的数据库后端。也就是说,Postgres 可以回滚 CREATE TABLEALTER TABLE 语句,而 MySQL、Oracle 和 SQLite 不能。

关于django - 为什么 Django 更喜欢 Postgresql?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32821716/

相关文章:

python - 如何使用 PyTest 正确测试 Django API ListView?

python - View 未返回 HttpResponse 对象

mysql - 在mysql中按问题分组

postgresql - 如何关闭旧 Cloud Run 修订版的 SQL 连接?

python - Django 表单继承不起作用 __init__

html - # 跨两个同级页面的链接不会滚动到右侧

python - 改组 SQLAlchemy 结果?

mysql - SQL:创建一个新表,告诉用户每个员工的经理

sql - 如何查询构建的字符串选择

ruby-on-rails - Rails 4 搜索绑定(bind)变量数量错误的单独关键字(1 对 2)