Re: Backup and restore sequences - Mailing list pgsql-general

From Alan Hodgson
Subject Re: Backup and restore sequences
Date
Msg-id 201101070811.03400@hal.medialogik.com
Whole thread Raw
In response to Backup and restore sequences  (gvim <gvimrc@gmail.com>)
List pgsql-general

On January 7, 2011, gvim <gvimrc@gmail.com> wrote:

> PostgreSQL 9.0.1/pgAdminIII 1.12.1

>

> I want to copy selected tables from one database to another and maintain

> the sequences which I originally setup with:

>

> CREATE SEQUENCE venues_id_seq START WITH 1122;

> ALTER TABLE venues ALTER COLUMN id SET DEFAULT nextval('venues_id_seq');

>

> ... along with their current values, which have been augmented since the

> database was setup. When I backup via pgAdminIII the sequences are not

> even included. I also can't find anything in:

>

> man pg_dump

>

> ... which specifies sequences.

>

> gvim

--table=table

Dump only tables (or views or sequences) matching table. Multiple tables can be selected

by writing multiple -t switches. Also, the table parameter is interpreted as a pattern

according to the same rules used by psql’s \d commands (see Patterns [psql(1)]), so multi-

ple tables can also be selected by writing wildcard characters in the pattern. When using

wildcards, be careful to quote the pattern if needed to prevent the shell from expanding

the wildcards.

--

A hybrid Escalade is missing the point much in the same way that having a diet soda with your extra large pepperoni pizza is missing the point.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Backup and restore sequences
Next
From: Bernhard Rohrer
Date:
Subject: OOO and postgres