Definition at line 1168 of file shp2pgsql-gui.c.
1169{
1170 ExecStatusType status;
1172 int ntuples;
1173 char *pg_fieldname, *pg_fieldtype;
1175
1176
1177 status = PQresultStatus(
result);
1178 if (status == PGRES_TUPLES_OK)
1179 {
1180 ntuples = PQntuples(
result);
1181
1182 switch (config->
opt)
1183 {
1184 case 'c':
1185
1186 if (ntuples > 0)
1187 {
1190 }
1191 break;
1192
1193 case 'p':
1194
1195 if (ntuples > 0)
1196 {
1199 }
1200 break;
1201
1202 case 'a':
1203
1204 if (ntuples == 0)
1205 {
1206 pgui_seterr(
_(
"ERROR: Destination table %s.%s could not be found for appending"), config->
schema, config->
table);
1208 }
1209 else
1210 {
1211
1215 {
1218 }
1219
1220
1222 {
1223
1224 found = 0;
1225 for (j = 0; j < ntuples; j++)
1226 {
1227 pg_fieldname = PQgetvalue(
result, j, PQfnumber(
result,
"field"));
1228 pg_fieldtype = PQgetvalue(
result, j, PQfnumber(
result,
"type"));
1229
1231 {
1232 found = -1;
1233
1235 if (!ret)
1236 {
1237 pgui_logf(
_(
"Warning: DBF Field '%s' is not compatible with PostgreSQL column '%s' in %s.%s"), state->
field_names[i], pg_fieldname, config->
schema, config->
table);
1239 }
1240 }
1241 }
1242
1243
1244 if (!found)
1245 {
1246 pgui_logf(
_(
"Warning: DBF Field '%s' within file %s could not be matched to a column within table %s.%s"),
1249 }
1250 }
1251
1253 }
1254
1255 break;
1256 }
1257 }
1258 else
1259 {
1260 pgui_seterr(
_(
"ERROR: unable to process validation response from remote server"));
1262 }
1263
1264 return response;
1265}
char result[OUT_DOUBLE_BUFFER_SIZE]
void ShpLoaderDestroy(SHPLOADERSTATE *state)
SHPLOADERSTATE * ShpLoaderCreate(SHPLOADERCONFIG *config)
int ShpLoaderOpenShape(SHPLOADERSTATE *state)
static void static void static void static void pgui_seterr(const char *fmt,...) __attribute__((format(printf
static int validate_shape_column_against_pg_column(int dbf_fieldtype, char *pg_fieldtype)
static void static void static void pgui_logf(const char *fmt,...) __attribute__((format(printf
References _, shp_loader_state::field_names, shp_loader_state::num_fields, shp_loader_config::opt, pgui_logf(), pgui_seterr(), result, shp_loader_config::schema, shp_loader_config::shp_file, ShpLoaderCreate(), ShpLoaderDestroy(), SHPLOADERERR, SHPLOADEROK, ShpLoaderOpenShape(), SHPLOADERWARN, shp_loader_config::table, shp_loader_state::types, and validate_shape_column_against_pg_column().
Referenced by pgui_action_import().