PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ validate_shape_column_against_pg_column()

static int validate_shape_column_against_pg_column ( int  dbf_fieldtype,
char *  pg_fieldtype 
)
static

Definition at line 1109 of file shp2pgsql-gui.c.

Referenced by validate_remote_loader_columns().

1110 {
1111  switch (dbf_fieldtype)
1112  {
1113  case FTString:
1114  /* Only varchar */
1115  if (!strcmp(pg_fieldtype, "varchar"))
1116  return -1;
1117  break;
1118 
1119  case FTDate:
1120  /* Only date */
1121  if (!strcmp(pg_fieldtype, "date"))
1122  return -1;
1123  break;
1124 
1125  case FTInteger:
1126  /* Tentatively allow int2, int4 and numeric */
1127  if (!strcmp(pg_fieldtype, "int2") || !strcmp(pg_fieldtype, "int4") || !strcmp(pg_fieldtype, "numeric"))
1128  return -1;
1129  break;
1130 
1131  case FTDouble:
1132  /* Only float8/numeric */
1133  if (!strcmp(pg_fieldtype, "float8") || !strcmp(pg_fieldtype, "numeric"))
1134  return -1;
1135  break;
1136 
1137  case FTLogical:
1138  /* Only boolean */
1139  if (!strcmp(pg_fieldtype, "boolean"))
1140  return -1;
1141  break;
1142  }
1143 
1144  /* Otherwise we can't guarantee this (but this is just a warning anyway) */
1145  return 0;
1146 }
Here is the caller graph for this function: