I'm having some problems with pg_dump and the -t switch. I can't get it
to work using wildcards nor with multiple -t switches. I'm using
PostgreSQL 8.1.5 and trying to dump just a table and its associated
sequence.
As shown below, the table il_sections and the sequence
il_sections_gid_seq both exist in the database spatial1. But neither
pg_dump -Fc -t 'il_sections*' spatial1 > il_plss.dump
nor
pg_dump -Fc -t il_sections -t il_sections_gid_seq spatial1 > il_plss.dump
will work. The former generates the error listed below while the latter
just creates a tiny file with nothing but a couple of comments in it.
Anyone know what's wrong?
- Bill Thoen
Here's what I get:
$ psql -dspatial1
Welcome to psql 8.1.5, the PostgreSQL interactive terminal.
...
spatial1=# \d
List of relations
Schema | Name | Type | Owner
--------+-----------------------+----------+----------
public | US_States_ogc_fid_seq | sequence | bthoen
public | counties | table | bthoen
public | counties_gid_seq | sequence | bthoen
public | geometry_columns | table | postgres
public | il_sections | table | bthoen
public | il_sections_gid_seq | sequence | bthoen
public | spatial_ref_sys | table | postgres
public | states | table | bthoen
(8 rows)
spatial1=# \q
$ pg_dump -Fc -t 'il_section*' spatial1 > il_plss.dump
pg_dump: specified table "il_section*" does not exist