ALTER EXTENSION

Change the definition of the extension registered in the YMatrix database.

Summary

ALTER EXTENSION name UPDATE [ TO new_version ]
ALTER EXTENSION name SET SCHEMA new_schema
ALTER EXTENSION name ADD member_object
ALTER EXTENSION name DROP member_object

where member_object is:

  ACCESS METHOD object_name |
  AGGREGATE aggregate_name ( aggregate_signature ) |
  CAST (source_type AS target_type) |
  COLLATION object_name |
  CONVERSION object_name |
  DOMAIN object_name |
  EVENT TRIGGER object_name |
  FOREIGN DATA WRAPPER object_name |
  FOREIGN TABLE object_name |
  FUNCTION function_name ( [ [ argmode ] [ argname ] argtype [, ...] ] ) |
  MATERIALIZED VIEW object_name |
  OPERATOR operator_name (left_type, right_type) |
  OPERATOR CLASS object_name USING index_method |
  OPERATOR FAMILY object_name USING index_method |
  [ PROCEDURAL ] LANGUAGE object_name |
  SCHEMA object_name |
  SEQUENCE object_name |
  SERVER object_name |
  TABLE object_name |
  TEXT SEARCH CONFIGURATION object_name |
  TEXT SEARCH DICTIONARY object_name |
  TEXT SEARCH PARSER object_name |
  TEXT SEARCH TEMPLATE object_name |
  TRANSFORM FOR type_name LANGUAGE lang_name |
  TYPE object_name |
  VIEW object_name

and aggregate_signature is:

* |
[ argmode ] [ argname ] argtype [ , ... ] |
[ [ argmode ] [ argname ] argtype [ , ... ] ] ORDER BY [ argmode ] [ argname ] argtype [ , ... ]

describe

ALTER EXTENSION Change the definition of the installed extension. There are several seed forms:

UPDATE

  • This form updates the extension to a newer version. The extension must provide a suitable update script (or a series of scripts) that can modify the currently installed version to the required version.

SET SCHEMA

  • This form moves the extended object into another mode. The extension must be relocatable.

ADD member_object

  • This form adds an existing object to the extension. This is useful in extended update scripts. This object will be subsequently treated as a member of the extension. In particular, this object can only be deleted by deleting the extension.

DROP member_object

  • This form removes a member object from the extension. This is mainly useful for extending update scripts. The object can only be deleted after undoing the association between the object and its extension.

Users must have ownership of the extension to use ALTER EXTENSION. The ADD and DROP forms also require ownership of objects that need to be added or deleted.

Parameters

name

  • Extensions to be installed

new_version

  • New version extension. new_version is an identifier or string literal. If not specified, the command attempts to update to the default version in the extension control file.

new_schema

  • New mode for expansion.

object_name

aggregate_name

function_name

operator_name

  • The name of the object to be added or removed from the extension. The names of tables, aggregates, domains, external tables, functions, operators, operator classes, operator families, sequences, text search objects, types, and views can be qualified by the scheme.

source_type

  • Name of the source data type to be converted.

target_type

  • The name of the target data type that needs to be converted.

argmode

  • Model of function or aggregated parameters: IN, OUT, INOUT, or VARIADIC. The default value is IN.
    This command ignores the OUT parameter. Only by entering parameters is required to determine the identification of a function. This is enough to list the IN, INOUT and VARIADIC parameters.

argname

  • The name of the function or aggregate parameter.
    This command ignores the name of the parameter because the data type of the parameter has already determined to identify a function.

argtype

  • The data type of function or aggregated parameters.

left_type

right_type

  • Data type of operator parameter (can be scheme-qualified). Specifies the missing parameter of NONE for a prefix or suffix operator.

PROCEDURAL

  • This is a noisy word.

type_name

  • The name of the data type of the converted.

lang_name

  • The name of the language to which the conversion is.

Example

Update hstore to version 2.0:

ALTER EXTENSION hstore UPDATE TO '2.0';

Change the hstore extension mode to utils:

ALTER EXTENSION hstore SET SCHEMA utils;

Add an existing function to the hstore extension:

ALTER EXTENSION hstore ADD FUNCTION populate_record(anyelement, hstore);

compatibility

ALTER EXTENSION is an extension of the YMatrix database

See also

CREATE EXTENSION , DROP EXTENSION