postgresql function select into variable