I'm having trouble when trying to upload a shape file in postgresql/PostGIS. There's a field with type "date", but actually there'r two elements with content : '20012060' and it returns ERROR when I start shp2pgsql. Is there any way to change all fields from dbf to character varying, using shp2pgsql or any other extension from PostGIS?
Is using ogr2ogr an option? If so you should be able to use
COLUMN_TYPES option, see the help section for PostgreSQL driver.
Example of importing shape to postgis with the integer field "id" imported as text
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=testdb password=somepassword" "/home/bera/GIS/data/test/polys.shp" -lco COLUMN_TYPES="id=text"
Data type of columns not specified seem to be set automatically, for example the "sometext" column.