© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
4 replies
Jake

Upsert with Python client not updating table

This seems a very simple challenge, but I'm stumped.

I'm trying to update a database with data from Google Analytics periodically. I'm using the Python client and upsert. Even with a basic single line, it does not seem to be updating the table. Table definition is:

create table
public.users_by_day (
id bigint generated by default as identity,
created_at timestamp with time zone not null default now(),
"pagePath" text not null,
date date not null,
"totalUsers" bigint not null,
constraint users_by_day_pkey primary key ("pagePath", date)
) tablespace pg_default;

My code is:

from supabase import create_client, Client

url: str = 'https://{id}.supabase.co'
key: str = '{key}'
supabase: Client = create_client(url, key)

response = supabase.table("users_by_day").upsert('[{"pagePath": "/tags/thing", "date": "2023-12-21", "totalUsers": 434}]').execute()
print(response)

Printed to the terminal is:

2024-01-05 15:07:39,210:INFO - HTTP Request: POST https://**************************.supabase.co/rest/v1/users_by_day "HTTP/1.1 200 OK"
data=[] count=None

I had it working, but it's stopped and I can't see any issues. I've tried with RLS enabled and disabled.

Any help would be very welcome.
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

onConflict Python upsert
SupabaseSSupabase / help-and-questions
4y ago
.rpc() with python supabase-client
SupabaseSSupabase / help-and-questions
4y ago
Python client questions
SupabaseSSupabase / help-and-questions
5mo ago
Updating/Upload with upsert not replacing image preview (?) but replacing file itself
SupabaseSSupabase / help-and-questions
7mo ago