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

Re: [HACKERS] system catalog relation of a table and a serial sequence

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brent Verner <brent(at)rcfile(dot)org>
Cc: Rod Taylor <rbt(at)zort(dot)ca>, pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] system catalog relation of a table and a serial sequence
Date: 2001-12-16 04:17:54
Message-ID: 17614.1008476274@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
> | > You might further check that the
> | > apparent sequence name ends with _seq --- if not, it wasn't
> | > generated by SERIAL.
> | 
> | Wouldn't you want to include user sequences that are required for
> | using the table?  If someone has used their own sequence as the
> | default value for a column it would be nice to have it dumped as well.

> This is my thought as well.  Hopefully Tom will concur.

Well, that's why I said "might".  I'm not sure what the correct behavior
is here.  If we had an actual SERIAL datatype --- that is, we could
unambiguously tell that a given column was SERIAL --- then a case could
be made that "pg_dump -t table" should dump only those sequences
associated with table's SERIAL columns.

I think it'd be a bit surprising if "pg_dump -t table" would dump
sequences declared independently of the table.  An example where you'd
likely not be happy with that is if the same sequence is being used to
feed multiple tables.

I agree that dumping all such sequences will often be the desired
behavior, but that doesn't leave me convinced that it's the right
thing to do.

Any comments out there?

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2001-12-16 04:25:50
Subject: Re: system catalog relation of a table and a serial sequence
Previous:From: Brent VernerDate: 2001-12-16 04:03:32
Subject: Re: [HACKERS] system catalog relation of a table and a serial sequence

pgsql-patches by date

Next:From: Tom LaneDate: 2001-12-16 04:25:50
Subject: Re: system catalog relation of a table and a serial sequence
Previous:From: Brent VernerDate: 2001-12-16 04:03:32
Subject: Re: [HACKERS] system catalog relation of a table and a serial sequence

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