Re: General question regarding sequences (Serial columns)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks.  I just looked at the definition and see it is a default value,
so I should be safe just pumping the data over.
On completion of the import I plan to reseed he sequence generator.


-----Original Message-----
From: Juan Miguel Paredes [mailto:juan.paredes@xxxxxxxxx] 
Sent: Thursday, June 15, 2006 11:28 AM
To: Benjamin Krajmalnik
Subject: Re: [ADMIN] General question regarding sequences (Serial
columns)

> If I were to use the former (use Serial/BigSerial), is there a command
> which I can issue to keep PostgreSQL from using the sequence, and
> therefore copying over the original identity field value?  Something
> equivalent to SQL Server's "SET IDENTITY_INSERT" command?

"Serial" declares your column being an integer type and provides a
default value (the next value from the sequence).  If you DO provide a
value for your id column, PostgreSQL won't use the sequence.  However,
be careful to keep in sync your sequence with the values in your
table, to avoid collissions (ALTER SEQUENCE can help)

Regards.


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux