Re: Use of Serial Datatype and Sequence Issue

From: Martín Marqués <martin(at)bugs(dot)unl(dot)edu(dot)ar>
To: Keary Suska <hierophant(at)pcisys(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Use of Serial Datatype and Sequence Issue
Date: 2001-11-05 23:14:54
Message-ID: 20011105231456.A2C082AB4A@bugs.unl.edu.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgsql-general

On Lun 05 Nov 2001 17:03, you wrote:
> The message may be a bit misleading. using a SERIAL data type actually
> means that you are implicitly creating a sequence. A sequence is a separate
> object, not tied to any column. Data type SERIAL is just shorthand for
> defining an INT4 column and a sequence object with a DEFAULT clause on the
> column calling the sequence. You can do this explicitly as well. The docs
> may not be clear about this relationship. Hence, you have to drop the
> sequences explicitly if you don't want them anymore.
>
> IMHO, when you do a data-only pg_dump as SQL inserts, the fact that SQL to
> create sequences is dumped as well seems a bug to me. Any plans to change
> this, Tom Lane?

Where's the bug? The inserts come with the value inserted into the INT column
(origanally SERIAL), so all that has to be taken care of is making the
sequence start where it is, which is the behaviour of pg_dump.

What would be great is a binary dump, with it's reload application, so that
BIG backups/restores could be done in a small amount of time.

Saludos... :-)

--
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués | mmarques(at)unl(dot)edu(dot)ar
Programador, Administrador, DBA | Centro de Telematica
Universidad Nacional
del Litoral
-----------------------------------------------------------------

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Keary Suska 2001-11-06 06:42:51 Re: Use of Serial Datatype and Sequence Issue
Previous Message Keary Suska 2001-11-05 20:03:54 Re: Use of Serial Datatype and Sequence Issue

Browse pgsql-general by date

  From Date Subject
Next Message Martín Marqués 2001-11-05 23:17:51 Re: data integrity
Previous Message speedboy 2001-11-05 22:39:35 Re: Stored procedures