Also, the tester script will dump the WKB loaded table and compare the resulting
shapefile with the original one (only .shp, .dbf is not compared as field sizes are not
retained, we might use a dbf viewer for that, but that's not currently implemented)
+
+Optional:
+ You may provide a <name>.opts file to set custom command line options for shp2pgsql.
+ The first line that does not begin with a # is used.
+
+ Also see ../README for a description of optional setup/teardown script files.
--- /dev/null
+MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(5 5,8 5,8 8,5 8,5 5)),((-1 -1,-1 -10,-10 -10,-10 -1,-1 -1),(-5 -5,-8 -5,-8 -8,-5 -8,-5 -5)))
--- /dev/null
+select ST_Asewkt(the_geom) from loadedshp;
+
--- /dev/null
+MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(5 5,8 5,8 8,5 8,5 5)),((-1 -1,-1 -10,-10 -10,-10 -1,-1 -1),(-5 -5,-8 -5,-8 -8,-5 -8,-5 -5)))
--- /dev/null
+select ST_Asewkt(the_geom) from loadedshp;
+
--- /dev/null
+# You cannot create a test tablespace because tablespaces need to be directories that
+# are owned by the postgres user, which is rarely the same as the user running the test,
+# and you can't chown without sudo, so we gave up on trying to have a test that proves
+# the -T and -X parameters work. However we can at least test that they don't cause
+# any problems, which is what this test is for.
+-X pg_default
--- /dev/null
+MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(5 5,8 5,8 8,5 8,5 5)),((-1 -1,-1 -10,-10 -10,-10 -1,-1 -1),(-5 -5,-8 -5,-8 -8,-5 -8,-5 -5)))
--- /dev/null
+select ST_Asewkt(the_geom) from loadedshp;
+
--- /dev/null
+MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(5 5,8 5,8 8,5 8,5 5)),((-1 -1,-1 -10,-10 -10,-10 -1,-1 -1),(-5 -5,-8 -5,-8 -8,-5 -8,-5 -5)))
--- /dev/null
+select ST_Asewkt(the_geom) from loadedshp;
+
--- /dev/null
+# You cannot create a test tablespace because tablespaces need to be directories that
+# are owned by the postgres user, which is rarely the same as the user running the test,
+# and you can't chown without sudo, so we gave up on trying to have a test that proves
+# the -T and -X parameters work. However we can at least test that they don't cause
+# any problems, which is what this test is for.
+-T pg_default -X pg_default
--- /dev/null
+MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(5 5,8 5,8 8,5 8,5 5)),((-1 -1,-1 -10,-10 -10,-10 -1,-1 -1),(-5 -5,-8 -5,-8 -8,-5 -8,-5 -5)))
--- /dev/null
+select ST_Asewkt(the_geom) from loadedshp;
+
--- /dev/null
+MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(5 5,8 5,8 8,5 8,5 5)),((-1 -1,-1 -10,-10 -10,-10 -1,-1 -1),(-5 -5,-8 -5,-8 -8,-5 -8,-5 -5)))
--- /dev/null
+select ST_Asewkt(the_geom) from loadedshp;
+
--- /dev/null
+# You cannot create a test tablespace because tablespaces need to be directories that
+# are owned by the postgres user, which is rarely the same as the user running the test,
+# and you can't chown without sudo, so we gave up on trying to have a test that proves
+# the -T and -X parameters work. However we can at least test that they don't cause
+# any problems, which is what this test is for.
+-T pg_default
#echo "SELECT * from ${_tblname}" > ${TEST}.sql
+ # See if there is a custom command-line options file
+ if [ -r ${TEST}.opts ]; then
+ _custom_opts=`grep -v -m1 ^\s*# ${TEST}.opts`
+ fi
+
#
# Run in HEXWKB insert mode
show_progress
- ${SHP2PGSQL} -g the_geom ${TEST}.shp $_tblname \
+ ${SHP2PGSQL} $_custom_opts -g the_geom ${TEST}.shp $_tblname \
> ${TMPDIR}/loader \
2> ${TMPDIR}/loader.err