Django 1.9.5支持PostgreSQL 11吗?

发布于 2025-02-06 19:26:38 字数 81 浏览 3 评论 0原文

Heroku上Postgres 10的寿命越来越近,但是我仍然使用它在Django 1.9上使用它。是否可以毫无麻烦地迁移到Postgres 11?

The end-of-life for Postgres 10 on Heroku is closer and closer, but I still have a legacy project on Django 1.9 using it there. Is it possible to migrate to Postgres 11 without troubles?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小镇女孩 2025-02-13 19:26:38

通过文档进行:

django支持PostgreSQL 9.0及更高版本。它需要使用psycopg2 2.4.5或更高(如果要使用django.contrib.postgres)。

)。

https:// https://djangoproject.com/en/ 1.8/ref/database/#PostgreSql-Notes

当前的psycopg2实现支持:

  • Python版本从3.6到3.10
  • PostgreSQL Server版本从7.4到14
  • PostgreSQL客户库库版本来自9.1

https://www.psycopg.org.org.org/docs/docs/install.html.html.html.html#prerequites

pssycopg2中的Postgres 11的最早提及在2.7.x左右出现,有2.8次明确提及:

  • 放弃了对Python 2.6、3.2、3.3的支持。

  • 针对OpenSSL 1.0.2r和Postgresql编译的轮套11.2 libpq。

https:https:// wwwwww .psycopg.org/docs/news.html#what-s-new-in-psycopg-2-8

因此,问题将在psycopg附近(如果有的话)。如果您可以在Python 3.4+上使用Psycopg 2.8+运行您的Django项目,则应该没有理由为什么它不起作用。 Psycopg2的较旧版本也可以很好地与Postgres 11+一起使用。您应该简单地在本地环境(例如Docker)上进行测试。

Going by the documentation:

Django supports PostgreSQL 9.0 and higher. It requires the use of psycopg2 2.4.5 or higher (or 2.5+ if you want to use django.contrib.postgres).

https://docs.djangoproject.com/en/1.8/ref/databases/#postgresql-notes

The current psycopg2 implementation supports:

  • Python versions from 3.6 to 3.10
  • PostgreSQL server versions from 7.4 to 14
  • PostgreSQL client library version from 9.1

https://www.psycopg.org/docs/install.html#prerequisites

The earliest mentions of Postgres 11 in psycopg2 appear around 2.7.x, with 2.8 explicitly mentioning:

  • Dropped support for Python 2.6, 3.2, 3.3.

  • Wheel package compiled against OpenSSL 1.0.2r and PostgreSQL 11.2 libpq.

https://www.psycopg.org/docs/news.html#what-s-new-in-psycopg-2-8

So, the problem will be somewhere around psycopg, if anything. If you can run your Django project on Python 3.4+ with psycopg 2.8+, there should be no reason why it doesn't work. Older versions of psycopg2 may well work with Postgres 11+ just fine as well. You should simply test that on a local environment (e.g. Docker).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文