Using ogr_fdw_info on a CSV file gives all the fields as varchar:
CREATE SERVER myserver
FOREIGN DATA WRAPPER ogr_fdw
OPTIONS (
datasource 'alert5min.csv',
format 'CSV');
CREATE FOREIGN TABLE alert5min(
fid bigint,
pstation_shefid varchar,
precip_5m varchar,
precip_10m varchar,
precip_15m varchar,
precip_20m varchar,
.
.
which works fine
However the fields precip_5m, etc. are real. If I change the first one to:
precip_5m real,
I get the error message:
ERROR: column "precip_5m" of foreign table "alert5min" converts OGR "String" to "real"
SQL state: HV004
Using ogr_fdw_info on a CSV file gives all the fields as varchar: CREATE SERVER myserver FOREIGN DATA WRAPPER ogr_fdw OPTIONS ( datasource 'alert5min.csv', format 'CSV');
CREATE FOREIGN TABLE alert5min( fid bigint, pstation_shefid varchar, precip_5m varchar, precip_10m varchar, precip_15m varchar, precip_20m varchar, . . which works fine
However the fields precip_5m, etc. are real. If I change the first one to: precip_5m real,
I get the error message: ERROR: column "precip_5m" of foreign table "alert5min" converts OGR "String" to "real" SQL state: HV004
How can I specify the field type? THX