Re: Auto DROP SEQUENCE?

From: Daryl Beattie <dbeattie(at)insystems(dot)com>
To: 'frbn' <frbn(at)efbs-seafrigo(dot)fr>, "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Auto DROP SEQUENCE?
Date: 2002-07-25 15:05:31
Message-ID: 4160E6FC08ABD21191F000805F857E9304DF456E@mail.insystems.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Please see below:

> -----Original Message-----
> From: frbn [mailto:frbn(at)efbs-seafrigo(dot)fr]
> Sent: Thursday, July 25, 2002 9:27 AM
> To: Daryl Beattie
> Cc: 'pgsql-general(at)postgresql(dot)org'
> Subject: Re: [GENERAL] Auto DROP SEQUENCE?
>
>
> Daryl Beattie a écrit:
> > Hi PostgreSQL people,
> >
> > I was wondering; I have noticed that sequences are not dropped
> > automatically if they are used by a table. That's okay; I
> bet somebody has a
> > good reason why this is so. However, when sequences are
> created implicitly
> > by somebody using the SERIAL data type, does it not make
> sense to drop that
> > sequence when the table is dropped?
> > I'm just throwing the question out. :)
>
> a sequence can be used by more than one table.
>
> I presume it's the reason why seq are not dropped.
>

Yes, it can.

But a sequnce that is automatically generated using the SERIAL data type
*should not* be used by more than one table. The SERIAL type abstracts the
sequence away from the SQL user so that the user might not even really know
that SERIAL is implemented using a sequence. The fact that a SERIAL is a
sequence is an implementation detail, right? And as such, perhaps those
sequences should be dropped with the table.

If my reasoning is incorrect, please correct me.

Sincerely,

Daryl.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message pgsql-gen Newsgroup (@Basebeans.com) 2002-07-25 15:10:02 *FREE* slides of an upcoming web presendation : MVC+ STANDARD tags
Previous Message Andrew Sullivan 2002-07-25 15:04:17 Re: erserver