DROP POSTGRES INSTANCE¶
Removes the specified Snowflake Postgres instance from the account.
- See also:
CREATE POSTGRES INSTANCE, ALTER POSTGRES INSTANCE, DESCRIBE POSTGRES INSTANCE, SHOW POSTGRES INSTANCES
Syntax¶
Parameters¶
nameSpecifies the identifier for the Postgres instance to drop.
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.
Access control requirements¶
A role used to execute this operation must have the following privileges at a minimum:
Privilege |
Object |
Notes |
|---|---|---|
OWNERSHIP |
Postgres instance |
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.
Usage notes¶
Currently, dropped Postgres instances can’t be recovered; you must recreate them. However, if you have created a fork of the instance, the fork remains independent and unaffected. To make it easier to recreate instances later, you might use DESC POSTGRES INSTANCE to capture the details of each instance before dropping it.
When this command is issued, Snowflake terminates the Postgres instance and releases the associated compute resources. Billing for compute resources stops after the instance is fully terminated.
All data stored in the Postgres instance is permanently deleted. Ensure you have backed up any important data before dropping the instance.
If the instance has high availability enabled, the HA standby is also dropped along with the primary instance.
If the instance has read replicas, those replicas are also dropped when the primary instance is dropped.
Forked instances are independent copies. Dropping the source instance doesn’t affect any instances that were forked from it.
When the IF EXISTS clause is specified and the target object doesn’t exist, the command completes successfully without returning an error.
Examples¶
Drop a Postgres instance:
Drop a Postgres instance only if it exists:
Use the flow operator to find an instance to drop:
Find instances below a storage threshold before dropping:
Check ownership before attempting to drop: