Postgresql Declare Variable In Function In Python Practice