Title: RE: [Users] Ingres SEQUENCE

> A word of warning:  There is a reason experienced
> Ingres architects do not use any of the table key
> datatypes.  The system maintained version (the only
> one you may feel is useful) CANNOT be copied from one
> database to another or even unloaded/reloaded.  This
> means as a synthetic/surrogate key it is not useful.

I agree a table with a system maintained logical key referenced by another table makes it very awkward to copy the data between databases. The system maintained key is regenerated when the data is copied in, so any foreign keys are no longer valid.

There is a way to rebuild the references, although it's not pretty. Apologies if I'm getting a bit off topic:
- Ensure table with system maintained key has page size >2k
- Add a new table_key column (not system maintained)
- Update this from the system maintained column
- Copy out & copy in
- Update any foreign keys in other tables with the new sm key, matching on the new column
- Drop the new column

************************************************************************

DISCLAIMER

The information contained in this e-mail is confidential and is intended

for the recipient only.

If you have received it in error, please notify us immediately by reply

e-mail and then delete it from your system. Please do not copy it or

use it for any other purposes, or disclose the content of the e-mail

to any other person or store or copy the information in any medium.

The views contained in this e-mail are those of the author and not

necessarily those of Admenta UK Group.

************************************************************************

_______________________________________________
Users mailing list
Users@ingres.ca.com
http://ingres.ca.com/mailman/listinfo/users

Reply via email to