ALTER EXTERNAL LOCATION

Updates an existing external location's URL, bound credential, options, owner, or comment.

Category: configurationPrivilege: adminDeltaForge extension

Syntax

ALTER EXTERNAL LOCATION <name>
  [SET URL '<url>']
  [SET STORAGE CREDENTIAL '<credential_name>']
  [SET (<key> = '<value>', ...)]
  [OWNER TO <new_owner>]
  [COMMENT '<description>']

Description

## Overview ALTER EXTERNAL LOCATION updates the configuration of an existing location in place. Use it to change the bound credential after a rotation, switch URLs after a bucket migration, or toggle the read-only flag. ## Behavior - The location must already exist; otherwise the ALTER raises an error. - When the bound credential is changed, the new credential must already exist. The executor validates this and rejects the statement if the credential is missing. - The `updated_at` timestamp advances on every successful ALTER. - Tables, schemas, or zones rooted at the location continue to resolve through the location's name; they pick up the new URL or credential automatically on the next storage operation. ## Access Control Requires the admin role. ## Compatibility DeltaForge extension.

Parameters

NameTypeDescription
nameSpecifies the external location to alter. Must already exist.
new_urlSpecifies the new storage URL.
new_credentialSpecifies the new bound storage credential. The credential must already exist; the executor validates this at ALTER time.
set_optionsSpecifies new option values. The reserved option `read_only = 'true' | 'false'` toggles the read-only flag.
new_ownerSpecifies a new owner principal.
new_commentSpecifies a new description.

Examples

-- Switch a location to a new credential after rotating the IAM role
ALTER EXTERNAL LOCATION raw_data SET STORAGE CREDENTIAL 'prod_aws_role_v2';
-- Change the URL after a bucket move
ALTER EXTERNAL LOCATION raw_data SET URL 's3://company-raw-eu/';
-- Toggle read-only
ALTER EXTERNAL LOCATION audit_archive SET (read_only = 'true');

Pitfalls

See Also

Open in interactive docs →   DeltaForge home →