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

1127 {
1128  switch (dbf_fieldtype)
1129  {
1130  case FTString:
1131  /* Only varchar */
1132  if (!strcmp(pg_fieldtype, "varchar"))
1133  return -1;
1134  break;
1135 
1136  case FTDate:
1137  /* Only date */
1138  if (!strcmp(pg_fieldtype, "date"))
1139  return -1;
1140  break;
1141 
1142  case FTInteger:
1143  /* Tentatively allow int2, int4 and numeric */
1144  if (!strcmp(pg_fieldtype, "int2") || !strcmp(pg_fieldtype, "int4") || !strcmp(pg_fieldtype, "numeric"))
1145  return -1;
1146  break;
1147 
1148  case FTDouble:
1149  /* Only float8/numeric */
1150  if (!strcmp(pg_fieldtype, "float8") || !strcmp(pg_fieldtype, "numeric"))
1151  return -1;
1152  break;
1153 
1154  case FTLogical:
1155  /* Only boolean */
1156  if (!strcmp(pg_fieldtype, "boolean"))
1157  return -1;
1158  break;
1159  }
1160 
1161  /* Otherwise we can't guarantee this (but this is just a warning anyway) */
1162  return 0;
1163 }
@ FTDouble
Definition: shapefil.h:641
@ FTString
Definition: shapefil.h:639
@ FTLogical
Definition: shapefil.h:642
@ FTDate
Definition: shapefil.h:643
@ FTInteger
Definition: shapefil.h:640

References FTDate, FTDouble, FTInteger, FTLogical, and FTString.

Referenced by validate_remote_loader_columns().

Here is the caller graph for this function: