Skip site navigation (1) Skip section navigation (2)

BUG #3762: Inherited serials change on dump/restore

From: "Cstdenis" <cstdenis(at)ctgameinfo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3762: Inherited serials change on dump/restore
Date: 2007-11-20 07:57:27
Message-ID: 200711200757.lAK7vR5I007241@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      3762
Logged by:          Cstdenis
Email address:      cstdenis(at)ctgameinfo(dot)com
PostgreSQL version: 8.2.5/8.3beta2
Operating system:   FreeBSD 6.1
Description:        Inherited serials change on dump/restore
Details: 

Setup
------
Source: Server 8.2.3. Client 8.3beta2.
Dest: Server 8.2.3. Client 8.2.3.

Description
------------
When I do a dump and restore of my database my serials change. 

In the original version, the table looks like this (dump from pgAdmin III)
and references the sequence picture_comments_comment_id_seq

CREATE TABLE picture_comments
(
-- Inherited:   comment_id serial NOT NULL,
-- Inherited:   user_id integer NOT NULL,
<snip some unrelated columns for brevity>
-- Inherited:   id_tree ltree NOT NULL DEFAULT ''::ltree,
  CONSTRAINT picture_comments_pkey PRIMARY KEY (comment_id)
) INHERITS (base_comments) 
WITHOUT OIDS;

when I restore the dump I get this which now references the base table's
serial base_comments_comment_id_seq

CREATE TABLE picture_comments
(
-- Inherited:   comment_id integer NOT NULL DEFAULT
nextval('base_comments_comment_id_seq'::regclass),
-- Inherited:   user_id integer NOT NULL,
<snip>
-- Inherited:   id_tree ltree NOT NULL DEFAULT ''::ltree,
  pid integer NOT NULL,
  CONSTRAINT picture_comments_pkey PRIMARY KEY (comment_id)
) INHERITS (base_comments) 
WITHOUT OIDS;

When I do the dump with the 8.2 client libraries it seems to work fine so
this seems to be a bug in 8.3.

Responses

pgsql-bugs by date

Next:From: Simon RiggsDate: 2007-11-20 08:24:50
Subject: Re: BUG #3760: Comment on restore database
Previous:From: Bruce MomjianDate: 2007-11-20 00:18:54
Subject: Re: BUG #3760: Comment on restore database

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group