Re: pg_get_serial_sequence Strangeness/Unreliable? - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_get_serial_sequence Strangeness/Unreliable?
Date
Msg-id 24823.1227732804@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_get_serial_sequence Strangeness/Unreliable?  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: pg_get_serial_sequence Strangeness/Unreliable?
List pgsql-general
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Jeff MacDonald wrote:
>> Hi Tom, so far as I know the table "owns" the serial in so much as when i
>> do a \d of the table it says this

> He means ALTER SEQUENCE ... OWNED BY
> I don't know how you can ensure that it is, short of

Well, actually, I think the fact that pg_get_serial_sequence isn't
working is the most direct way of knowing that the ownership link
isn't there ;-).  You could grovel around in pg_depend manually but
I'm pretty sure of what the outcome will be.

I'd try doing an ALTER SEQUENCE OWNED BY and see if that changes the
results.  The worst that could happen is it takes ownership away from
whichever table actually created the sequence, if there was a different
one.

(My bet is that you got into this state as a result of using some weird
combination of pg_dump and server versions.)

            regards, tom lane

pgsql-general by date:

Previous
From: Karina Guardado
Date:
Subject: problems with special characters
Next
From: "Jaime Casanova"
Date:
Subject: Re: pg_get_serial_sequence Strangeness/Unreliable?