Python and Advanced PostgreSQL with psycopg2 - Stored procedures in PostgreSQL