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

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 (view raw or flat)
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

pgsql-general by date

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

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