Deploying a new version of your UDx library
You need to deploy a new version of your UDx library if:
-
You have made changes to the library that you now want to roll out to your Vertica database.
-
You have upgraded Vertica to a new version whose SDK is incompatible with the previous version.
The process of deploying a new version of your library is similar to deploying it initially.
-
If you are deploying a UDx library developed in C++ or Java, you must compile it with the current version of the Vertica SDK.
-
Copy your UDx's library file (a
.so
file for libraries developed in C++, a.py
file for libraries developed in Python, or a.jar
file for libraries developed in Java) or R source file to a host in your Vertica database. -
Connect to the host using vsql.
-
If you have changed the signature of any of the UDxs in the shared library, you must drop them using DROP statements such as DROP FUNCTION or DROP SOURCE. If you are unsure whether any of the signatures of your functions have changed, see Determining if a UDx signature has changed.
Note
If all of the UDx signatures in your library have changed, you may find it more convenient to drop the library using the DROP LIBRARY statement with the CASCADE option to drop the library and all of the functions and loaders that reference it. Droping the library can save you the time it would take to drop each UDx individually. You can then reload the library and recreate all of the extensions using the same process you used to deploy the library in the first place. See CREATE LIBRARY. -
Use the ALTER LIBRARY statement to update the UDx library definition with the file you copied in step 1. For example, if you want to update the library named
ScalarFunctions
with a file namedScalarFunctions-2.0.so
in the dbadmin user's home directory, you could use the command:=> ALTER LIBRARY ScalarFunctions AS '/home/dbadmin/ScalarFunctions-2.0.so';
After you have updated the UDx library definition to use the new version of your shared library, the UDxs that are defined using classes in your UDx library begin using the new shared library file without any further changes.
-
If you had to drop any functions in step 4, recreate them using the new signature defined by the factory classes in your library. See CREATE FUNCTION statements.