ALTER POSTGRES INSTANCE

statementpartialContainer services & dev tooling

docs.snowflake.com ↗

Object: POSTGRES INSTANCE

Modifies the properties of an existing Snowflake Postgres instance.

Syntax

supportedpartialnot supportednot scored

ALTER POSTGRES INSTANCE [ IF EXISTS ] <name>
  RENAME TO <new_name>

ALTER POSTGRES INSTANCE [ IF EXISTS ] <name> SET
  [ NETWORK_POLICY = '<network_policy>' ]
  [ AUTHENTICATION_AUTHORITY = { POSTGRES | POSTGRES_OR_SNOWFLAKE | EXTERNAL_OAUTH } ]
  [ AUTHENTICATION_PROPERTIES = ( <authentication_properties> ) ]
  [ COMMENT = '<string_literal>' ]
  [ HIGH_AVAILABILITY = { TRUE | FALSE } ]
  [ COMPUTE_FAMILY = '<compute_family>' ]
  [ STORAGE_SIZE_GB = <storage_gb> ]
  [ STORAGE_INTEGRATION = '<storage_integration_name>' ]
  [ POSTGRES_VERSION = { 16 | 17 | 18 } ]
  [ MAINTENANCE_WINDOW_START = <hour_of_day> ]
  [ POSTGRES_SETTINGS = '<json_string>' ]
  [ APPLY { IMMEDIATELY | ON '<timestamp>' } ]

ALTER POSTGRES INSTANCE [ IF EXISTS ] <name>
  UNSET { COMMENT | POSTGRES_SETTINGS | NETWORK_POLICY
    | MAINTENANCE_WINDOW_START | STORAGE_INTEGRATION } [ , ... ]

ALTER POSTGRES INSTANCE [ IF EXISTS ] <name> SUSPEND

ALTER POSTGRES INSTANCE [ IF EXISTS ] <name> RESUME

ALTER POSTGRES INSTANCE [ IF EXISTS ] <name> RESET ACCESS
  FOR { 'snowflake_admin' | 'application' }

ALTER POSTGRES INSTANCE [ IF EXISTS ] <name> SET TAG <tag_name> =
  '<tag_value>' [ , <tag_name> = '<tag_value>' ... ]

ALTER POSTGRES INSTANCE [ IF EXISTS ] <name> UNSET TAG <tag_name>
  [ , <tag_name> ... ]

Parameters

