Re: [BUGS] Bug #581: Sequence cannot be deleted - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [BUGS] Bug #581: Sequence cannot be deleted
Date
Msg-id 24439.1013546889@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] Bug #581: Sequence cannot be deleted  (Brent Verner <brent@rcfile.org>)
Responses Re: [BUGS] Bug #581: Sequence cannot be deleted
List pgsql-hackers
Brent Verner <brent@rcfile.org> writes:
> ISTM it would make sense to expose the sequence naming logic via
> a builtin function, such as pg_serialseq(table,column)?

That might seem cleaner, but I think there's a hidden gotcha: it nails
down a presumption that the sequence name is a function of the table
name, column name, and nothing else.  So I think it'd actually make it
harder rather than easier for us to make the sorts of changes we might
want to make in future.  (F'r instance, we might add an OID into the
name to prevent collisions.)

I believe that the surprising-name problem will largely go away anyway
as soon as we get around to increasing the default NAMEDATALEN.  With
a decent name length no one would ever see truncation in practice.

Also, of course, what we really want is for SERIAL sequences to get
dropped by themselves when the parent table is dropped, and then users
don't need to know what the generated sequence name is ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Brent Verner
Date:
Subject: Re: [BUGS] Bug #581: Sequence cannot be deleted
Next
From: Tom Lane
Date:
Subject: Re: Maintaining the list of release changes