Select runs but insert failing in Greenplum database