EXPORT_OBJECTS

Generates a SQL script you can use to recreate non-virtual catalog objects on another cluster. The following requirements apply:

  • EXPORT_OBJECTS only exports objects to which the user has access.
  • EXPORT_OBJECTS exports objects in order dependency for correct recreation. When you run the script on another cluster, Vertica creates all referenced objects before their dependent objects.
  • EXPORT_OBJECTS always tries to recreate projection statements with their KSAFE clause, if any, otherwise with their OFFSET clause.

Syntax

EXPORT_OBJECTS( '[destination]' [, 'scope' ] [, 'ksafe' ] )

Parameters

destination

Specifies where to send output, one of the following:

  • An empty string ('') writes the script to standard output.
  • The path and name of a SQL output file. This option is valid only for superusers. If you specify a file that does not exist, the function creates one. If you specify only a file name, Vertica creates it in the catalog directory. If the file already exists, the function silently overwrites its contents.

scope

Specifies one or more objects to export, as follows:

[database.]schema[.object][,…]

If set to an empty string, Vertica exports all objects to which the user has access, including constraints.

If you specify a schema, Vertica exports all objects in that schema.

If you specify a database, it must be the current database.

ksafe

Specifies whether to include a MARK_DESIGN_KSAFE statement in the generated script with the correct K-safe value for the database:

  • true (default): Include the MARK_DESIGN_KSAFE statement at the end of the output script.
  • false: Omit the MARK_DESIGN_KSAFE statement from the script.

Privileges

None

Example

See Exporting Objects.