How To Install python3-psycopg-pool on Debian 12

Learn how to install python3-psycopg-pool on Debian 12 with this tutorial. python3-psycopg-pool is PostgreSQL database adapter for Python 3

Introduction

In this tutorial we learn how to install python3-psycopg-pool on Debian 12.

What is python3-psycopg-pool

python3-psycopg-pool is:

Psycopg 3 is a newly designed PostgreSQL database adapter for the Python programming language.

Psycopg 3 is a complete rewrite of Psycopg 2, maintaining the same fundamental libpq wrapper architecture and DB-API interface design, but exposing new features to better work with the newer versions of Python and PostgreSQL.

On the Python side, Psycopg 3 allows the use of asyncio-based concurrency and static typing. Many improvement to the Python interface make the library much simpler and more idiomatic to use,

On the PostgreSQL side, Psycopg 3 makes use of server-side parameters, prepared statements, binary parameters, and great support for COPY operations.

Psycopg 3 presents a familiar interface for everyone who has used Psycopg 2 or any other DB-API 2.0 database adapter, but allows one to use more modern PostgreSQL and Python features, such as:

  • Strict Strong Typing
  • asynchronous support
  • server-side parameters binding
  • binary communication
  • a great integration of the COPY support
  • direct access to the libpq functionalities

This package contains two connection pool implementations

There are three methods to install python3-psycopg-pool on Debian 12. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python3-psycopg-pool Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python3-psycopg-pool using apt-get by running the following command:

sudo apt-get -y install python3-psycopg-pool

Install python3-psycopg-pool Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python3-psycopg-pool using apt by running the following command:

sudo apt -y install python3-psycopg-pool

Install python3-psycopg-pool Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python3-psycopg-pool using aptitude by running the following command:

sudo aptitude -y install python3-psycopg-pool

How To Uninstall python3-psycopg-pool on Debian 12

To uninstall only the python3-psycopg-pool package we can use the following command:

sudo apt-get remove python3-psycopg-pool

Uninstall python3-psycopg-pool And Its Dependencies

To uninstall python3-psycopg-pool and its dependencies that are no longer needed by Debian 12, we can use the command below:

sudo apt-get -y autoremove python3-psycopg-pool

Remove python3-psycopg-pool Configurations and Data

To remove python3-psycopg-pool configuration and data from Debian 12 we can use the following command:

sudo apt-get -y purge python3-psycopg-pool

Remove python3-psycopg-pool configuration, data, and all of its dependencies

We can use the following command to remove python3-psycopg-pool configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python3-psycopg-pool

Dependencies

python3-psycopg-pool have the following dependencies:

References

Summary

In this tutorial we learn how to install python3-psycopg-pool package on Debian 12 using different package management tools: apt, apt-get and aptitude.