select statement in postgresql stored procedure