From 54ed3270956b94f7ff742322aebf25b031ea8fca Mon Sep 17 00:00:00 2001 From: Rodrigo Mansueli Nunes Date: Fri, 14 Jul 2023 10:29:52 -0300 Subject: [PATCH] chore: explain read only mode in more detail --- .../pages/guides/platform/database-size.mdx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/docs/pages/guides/platform/database-size.mdx b/apps/docs/pages/guides/platform/database-size.mdx index 552d3b9c487..3edb38caf24 100644 --- a/apps/docs/pages/guides/platform/database-size.mdx +++ b/apps/docs/pages/guides/platform/database-size.mdx @@ -89,11 +89,28 @@ In read-only mode, clients will encounter errors such as `cannot execute INSERT You can manually override read-only mode to reduce disk size. To do this, run the following in the [SQL Editor](https://supabase.com/dashboard/project/_/sql): +To change the [transaction access mode](https://www.postgresql.org/docs/current/sql-set-transaction.html) for the current transaction: + ```sql SET TRANSACTION READ WRITE; ``` This allows you to delete data from within the session. After deleting data, you should run a vacuum to reclaim as much space as possible. +You can also change the default transaction access mode for all subsequent transactions of a session: + +```sql +SET SESSION CHARACTERISTICS AS TRANSACTION READ WRITE; +``` +Ater deleting data, you should run a vacuum to reclaim as much space as possible. + +```sql +VACUUM; +``` +After completing this in a session, then you can run the following to disable [read-only](https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-READ-ONLY) mode: + +```SQL +SET default_transaction_read_only = 'off'; +``` export const Page = ({ children }) =>