ALTER SECRET
ALTER SECRET
changes the contents of a secret. To rename a secret, see ALTER...RENAME
.
Syntax
Field | Use |
---|---|
name | The identifier of the secret you want to alter. |
value | The new value for the secret. The value expression may not reference any relations, and must be implicitly castable to bytea . |
Details
After an ALTER SECRET
command is executed:
-
Future
CREATE CONNECTION
,CREATE SOURCE
, andCREATE SINK
commands will use the new value of the secret immediately. -
Running sources and sinks that reference the secret will not immediately use the new value of the secret. Sources and sinks may cache the old secret value for several weeks.
To force a running source or sink to refresh its secrets:
-
If the source or sink was created with the
IN CLUSTER
option, drop and recreate all replicas of the cluster hosting the source or sink.For a managed cluster:
ALTER CLUSTER storage_cluster SET (REPLICATION FACTOR = 0); ALTER CLUSTER storage_cluster SET (REPLICATION FACTOR = 1);
For an unmanaged cluster:
DROP CLUSTER REPLICA storage_cluster.r1; CREATE CLUSTER REPLICA storage_cluster.r1 (SIZE = '<original size>');
-
If the source or sink was created with the
SIZE
option, useALTER SOURCE
orALTER SINK
to temporarily scale down the source and then scale it back to its original size. For example, if sources
is currently running with sizesmall
:ALTER SOURCE src SET (SIZE = 'xsmall'); -- Any size that is not `small` will work. ALTER SOURCE src SET (SIZE = 'small');
-
Examples
ALTER SECRET upstash_kafka_ca_cert AS decode('c2VjcmV0Cg==', 'base64');
Privileges
The privileges required to execute this statement are:
- Ownership of the secret being altered.