Re: pg_get_serial_sequence Strangeness/Unreliable?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Jeff MacDonald <oss(at)bignose(dot)ca>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_get_serial_sequence Strangeness/Unreliable?
Date: 2008-11-26 17:04:18
Message-ID: 20081126170418.GI4275@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vishal Arora 2008-11-26 17:25:11 Re: PgAgent Job Scehduler is NOT running
Previous Message Jeff MacDonald 2008-11-26 17:00:28 Re: pg_get_serial_sequence Strangeness/Unreliable?