Pies is a Python 2 and Python 3 compatibility layer with the philosophy that all code should be Python 3 code. Starting from this viewpoint means that when running on Python 3, Pies adds virtually no overhead. Instead of providing a bunch of custom methods (leading to Python code which looks out of place on any version), Pies aims to backport as many of the Python 3 API calls, imports, and objects to Python 2 as possible, relying on special syntax only when absolutely necessary.
pg-python provides access to Python from PostgreSQL. It contrasts with the built-in procedural language by interfacing with PostgreSQL types rather than converting them. This allows large instances of data types to be handled with greater efficiency while also allowing reasonable support for arbitrary data types without the need for a specialized implementation. Procedures are managed as entire modules so that initialization can be performed naturally by a stored procedure (each PostgreSQL function has a "main" entry point). Import statements may exist in a more natural position, and the "main" entry point may be decorated.