PostGIS 3.6.2dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ validate_shape_column_against_pg_column()

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

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

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