Opened 15 years ago

Last modified 7 years ago

#123 closed task

SQLite output format support for shp2pgsql — at Version 3

Reported by: schuyler.erle Owned by:
Priority: medium Milestone: PostGIS Fund Me
Component: postgis Version:
Keywords: Cc:

Description (last modified by pramsey)

Please find attached a patch that adds a -L option to shp2pgsql provide special-case data typing and string formatting for SQLite-compatible output.

I have tested the output with SQLite 3.5.2 and it correctly creates and populates a table. The geometries are correctly stored as WKB in an SQLite BLOB column.

Granted there are other ways to import spatial data into an SQLite table, but shp2pgsql is the fastest way that I've found to convert both Shapefiles *and* DBF files into SQL suitable for quick import into a database, which is very handy for piping to SQLite's in-memory databases.

Change History (4)

comment:1 by schuyler.erle, 15 years ago

Please note that the patch was generated against the SVN trunk revision 3813.

comment:2 by mcayland, 15 years ago

Hi Schuyler,

I'm not sure about the SQLite changes, however it shows the valid point that we shouldn't be using E'….' escaping in shp2pgsql. We should change shp2pgsql so that it uses proper SQL escaping (we'd lose pre-8.1 compatibility in the process, but that is no longer an issue in trunk) which should help a little.

I'll go ahead and make the changes in trunk.

ATB,

Mark.

comment:3 by pramsey, 15 years ago

Description: modified (diff)
Milestone: PostGIS Future
Note: See TracTickets for help on using tickets.