pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-sql@postgresql.org
Subject: pg_dump and sequences
Date: Tue, 23 Jul 2002 11:27:32 +0300 (EEST)
Message-ID: <Pine.LNX.4.44.0207231105320.21717-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <8c3bbeba.0207220811.9df2617@posting.google.com>

Hi, i am using postgreSQL 7.2.1 on a redhat 7.2 (kernel 
2.4.9-31,glibc-2.2.4-24).

It seems that pg_dump -t "tablename" dumps correctly the sequence of a 
table's column,when the column is named after "id".

For example,

dynacom=# CREATE TABLE foo2 (fid serial NOT NULL UNIQUE PRIMARY KEY,id 
serial);

[postgres@pc216 ~]% pg_dump -t foo2 > foo2DUMP.sql 

[postgres@pc216 ~]% cat foo2DUMP.sql
--
-- Selected TOC Entries:
--
\connect - postgres
 
--
-- TOC Entry ID 2 (OID 2009757)
--
-- Name: foo2_id_seq Type: SEQUENCE Owner: postgres
--
 
CREATE SEQUENCE "foo2_id_seq" start 1 increment 1 maxvalue 
9223372036854775807 minvalue 1 cache 1;
 
--
-- TOC Entry ID 4 (OID 2009759)
--
-- Name: foo2 Type: TABLE Owner: postgres
--
 
CREATE TABLE "foo2" (
        "fid" integer DEFAULT nextval('"foo2_fid_seq"'::text) NOT NULL,
        "id" integer DEFAULT nextval('"foo2_id_seq"'::text) NOT NULL,
        Constraint "foo2_pkey" Primary Key ("fid")
);
 
--
-- Data for TOC Entry ID 6 (OID 2009759)
--
-- Name: foo2 Type: TABLE DATA Owner: postgres
--
 
 
COPY "foo2" FROM stdin;
\.
--
-- TOC Entry ID 5 (OID 2009762)
--
-- Name: "foo2_id_key" Type: INDEX Owner: postgres
--
 
CREATE UNIQUE INDEX foo2_id_key ON foo2 USING btree (id);
 
--
-- TOC Entry ID 3 (OID 2009757)
--
-- Name: foo2_id_seq Type: SEQUENCE SET Owner: postgres
--
 
SELECT setval ('"foo2_id_seq"', 1, false);
-- 

Any ideas??

Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel:    +30-10-8981112
fax:    +30-10-8981877
email:  achill@matrix.gatewaynet.com
        mantzios@softlab.ece.ntua.gr




view thread (4+ messages)  latest in thread

Message-ID: <Pine.LNX.4.44.0207231105320.21717-100000@matrix.gatewaynet.com>
Permalink:  ../Pine.LNX.4.44.0207231105320.21717-100000@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.44.0207231105320.21717-100000@matrix.gatewaynet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: achill@matrix.gatewaynet.com
  Subject: Re: pg_dump and sequences
  In-Reply-To: <Pine.LNX.4.44.0207231105320.21717-100000@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox