Re: pg_dump error - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_dump error
Date
Msg-id 23956.987523065@sss.pgh.pa.us
Whole thread Raw
In response to pg_dump error  ("mike" <matrix@quadrent.net>)
List pgsql-general
"mike" <matrix@quadrent.net> writes:
> dumpSequence(pilgram_en_id_seq): different sequence name returned by SELECT=
> : pilgram_cross_id_seq

> I'm not sure what this means, and I have no idea how to corect it.

Looking at the source code, it would seem that pg_dump is unhappy
because "SELECT sequence_name FROM pilgram_en_id_seq" returned
"pilgram_cross_id_seq" instead of the expected "pilgram_en_id_seq".

I'm not sure why exactly pg_dump is bothering to make such a
cross-check, but probably the more interesting question is how the
sequence got that way.  Did you rename it at some point?

I find that "ALTER TABLE RENAME" will work without complaint on a
sequence.  Seems we should either
  (a) prohibit renaming a sequence;
  (b) improve ALTER TABLE RENAME to know about changing the
      sequence_name field as well;
  (c) remove this cross-check from pg_dump; and/or
  (d) remove the sequence_name field from sequences entirely.

(c) looks like the path of least resistance.  I don't like (d) because
of the risk of breaking existing application code that might look at
the contents of sequences.  Comments?

            regards, tom lane

pgsql-general by date:

Previous
From: "Thomas F. O'Connell"
Date:
Subject: Re: View and function
Next
From: will trillich
Date:
Subject: Re: insert-select once more