NameRequiredDescription
nameSpecifies the identifier for the Postgres instance to alter. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. For more information, see Identifier requirements.
RENAME TO new_nameChanges the name of the Postgres instance to the specified new name. The new identifier must be unique for the account. For more details about identifiers, see Identifier requirements.
RESET ACCESS FOR { 'snowflake_admin' | 'application' }Regenerates credentials for the snowflake_admin or application role. Returns one row with the following column: password For more information, see Snowflake Postgres Roles.
SET ...Sets one or more specified properties for the Postgres instance:
NETWORK_POLICY = 'network_policy'Specifies the network policy to use for the instance. Changes to the policy may take up to 2 minutes to take effect. To specify this parameter, you must have been granted the USAGE privilege on the network policy object.
AUTHENTICATION_AUTHORITY = { POSTGRES | POSTGRES_OR_SNOWFLAKE | EXTERNAL_OAUTH }Specifies the authentication authority for the instance: POSTGRES: Postgres authentication. Only Postgres login roles and passwords. This is the default. POSTGRES_OR_SNOWFLAKE: Snowflake token authentication. The instance accepts Postgres passwords and short-lived Snowflake token passwords. EXTERNAL_OAUTH: External OAuth. Access tokens from an external identity provider. Requires AUTHENTICATION_PROPERTIES. For the dialog, the stored audience, the limit of 10 accepted tokens, and when two accepted tokens are rejected, see Configure authentication for Snowflake Postgres.
AUTHENTICATION_PROPERTIES = ( <authentication_properties> )Specifies the External OAuth configuration: ISSUER, AUDIENCE, and ACCEPTED_TOKENS. Each accepted token has MAPPING_CLAIM, SCOPES_CLAIM, and SCOPES. Specifying these properties is an error unless the authority is External OAuth. For the dialog, the stored audience, the limit of 10 accepted tokens, and when two accepted tokens are rejected, see Configure authentication for Snowflake Postgres.
COMMENT = 'string_literal'Adds or overwrites an existing comment for the Postgres instance.
HIGH_AVAILABILITY = { TRUE | FALSE }Enables or disables high availability for the instance. Executes as an asynchronous operation. Run the DESCRIBE POSTGRES INSTANCE command and monitor the operations field to track progress. A high availability change can only be initiated if the instance is in the READY state and no other operation is running. Note Burstable instance sizes (BURST_S, BURST_M) do not support high availability. To enable HA, you must first change to a STANDARD or HIGHMEM compute family.
COMPUTE_FAMILY = 'compute_family'Specifies the new instance size for the Postgres instance.
STORAGE_SIZE_GB = storage_gbSpecifies the new storage size in GB. Both increases and decreases are supported. Note When you decrease the storage size, you can’t set it too close to current disk usage. The new size must be at least 1.4x the disk space currently in use. That way, there’s still room to add more data without triggering an automatic storage increase.
STORAGE_INTEGRATION = 'storage_integration_name'Attaches a storage integration of type POSTGRES_EXTERNAL_STORAGE to the Postgres instance, enabling the pg_lake extension to access data in external object storage. For the complete setup procedure, see pg_lake. Preview Feature — Open Available to all accounts.
POSTGRES_VERSION = { 16 | 17 | 18 }Specifies the Postgres major version to upgrade to. You can only upgrade to a newer version; downgrading isn’t supported.
MAINTENANCE_WINDOW_START = hour_of_daySpecifies the hour of day (0-23, UTC) when a maintenance window can start. Maintenance windows are three hours long, starting from the specified hour.
POSTGRES_SETTINGS = 'json_string'Specifies changes to the Postgres server settings for the instance in JSON format:Copy code '{"component:name": "value", ...}' Some settings require an instance restart to take effect. These changes won’t be applied unless you specify APPLY IMMEDIATELY.
APPLY IMMEDIATELYOverrides any defined maintenance window and applies the specified operations as soon as they’re ready. Applies to COMPUTE_FAMILY, STORAGE_SIZE_GB, POSTGRES_VERSION, and POSTGRES_SETTINGS.
APPLY ON 'timestamp'Overrides any defined maintenance window and applies the specified operations at the given timestamp. The timestamp can’t be more than 72 hours in the future. Supported timestamp formats: yyyy-MM-dd yyyy-MM-dd HH:mm yyyy-MM-dd HH:mm:ss yyyy-MM-dd HH:mm zzz
UNSET ...Unsets one or more specified properties for the Postgres instance, resetting them to their defaults: COMMENT POSTGRES_SETTINGS NETWORK_POLICY MAINTENANCE_WINDOW_START - Unsetting causes all ongoing operations to be applied as soon as they’re completed. STORAGE_INTEGRATION - Removes the storage integration from the instance, disabling pg_lake access to external storage. To unset multiple properties or parameters with a single ALTER statement, separate each property or parameter with a comma. When unsetting a property or parameter, specify only the property or parameter name (unless the syntax above indicates that you should specify the value). Specifying the value returns an error.
SUSPENDSuspends the Postgres instance. The virtual machine is deactivated while the disk image is kept in storage. Normal billing is suspended, but storage costs continue to accrue. Existing backups are retained.
RESUMEResumes a suspended Postgres instance. If there were operations pending restart, they’re applied when the instance resumes.
TAG tag_name = 'tag_value' [ , tag_name = 'tag_value' , ... ]Specifies the tag name and the tag string value. The tag value is always a string, and the maximum number of characters for the tag value is 256. For information about specifying tags in a statement, see Tag quotas.

Usage notes

Access control requirements

A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes OWNERSHIP or MODIFY | Postgres instance | Required for modifying instance properties. OWNERSHIP or OPERATE | Postgres instance | Required for SUSPEND and RESUME acctions. USAGE | Network policy | Required only if specifying a NETWORK_POLICY. USAGE | Storage integration | Required only if specifying a STORAGE_INTEGRATION. 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.

Known gaps

Parts not fully supported, and recorded divergences from Snowflake.

See also

Referenced by