41.1. Python 2 vs. Python 3

PL/Python supports both the Python 2 and Python 3 language variants. (The PostgreSQL installation instructions might contain more precise information about the exact supported minor versions of Python.) Because the Python 2 and Python 3 language variants are incompatible in some important aspects, the following naming and transitioning scheme is used by PL/Python to avoid mixing them:

It depends on the build configuration or the installed packages whether PL/Python for Python 2 or Python 3 or both are available.

This results in the following usage and migration strategy:

See also the document What's New In Python 3.0 for more information about porting to Python 3.