Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Max content lenght for single-row inserts not definedย #414

@mansueli

Description

@mansueli

Bug report

Describe the bug

Inserting silently fails with no reason for large inputs.

To Reproduce

Set up:

  1. Create this table:
create table saved_pages (
  id uuid not null primary key default uuid_generate_v4(),
  created_at timestamp with time zone default timezone('utc'::text, now()) not null,
  archived boolean not null default false,
  url text not null,
  html jsonb not null,
  title text not null,
  authors text not null,
  reading_time int,
  published_at timestamp
);

  1. Go to https://www.youtube.com/watch?v=LVxL_p_kToc
  2. Define the variable: const data_html = JSON.stringify({ data: document.documentElement.innerHTML})
  3. Make the following call:
const data_html `{"data":"<head>\x3Cscript data-original-src=\\"/s/player/ace4(....)`
const table_data = {
  url: "http://example.org",
  html: JSON.stringify(data_html),
  title: "Test",
  authors: "Person",
  reading_time: 6,
  published_at: new Date().toISOString()
  }

const { data: response, error } = await supabase.from("saved_pages").insert(table_data, {count:null});

Expected behavior

If it is not possible to use a JSON of roughly 5mb, then there should be a limitation specified in postgREST about this limitation.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS
  • Version of supabase-js: 2.12.1
  • Version of Node.js: v19.8.1

Additional context

It is possible to insert these directly by changing the format to HTML and changing the raw format to accept HTML, but not possible to insert this as a JSONB object within a table.
https://postgrest.org/en/stable/configuration.html?#raw-media-types

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpostgrest-patch-neededRequires a change on PostgREST

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions