PostGIS  2.2.8dev-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 1108 of file shp2pgsql-gui.c.

Referenced by validate_remote_loader_columns().

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