set of functions for usage from PostgreSQL stored procedures