Postgresql Python Create Dictionary