開始使用 Psycopg 3¶
This section of the documentation will explain how to install Psycopg and how to perform normal activities such as querying the database or loading data using COPY.
重要
If you are familiar with psycopg2 please take a look at Differences from psycopg2 to see what is changed.
Contents:
- Installation
- Basic module usage
- 將參數傳遞給 SQL 查詢
- 模板字串查詢
- 適配基本的 Python 型別
- 適配其他 PostgreSQL 型別
- Transactions management
- 使用 COPY TO 與 COPY FROM
- Differences from
psycopg2- Which package to install?
- Server-side binding
- Extended query Protocol
- Multiple statements in the same query
- Multiple results returned from multiple statements
- Different cast rules
- You cannot use
IN %swith a tuple - You cannot use
IS %s - Cursors subclasses
- Different adaptation system
- Copy is no longer file-based
withconnectioncallproc()is goneclient_encodingis gone- Transaction characteristics attributes don't affect autocommit sessions
- No default infinity dates handling
- What's new in Psycopg 3