PostgreSQL数据库在线
我正在Python开发一个CRUD,这对于一个项目很有用。但是,我想将我当前在PostgreSQL创建的数据库连接到一种在线服务器或在线DB,因此,如果信息丢失,则不必进行重复备份,而是要有所有信息在线或使我的计算机用作服务器。我该怎么做?
I am developing a CRUD in Python, which will be useful for a project. However, I want to connect the database that I currently have created in PostgreSQL to a kind of online server or online DB, so that in case there is loss of information, it is not necessary to make a recurring backup, but to have all information online or make my computer work as a server. How can I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,首先您需要通过 pip install psycopg2 或使用 pip3 使用 pip 安装 psycopg2,然后您需要尝试以下示例。
Okay, first you'll want to the install psycopg2 with pip by doing, pip install psycopg2 or use pip3 then you'll want to try an example such as.
您可能想尝试 psycopg2 库。 Psycopg 是 Python 编程语言的 PostgreSQL 适配器。它实现了 PEP 249 并进行了许多扩展。
这是一个链接: https://pynative.com/python-postgresql-tutorial/
You might want to try the psycopg2 library. Psycopg is a PostgreSQL adapter for the Python programming language. It implements PEP 249 with many extensions.
Here is a link: https://pynative.com/python-postgresql-tutorial/