pg cursor for gid