ALTER LIBRARY
Replaces the library file (for example, C++ .so file or Java .jar file) associated with a UDx library that is defined in the Vertica catalog. Vertica automatically distributes copies of the updated file throughout the cluster. UDxs defined in the catalog that reference the updated library automatically start using the updated library file. Nodes that are down or added to the cluster also receive a copy of the updated library file as soon as they join the cluster.
Syntax
ALTER LIBRARY [[database.]schema.]library‑name [DEPENDS 'support‑path'] AS 'library‑path';
Parameters
schema |
Specifies a schema, by default myschema.thisDbObject If you specify a database, it must be the current database. |
library‑name |
The library to alter. You can only alter an existing library. |
DEPENDS 'support‑path'
|
Indicates that the UDx library depends on one or more support libraries, where support‑path specifies one or more absolute paths to the support libraries files, located in the initiator node's file system. You can specify multiple support paths as follows:
|
library‑path |
The absolute path in the initiator node file system to the replacement library file. |
Privileges
Superuser
Requirements
- The new library must be developed in the same programming language as the library file being replaced. For example, you cannot use this statement to replace a C++ library file with an R library file.
- Vertica does not compare the functions defined in the new library to ensure they match any currently-defined functions in the catalog. If you change the signature of a function in the library (for example, if you change the number and data types accepted by a UDSF defined in the library), calls to that function will likely generate errors. If your new library file changes the definition of a function, you must remove the function using DROP FUNCTION before using ALTER LIBRARY to load the new library. You can then recreate the function using its new signature.
Examples
This example shows how to update an already-defined library myFunctions with a new file.
=> ALTER LIBRARY myFunctions AS '/home/dbadmin/my_new_functions.so';
See Also
Developing User-Defined Extensions (UDxs)