working postgres_macros