Problems with pg_dump and -t wildcards

From: Bill Thoen <bthoen(at)gisnet(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Problems with pg_dump and -t wildcards
Date: 2008-07-25 17:36:14
Message-ID: 488A0F0E.1000100@gisnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Bond-Caron 2008-07-25 17:41:50 Re: php + postgresql
Previous Message Sushma Sagaram 2008-07-25 17:20:01 Problem running script