Importing a CSV file into PostgreSQL

If you wish to import data from a CSV file into Data Share or any other PostgreSQL database this can be done using the Spatial Data Transformation Task.

If you CSV contains Easting & Northing attributes, and you wish to spatialise your data, then you may wish to read Spatialise a CSV file with Easting & Northing attributes for more information.

Task Name

Enter a name for the task.

Source Data

Select Comma-Delimited Text File as the Source Data.

If Comma-Delimited Text File does not exist in the list of "Source Data" types then you will need to edit the ConTypes.xml file, which you will find in the ...Astun\iShare\n.n\Studio\config folder. If you open ConTypes.xml with a text editor you will see options for DBConTypes (servers, such as PostgreSQL and Oracle) and FileConTypes (file formats such as shapefile or mapinfo tab).  Create a new FileConType entry after the last closing </FileConType> tag (but before the closing </ConnectionTypes> tag as follows:

FileConType entry
<FileConType>
	<Name>Comma-Delimited Text File</Name>
	<FormatName>CSV</FormatName>
	<Direction>Both</Direction>
	<FileFilter>Comma-Delimited Text files (*.csv)|*.csv</FileFilter>
</FileConType>

Filename

Enter the path to the .csv file that you wish to Import.

Output

Select the PostgreSQL database where you wish to store this data.

Table

Enter the table name where you wish to store the data in the database.