{
  "id": 10168534,
  "title": "pg_restore finished fine. One of my tables wasn't there.",
  "url": "https://urgent.news/2026/09/27/pg-restore-finished-fine-one-of-my-tables-wasnt-there",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-27T07:26:19.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/superlede/pgrestore-finished-fine-one-of-my-tables-wasnt-there-2kaj"
  },
  "original_language": "en",
  "account": "A recent restore test on a Supabase database with 105 tables failed due to a function with a parameter defaulting to auth.uid(). This issue was reproduced using the plain pg_restore command, which did not stop at the error, resulting in one table being missing. The setup involves creating a schema named 'auth' and a function named 'auth.uid()' that returns the id of the logged-in user, which is frequently used as a column default. When taking a backup using pg_dump and restoring it into a different database that does not have the 'auth' schema, pg_restore fails to create the 'public.notes' table. The table is not created, causing the subsequent COPY into operation to fail as well. As a result, only the other tables and their rows are restored, leaving out the 'notes' table. The error messages are present in the output but are often ignored as they seem to be specific to Supabase. To reproduce this issue, two containers are used, one pretending to be Supabase and the other as a regular PostgreSQL server. The database schema is modified to include roles anon, authenticated, and service_role, as well as schemas 'auth' and 'public', along with functions 'auth.uid()', 'auth.role()', 'auth.email()', and 'auth.jwt()' that return null values. After restoring the backup, the table 'public.notes' is found to be restored successfully with all 500 rows. The key to resolving this issue is to create the necessary stand-ins for what Supabase provides, such as the 'auth' schema and related functions, before restoring the backup. This ensures that the 'notes' table and other tables are created correctly during the restore process.",
  "summary": "A restore test on a real 105-table Supabase database failed a few weeks ago. The tool doing it restores in a strict mode, so it stopped on the first error: a function with a parameter defaulting to auth.uid() . Fixing that was quick. The interesting part came when I reproduced it locally with plain pg_restore , the way most people test a backup by hand. There it didn't stop at all. It ran to the…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}