Method: projects.instances.databases.patch Stay organized with collections Save and categorize content based on your preferences.
Updates a Cloud Spanner database. The returned long-running operation can be used to track the progress of updating the database. If the named database does not exist, returnsNOT_FOUND.
While the operation is pending:
- The database's
reconcilingfield is set to true. - Cancelling the operation is best-effort. If the cancellation succeeds, the operation metadata's
cancelTimeis set, the updates are reverted, and the operation terminates with aCANCELLEDstatus. - New databases.patch requests will return a
FAILED_PRECONDITIONerror until the pending operation is done (returns successfully or with error). - Reading the database via the API continues to give the pre-request values.
Upon completion of the returned operation:
- The new values are in effect and readable via the API.
- The database's
reconcilingfield becomes false.
The returned long-running operation will have a name of the formatprojects/<project>/instances/<instance>/databases/<database>/operations/<operationId> and can be used to track the database modification. The metadata field type isUpdateDatabaseMetadata. The response field type isDatabase, if successful.
HTTP request
PATCH https://spanner.googleapis.com/v1/{database.name=projects/*/instances/*/databases/*}The URLs usegRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
database.name |
Required. The name of the database. Values are of the form |
Query parameters
| Parameters | |
|---|---|
updateMask |
Required. The list of fields to update. Currently, only This is a comma-separated list of fully qualified names of fields. Example: |
Request body
The request body contains an instance ofDatabase.
Response body
If successful, the response body contains an instance ofOperation.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/spanner.adminhttps://www.googleapis.com/auth/cloud-platform
For more information, see theAuthentication Overview.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-12 UTC.