Making serial survive pg_dump

From: "Rod Taylor" <rbt(at)zort(dot)ca>
To: "Hackers List" <pgsql-hackers(at)postgresql(dot)org>
Subject: Making serial survive pg_dump
Date: 2002-06-13 12:10:01
Message-ID: 062a01c212d3$3f21e2e0$fe01a8c0@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Currently serial is dumped as a sequence and appropriate default
statement.

With my upcoming dependency patch serials depend on the appropriate
column. Drop the column (or table) and the sequence goes with it.
The depencency information does not survive the pg_dump / restore
process however as it's recreated as the table and individual
sequence.

I see 2 options for carrying the information.

Store sequence information in the SERIAL creation statement:
CREATE TABLE tab (col1 SERIAL(<start num>, <sequence name>));

Or store the dependency information in the sequence:
CREATE SEQUENCE ... REQUIRES COLUMN <column>;

The former makes a lot more sense, and it's nice that the sequence
information is in one place.
--
Rod

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2002-06-13 12:15:05 Re: Integrating libpqxx
Previous Message Jeroen T. Vermeulen 2002-06-13 11:49:55 Re: Integrating libpqxx