Re: pg_get_serial_sequence Strangeness/Unreliable?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Jeff MacDonald <oss(at)bignose(dot)ca>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_get_serial_sequence Strangeness/Unreliable?
Date: 2008-11-26 20:53:24
Message-ID: 24823.1227732804@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera <alvherre(at)commandprompt(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jaime Casanova 2008-11-26 21:16:25 Re: pg_get_serial_sequence Strangeness/Unreliable?
Previous Message Karina Guardado 2008-11-26 20:36:24 problems with special characters