Postgresql Declare Variable In Function