SQL/MP Version Management Guide

Database Versions
Compaq NonStop™ SQL/MP Version Management Guide429833-001
3-11
Object Versions and Catalog Versions
CREATE CONSTRAINT. When this statement is executed to create a constraint,
the table version is raised to match the version of the constraint if the version of any
constraint feature is newer than the version of its base table. Raising the table’s
version can affect the versions of other objects dependent on the base table. The
version of a constraint is not registered in a catalog.
For example, suppose you have a version 1 table and you create a constraint that has
an exponentiation in it, such as a version 2 constraint. The table’s version is raised
to version 2.
Object Versions and Catalog Versions
Newer-version objects cannot be registered in older-version catalogs. If you create a
new object to be registered in a catalog that has an older version than the created object,
a version error is returned. To avoid version errors, either upgrade the catalog or create a
new catalog for registering new objects.
In some circumstances, the creation of an object affects more than one catalog. For
example, when you create a table with two partitions registered in two different catalogs,
both catalogs are affected, and version checks are performed on both affected catalogs.
As a example, suppose you create a version 300 index on a version 2 base table, raising
the version of the base table to 300. Also suppose that the version of the catalog in
which the table is to be registered is older than 300. To avoid a version error in this
situation, you must upgrade the older catalog to version 300 or newer before you create
the newer-version index and table.
The version of an object can be older than the version of the catalog in which the object
is registered. An older-version object in a newer-version catalog can still be accessed by
older-version programs. As a result, you can upgrade a catalog without affecting the
existing objects in the catalog.
When you test a new version of SQL/MP software, a good practice is to create a new
catalog to hold new objects, but to leave older-version objects in existing catalogs.
Otherwise, if you later revert to an older version of the software, you can no longer
access older-version objects registered in the newer-version catalog unless you first
remove the newer-version objects and downgrade the catalog.
Suppose you install version 315 software on a production system and want to test a new
set of collations. You can create a version 315 catalog on that system to hold the
collations to be tested, as illustrated in Figure 3-3
. Then you can continue to run your
existing applications with the older-version production catalog while you test the new
objects with the newer-version test catalog.