OS Manuals

/usr/local/bin/shp2pgsql

Geographic Information Systems Extensions to PostgreSQL

From postgis 3.5.0-r1 (os), captured 2026-11-05 by running shp2pgsql -help (exit 0). permalink

/usr/local/bin/shp2pgsql: illegal option -- h
RELEASE: 3.5.0 (d2c3ca4)
USAGE: shp2pgsql [<options>] <shapefile> [[<schema>.]<table>]
OPTIONS:
  -s [<from>:]<srid> Set the SRID field. Defaults to 0.
      Optionally reprojects from given SRID.
 (-d|a|c|p) These are mutually exclusive options:
     -d  Drops the table, then recreates it and populates
         it with current shape file data.
     -a  Appends shape file into current table, must be
         exactly the same table schema.
     -c  Creates a new table and populates it, this is the
         default if you do not specify any options.
     -p  Prepare mode, only creates the table.
  -g <geocolumn> Specify the name of the geometry/geography column
      (mostly useful in append mode).
  -D  Use postgresql dump format (defaults to SQL insert statements).
  -e  Execute each statement individually, do not use a transaction.
      Not compatible with -D.
  -G  Use geography type (requires lon/lat data or -s to reproject).
  -k  Keep postgresql identifiers case.
  -i  Use int4 type for all integer dbf fields.
  -I  Create a spatial index on the geocolumn.
  -m <filename>  Specify a file containing a set of mappings of (long) column
     names to 10 character DBF column names. The content of the file is one or
     more lines of two names separated by white space and no trailing or
     leading space. For example:
         COLUMNNAME DBFFIELD1
         AVERYLONGCOLUMNNAME DBFFIELD2
  -S  Generate simple geometries instead of MULTI geometries.
  -t <dimensionality> Force geometry to be one of '2D', '3DZ', '3DM', or '4D'
  -w  Output WKT instead of WKB.  Note that this can result in
      coordinate drift.
  -W <encoding> Specify the character encoding of Shape's
      attribute column. (default: "UTF-8")
  -N <policy> NULL geometries handling policy (insert*,skip,abort).
  -n  Only import DBF file.
  -T <tablespace> Specify the tablespace for the new table.
      Note that indexes will still use the default tablespace unless the
      -X flag is also used.
  -X <tablespace> Specify the tablespace for the table's indexes.
      This applies to the primary key, and the spatial index if
      the -I flag is used.
  -Z  Prevent tables from being analyzed.
  -?  Display this help screen.

  An argument of `--' disables further option processing.
  (useful for unusual file names starting with '-')
Options (16)
OptionDescriptionSource
-dDrops the table, then recreates it and populates it with current shape file data.help
-aAppends shape file into current table, must be exactly the same table schema.help
-cCreates a new table and populates it, this is the default if you do not specify any options.help
-pPrepare mode, only creates the table.help
-DUse postgresql dump format (defaults to SQL insert statements).help
-eExecute each statement individually, do not use a transaction.help
-GUse geography type (requires lon/lat data or -s to reproject).help
-kKeep postgresql identifiers case.help
-iUse int4 type for all integer dbf fields.help
-ICreate a spatial index on the geocolumn.help
-m filenameSpecify a file containing a set of mappings of (long) column names to 10 character DBF column names.help
-SGenerate simple geometries instead of MULTI geometries.help
-wOutput WKT instead of WKB.help
-nOnly import DBF file.help
-ZPrevent tables from being analyzed.help
-?Display this help screen.help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.