Any way to see history of queries ran through the SQL editor in the dashboard?
We recently had an incident where some rows from a table were deleted while some devs were running queries through the SQL editor.
I want to investigate and find out if those queries were responsible for the data that went missing, but I can't find a way to see the history of queries ran through that editor.
The logs in
logs > postgres in the dashboard only show "connection established" to the 'supabase/dashboard-query-editor', but not the queries that were ran.
Can anybody help?4 Replies
Not after the fact unless you saved them as snippets. By default logs only show errors for Postgres. You can change log settings to log all queries with pg_audit but not recommended for production.
Got it. That's unfortunate. Thank you for confirming.
@garyaustin Could you elaborate on why that pg_audit settings change/extension isn't recommended for production?
If you are careful in limiting the amount of data it is collecting it can be useful in production. But if you try and log everything you are going to generate huge logs and start impacting performance.
Supabase docs used to have a warning about it but all I can find now is this:
https://supabase.com/docs/guides/database/extensions/pgaudit#disabling-excess-logging
Got it. Thank you!