ALTER EXTERNAL CONSUMER … MODIFY PROGRAMMATIC ACCESS TOKEN (PAT)

Modifies the properties of a Programmatic Access Token (PAT) for an external consumer.

See also:

ALTER EXTERNAL CONSUMER … ADD PROGRAMMATIC ACCESS TOKEN (PAT) , ALTER EXTERNAL CONSUMER … REMOVE PROGRAMMATIC ACCESS TOKEN (PAT) , ALTER EXTERNAL CONSUMER … ROTATE PROGRAMMATIC ACCESS TOKEN (PAT) , SHOW USER PROGRAMMATIC ACCESS TOKENS FOR EXTERNAL CONSUMER

Syntax

ALTER EXTERNAL CONSUMER <name>
  MODIFY { PROGRAMMATIC ACCESS TOKEN | PAT } [ IF EXISTS ] <token_name>
  [ SET
    [ DAYS_TO_EXPIRY = <integer> ]
    [ COMMENT = '<string_literal>' ]
  ]
  [ UNSET
    [ COMMENT ]
  ]

Required parameters

name

Specifies the identifier for the external consumer.

MODIFY { PROGRAMMATIC ACCESS TOKEN | PAT } token_name

Modifies the programmatic access token with the specified name. PAT is an alias for PROGRAMMATIC ACCESS TOKEN.

Optional parameters

IF EXISTS

Applies the change only if a token with the specified name exists. If no token with that name exists, the command does nothing and completes successfully instead of returning an error.

DAYS_TO_EXPIRY = integer

Updates the number of days that the token can be used for authentication.

COMMENT = 'string_literal'

Updates the comment on the token.

Access control requirements

A role used to execute this operation must have the following privileges at a minimum:

PrivilegeObjectNotes
OWNERSHIPExternal ConsumerRequired to modify a PAT for the external consumer.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Examples

Update the comment on a PAT:

ALTER EXTERNAL CONSUMER acme_consumer MODIFY PAT acme_pat
  SET COMMENT = 'Renewed for Q3 access';

Update the expiry on a PAT:

ALTER EXTERNAL CONSUMER acme_consumer MODIFY PAT acme_pat
  SET DAYS_TO_EXPIRY = 30;