Postgres Function To Automatically Return