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

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

Referenced by validate_remote_loader_columns().

Here is the caller graph for this function: