Definition at line 1155 of file shp2pgsql-gui.c.
1156{
1157 ExecStatusType status;
1159 int ntuples;
1160 char *pg_fieldname, *pg_fieldtype;
1162
1163
1164 status = PQresultStatus(
result);
1165 if (status == PGRES_TUPLES_OK)
1166 {
1167 ntuples = PQntuples(
result);
1168
1169 switch (config->
opt)
1170 {
1171 case 'c':
1172
1173 if (ntuples > 0)
1174 {
1177 }
1178 break;
1179
1180 case 'p':
1181
1182 if (ntuples > 0)
1183 {
1186 }
1187 break;
1188
1189 case 'a':
1190
1191 if (ntuples == 0)
1192 {
1193 pgui_seterr(
_(
"ERROR: Destination table %s.%s could not be found for appending"), config->
schema, config->
table);
1195 }
1196 else
1197 {
1198
1202 {
1205 }
1206
1207
1209 {
1210
1211 found = 0;
1212 for (j = 0; j < ntuples; j++)
1213 {
1214 pg_fieldname = PQgetvalue(
result, j, PQfnumber(
result,
"field"));
1215 pg_fieldtype = PQgetvalue(
result, j, PQfnumber(
result,
"type"));
1216
1218 {
1219 found = -1;
1220
1222 if (!ret)
1223 {
1224 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);
1226 }
1227 }
1228 }
1229
1230
1231 if (!found)
1232 {
1233 pgui_logf(
_(
"Warning: DBF Field '%s' within file %s could not be matched to a column within table %s.%s"),
1236 }
1237 }
1238
1240 }
1241
1242 break;
1243 }
1244 }
1245 else
1246 {
1247 pgui_seterr(
_(
"ERROR: unable to process validation response from remote server"));
1249 }
1250
1251 return response;
1252}
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().