© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•13mo ago
Big dog

Potential Bug in SQL Editor?

Hey everyone,

Am potentially seeing a bug in the SQL editor. My current setup:
* primary database in us-east-1
* read replica in us-west-1

I was trying to do some debugging on my client connections, when I found that I was getting inconsistent results when running queries in the SQL editor.

I ran this query:
SELECT 
    usename,
    application_name,
    client_addr,
    state,
    EXTRACT(EPOCH FROM (now() - state_change))::INTEGER as idle_seconds,
    query as last_query
FROM pg_stat_activity 
WHERE state = 'idle'
ORDER BY state_change DESC;
SELECT 
    usename,
    application_name,
    client_addr,
    state,
    EXTRACT(EPOCH FROM (now() - state_change))::INTEGER as idle_seconds,
    query as last_query
FROM pg_stat_activity 
WHERE state = 'idle'
ORDER BY state_change DESC;

First I ran this query with the
source
source
as the
Primary
Primary
, and then switched it to
Read Replica
Read Replica
. No issues here, but if I left the tab open and the source still selected at
Read Replica
Read Replica
, and came back to it after ~10 minutes, hitting run again would show the results for the
Primary
Primary
. I'm pretty confident this was the case, as I was seeing queries with
INSERT
INSERT
in the results, but my
Read Replica
Read Replica
has no INSERTs. Switching the
source
source
to
Primary
Primary
and then back to
Read Replica
Read Replica
seems to fix the issue.

Not critical, but super confusing for a bit. Wonder if others see the same issue.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

SQL Editor
SupabaseSSupabase / help-and-questions
7mo ago
Backup of snippets in SQL Editor
SupabaseSSupabase / help-and-questions
4y ago
SQL EDITOR IS BROKEN
SupabaseSSupabase / help-and-questions
3y ago
Table Editor to SQL
SupabaseSSupabase / help-and-questions
4y ago