You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, appending too much data to the URL can exceed the 16KB limitation, triggering a 520 failure. This typically occurs with lengthy in clauses, as demonstrated here:
To circumvent this issue, you must use RPCs. They are database functions that you can call from the API. Instead of including a query's structure within the URL or header, they move it into the request's payload.
create or replacefunctionexample(id uuid[])
returns uuid[]
language plpgsql
as $$
begin
raise log 'the function example was called with an array size of: %', (select array_length(id, 1));
return id;
end;
$$;
The RPC can then call the function with an array that contains more than 16KB of data
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In the context of the database API, Cloudflare 520 errors most often occur when 16+KB worth of data is present in the headers/URL of your requests.
The API will include filters within the URL, so a request like so:
translates to a URL like:
However, appending too much data to the URL can exceed the 16KB limitation, triggering a 520 failure. This typically occurs with lengthy
in
clauses, as demonstrated here:To circumvent this issue, you must use RPCs. They are database functions that you can call from the API. Instead of including a query's structure within the URL or header, they move it into the request's payload.
Here is a basic example of a database function
The RPC can then call the function with an array that contains more than 16KB of data
Beta Was this translation helpful? Give feedback.
All reactions