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

From Alvaro Herrera
Subject Re: pg_get_serial_sequence Strangeness/Unreliable?
Date
Msg-id 20081126170418.GI4275@alvh.no-ip.org
Whole thread Raw
In response to Re: pg_get_serial_sequence Strangeness/Unreliable?  (Jeff MacDonald <oss@bignose.ca>)
Responses Re: pg_get_serial_sequence Strangeness/Unreliable?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: pg_get_serial_sequence Strangeness/Unreliable?  (Jeff MacDonald <oss@bignose.ca>)
List pgsql-general
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
>
> status_id     | integer               | not null default
> nextval('status_status_id_seq'::regclass)
>
> How else can I check?

He means ALTER SEQUENCE ... OWNED BY

I don't know how you can ensure that it is, short of

begin;
drop table status;
\d status_status_id_seq
-- verify that the sequence exists; if owned, it should have been dropped too
rollback;

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-general by date:

Previous
From: Jeff MacDonald
Date:
Subject: Re: pg_get_serial_sequence Strangeness/Unreliable?
Next
From: Vishal Arora
Date:
Subject: Re: [ADMIN] PgAgent Job Scehduler is NOT running