updated procs to basic pg syntax