Postgresql Declare Variable In Function In Python