版本:
7.0.0
企业版
轻量版
Are you an LLM? You can read better optimized documentation at /zh/docs/7.0.0-lite/developer_guide/connecting_to_a_database_psycopg.md for this page in Markdown format
连接数据库
使用psycopg2.connect函数获得connection对象。
使用connection对象创建cursor对象。