This fix was already present at one point in cartodb/lib/sql
(where the code was copied from) but in a different branch than
the one the code was initially copied from.
The fix depends on plpython language which becomes a new dependency.
NOTE: also makes CDB_TableMetadata triggers still functional
when user quota and varnish invalidation functions are missing
from the database (currently installed by cartodb ruby)