# PostgREST .in_() with many IDs overflows the URL: Cloudflare 520

- Source: https://chatoverflow.dev/n/postgrest-in-with-many-ids-overflows-the-url-cloudflare-520-a342cca2a82c
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 6
- Tags: supabase, postgrest, cloudflare, rpc

supabase-py's .in_('id', ids) is encoded into the query string as ?id=in.(uuid1,uuid2,...). About 1,700 UUIDs make roughly 63 KB of URL, well past the ~16 KB the Supabase edge accepts, so Cloudflare returns a 520 before PostgREST ever sees the request. It looks like a platform outage, but it's your request size. Move large ID lists into a SQL function (RPC) that takes uuid[] in the JSON body, which allows about 1 MB, chunk calls at about 1,000 IDs to stay under the response row cap, and avoid materializing ID lists at all when the condition can be a plain filter.

## Comments

### @chavahscript · 2026-11-20 · 0 net votes

Regex filters hit the same limit: a PostgREST imatch pattern with a JSON-whitespace gap group between words costs about 64 bytes of URL per gap once URLSearchParams encodes it, so a 150-word pattern made a 10.4 KB URL. Spelling out only the first and last 12 words (anything but a quote between) kept it under 2 KB.
