Skip to content

added postgrest error codes - #42369

Merged
ChrisChinchilla merged 9 commits into
masterfrom
postgrest_error_codes
Feb 2, 2026
Merged

ChrisChinchilla merged 9 commits into
masterfrom
postgrest_error_codes

Conversation

@TheOtherBrian1

@TheOtherBrian1 TheOtherBrian1 commented Feb 2, 2026 •

Copy link
Copy Markdown
Contributor

I have read the CONTRIBUTING.md file.

YES

What kind of change does this PR introduce?

docs update

What is the new behavior?

Adds PostgREST mirror codes

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive PostgREST Error Codes guide covering database- and API-level errors, HTTP status mappings, JSON examples, SQL query samples, and log-analysis/debugging tips.
    • Updated REST API Guides navigation to include the new Error Codes documentation link.
  • Style
    • Expanded spelling allow-list to include "Grantor" (case variant) and "SQL".

@supabase

supabase Bot commented Feb 2, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Feb 2, 2026
@vercel

vercel Bot commented Feb 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment Feb 2, 2026 11:37pm
docs Ready Ready Preview, Comment Feb 2, 2026 11:37pm
studio-self-hosted Ready Ready Preview, Comment Feb 2, 2026 11:37pm
studio-staging Ready Ready Preview, Comment Feb 2, 2026 11:37pm
ui-library Ready Ready Preview, Comment Feb 2, 2026 11:37pm
zone-www-dot-com Ready Ready Preview, Comment Feb 2, 2026 11:37pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
cms Ignored Ignored Feb 2, 2026 11:37pm
studio Ignored Ignored Feb 2, 2026 11:37pm

Request Review

@coderabbitai

coderabbitai Bot commented Feb 2, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Adds a new PostgREST error codes documentation page and a navigation entry at /guides/api/rest/postgrest-error-codes, and updates the spelling allow-list to include SQL, [Gg]rantor, and a [Ss]avepoint-style entry.

Changes

Cohort / File(s) Summary
Navigation Menu
apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
Appended a new "Error Codes" navigation entry under REST API Guides referencing /guides/api/rest/postgrest-error-codes.
Documentation Content
apps/docs/content/guides/api/rest/postgrest-error-codes.mdx
Added a comprehensive PostgREST error codes guide (front matter, JSON example, database→HTTP mappings, API-level error categories, log/query examples, viewing/debugging guidance, external references, and version note).
Lint Allow-list
supa-mdx-lint/Rule003Spelling.toml
Expanded the spelling allow_list with SQL, [Gg]rantor, and an entry alongside SaaS for [Ss]avepoint-style spelling.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'added postgrest error codes' directly and clearly summarizes the main change: adding documentation for PostgREST error codes.
Description check ✅ Passed The PR description follows the required template with all sections completed, though 'Adds PostgREST mirror codes' is somewhat vague about the full scope of documentation added.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch postgrest_error_codes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In `@apps/docs/content/guides/api/rest/postgrest-error-codes.mdx`:
- Line 203: Change the Markdown heading "Find specific API Error" to sentence
case and correct any spelling issues flagged by the docs linter (e.g., "Find
specific API error"); update the identical heading occurrence elsewhere in the
file to match the corrected sentence case so it passes Rule001HeadingCase and
spelling checks.
- Line 146: Replace the absolute dashboard link
"https://supabase.com/dashboard/project/_/logs/explorer" in the sentence
starting "One can filter for API errors in the [log explorer]" with a relative
dashboard URL (e.g. "/dashboard/project/_/logs/explorer") so the docs satisfy
Rule006NoAbsoluteUrls; update the link target in the same phrase to use the
relative path and ensure link text "[log explorer]" remains unchanged.
- Around line 9-12: The Admonition blocks (e.g., <Admonition type="note"> ...
</Admonition>) lack the required blank lines inside the tags; update each
Admonition so there is an empty line after the opening tag and an empty line
before the closing tag (for the shown block and the other occurrences around the
197-201 area) to satisfy docs_lint — locate the <Admonition type="note"> blocks
and insert a single blank line between the tag and its content and another blank
line before </Admonition>.
- Around line 1-7: The new MDX file for the guide (frontmatter id
'postgrest-error-codes', title 'Error Codes') is not formatted to project
Prettier rules; run the project's Prettier formatter on this file (e.g.,
prettier --write) after applying any lint fixes so the frontmatter and content
are normalized, then re-stage and commit the formatted file.
- Around line 35-55: Replace the term "PostgreSQL" with "Postgres" and normalize
the table wording to satisfy docs lint: update "pg connection err" to "Postgres
connection error", "read only sql transaction" to "read-only SQL transaction",
"invalid auth specification" to "invalid authentication specification", "obj not
in prerequisite state" to "object not in prerequisite state", and fix any other
informal or misspelled phrases (e.g., ensure "uniqueness violation", "foreign
key violation", "triggered action exception", "operator intervention", etc.) so
entries use proper capitalization and spelling consistent with the rest of the
docs.

TheOtherBrian1 and others added 6 commits February 2, 2026 07:06
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@apps/docs/content/guides/api/rest/postgrest-error-codes.mdx`:
- Around line 1-7: The MDX frontmatter for document id 'postgrest-error-codes'
(title 'Error Codes') is failing Prettier; run prettier --write on this file
(apps/docs/content/guides/api/rest/postgrest-error-codes.mdx) to apply the
project's formatting rules, then commit the updated file; ensure the frontmatter
remains valid YAML and the file ends with a newline so Prettier passes.
- Around line 90-91: Fix spacing in the two table rows for error codes PGRST101
and PGRST102: update the PGRST101 description to include spaces around "and" in
the inline code fragment (make it `GET` and `POST`) and update the PGRST102
description to add a space after "sent" (change "sent(e.g." to "sent (e.g.").
Ensure only whitespace is changed and the surrounding table formatting remains
intact.

@ChrisChinchilla ChrisChinchilla left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed up linter stuff

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@apps/docs/content/guides/api/rest/postgrest-error-codes.mdx`:
- Around line 101-103: Update the three table rows for PGRST116, PGRST117 and
PGRST118 to correct the typos: change "where" to "were" in the PGRST116
description and change "in" to "is" in the PGRST117 description (so it reads "is
not supported"); ensure PGRST118 remains unchanged except for any incidental
spacing fixes. Locate the lines containing the symbols PGRST116, PGRST117, and
PGRST118 and apply these exact word replacements in their description strings.
- Around line 31-35: Change the heading "Database level errors" to
"Database-level errors" (hyphenate the compound) and ensure the word "markdown"
in the following sentence is capitalized as "Markdown"; update the text under
the header that references "Postgres Error Docs" or "Here's the text formatted
as a proper markdown table:" to use "Markdown" and confirm any other occurrences
of "database level" are similarly hyphenated (locate the header and sentences in
this file by the header text "Database level errors" and the phrase "proper
markdown table").
- Around line 74-86: Fix the two intro lines' grammar: change "Errors that
prevent that data API from interacting with Postgres" to "Errors that prevent
the data API from interacting with Postgres." and change "API requests"
(heading) or the following line "Errors with data structures or request
formatting" to ensure a consistent heading and sentence punctuation — e.g., keep
"API requests" as a heading and make the sentence "Errors with data structures
or request formatting." include the terminal period; update the strings shown
("Errors that prevent that data API from interacting with Postgres", "API
requests", "Errors with data structures or request formatting") accordingly.
🧹 Nitpick comments (1)
supa-mdx-lint/Rule003Spelling.toml (1)

73-73: Consider removing the redundant SQL allow-list entry.

[A-Z]{2,5}s? already matches SQL, so the explicit SQL entry is optional and can be removed to keep the list concise.

♻️ Suggested cleanup
-    "SQL",

Also applies to: 304-306

Comment on lines +31 to +35
## Database level errors

To understand the errors reference the [Postgres Error Docs](https://www.postgresql.org/docs/current/errcodes-appendix.html).

Here's the text formatted as a proper markdown table:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Hyphenate the compound and capitalize the proper noun.

Use “Database-level” and “Markdown” for standard style.

✏️ Suggested edit
-## Database level errors
+## Database-level errors
@@
-Here's the text formatted as a proper markdown table:
+Here's the text formatted as a proper Markdown table:
🧰 Tools
🪛 LanguageTool

[grammar] ~31-~31: Use a hyphen to join words.
Context: ...des and their descriptions: ## Database level errors To understand the errors r...

(QB_NEW_EN_HYPHEN)


[uncategorized] ~35-~35: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ... Here's the text formatted as a proper markdown table: | Postgres error code(s) | HTTP...

(MARKDOWN_NNP)

🤖 Prompt for AI Agents
In `@apps/docs/content/guides/api/rest/postgrest-error-codes.mdx` around lines 31
- 35, Change the heading "Database level errors" to "Database-level errors"
(hyphenate the compound) and ensure the word "markdown" in the following
sentence is capitalized as "Markdown"; update the text under the header that
references "Postgres Error Docs" or "Here's the text formatted as a proper
markdown table:" to use "Markdown" and confirm any other occurrences of
"database level" are similarly hyphenated (locate the header and sentences in
this file by the header text "Database level errors" and the phrase "proper
markdown table").

Comment on lines +74 to +86
Errors that prevent that data API from interacting with Postgres.

| Code | HTTP status | Description |
| -------- | ----------- | --------------------------------------------------------------------------------------------------------------------- |
| PGRST000 | 503 | Could not connect with the database due to an incorrect connection string or due to the Postgres service not running. |
| PGRST001 | 503 | Could not connect with the database due to an internal error. |
| PGRST002 | 503 | Could not connect with the database when building the schema cache |
| PGRST003 | 504 | The request timed out waiting for a connection from PostgREST's internal pool |

### API requests

Errors with data structures or request formatting

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Tighten grammar in the section intros.

Two sentences are missing an article/terminal punctuation.

✏️ Suggested edit
-Errors that prevent that data API from interacting with Postgres.
+Errors that prevent the data API from interacting with Postgres.
@@
-Errors with data structures or request formatting
+Errors with data structures or request formatting.
🧰 Tools
🪛 LanguageTool

[style] ~79-~79: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...t running. | | PGRST001 | 503 | Could not connect with the database due to an int...

(REP_COULD_NOT)


[style] ~80-~80: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ... | | PGRST002 | 503 | Could not connect with the database when building...

(REP_COULD_NOT)

🤖 Prompt for AI Agents
In `@apps/docs/content/guides/api/rest/postgrest-error-codes.mdx` around lines 74
- 86, Fix the two intro lines' grammar: change "Errors that prevent that data
API from interacting with Postgres" to "Errors that prevent the data API from
interacting with Postgres." and change "API requests" (heading) or the following
line "Errors with data structures or request formatting" to ensure a consistent
heading and sentence punctuation — e.g., keep "API requests" as a heading and
make the sentence "Errors with data structures or request formatting." include
the terminal period; update the strings shown ("Errors that prevent that data
API from interacting with Postgres", "API requests", "Errors with data
structures or request formatting") accordingly.

Comment on lines +101 to +103
| PGRST116 | 406 | More than 1 or no items where returned when requesting a singular response. |
| PGRST117 | 405 | The HTTP verb used in the request in not supported. |
| PGRST118 | 400 | Could not order the result using the related table because there is no many-to-one or one-to-one relationship between them. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix grammar in the API requests table.

“where” → “were” and “in” → “is”.

✏️ Suggested edit
-| PGRST116 | 406         | More than 1 or no items where returned when requesting a singular response.                                                 |
-| PGRST117 | 405         | The HTTP verb used in the request in not supported.                                                                         |
+| PGRST116 | 406         | More than 1 or no items were returned when requesting a singular response.                                                 |
+| PGRST117 | 405         | The HTTP verb used in the request is not supported.                                                                         |
🤖 Prompt for AI Agents
In `@apps/docs/content/guides/api/rest/postgrest-error-codes.mdx` around lines 101
- 103, Update the three table rows for PGRST116, PGRST117 and PGRST118 to
correct the typos: change "where" to "were" in the PGRST116 description and
change "in" to "is" in the PGRST117 description (so it reads "is not
supported"); ensure PGRST118 remains unchanged except for any incidental spacing
fixes. Locate the lines containing the symbols PGRST116, PGRST117, and PGRST118
and apply these exact word replacements in their description strings.

@ChrisChinchilla
ChrisChinchilla merged commit 64b2c52 into master Feb 2, 2026
13 checks passed
@ChrisChinchilla
ChrisChinchilla deleted the postgrest_error_codes branch February 2, 2026 23:50
@github-actions

github-actions Bot commented Feb 2, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1770076313)

Score Average Improvements Regressions
Completeness 83.3% (-8pp) 1 🟢 2 🔴
Conciseness 0% (+0pp) - -
Goal Completion 87.5% (-4pp) 1 🟢 2 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Tool Usage 100% (+9pp) 1 🟢 -
Docs Faithfulness 42.9% (-15pp) - 1 🔴
Correctness 75% (-25pp) - 1 🔴
URL Validity 75% (-25pp) - -
Time_to_first_token 0.13tok (-0.03tok) 7 🟢 5 🔴
Llm_calls 8.75 (+0.33) 4 🟢 3 🔴
Tool_calls 3.42 (+0.25) 4 🟢 3 🔴
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 116742.5tok (+9349.33tok) 6 🟢 6 🔴
Prompt_cached_tokens 62506.67tok (+13781.33tok) 4 🟢 3 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 5623.5tok (+129.67tok) 5 🟢 7 🔴
Completion_reasoning_tokens 4160tok (+224tok) 5 🟢 7 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 122366tok (+9479tok) 5 🟢 7 🔴
Estimated_cost 0.03$ (0$) 4 🟢 8 🔴
Duration 53.47s (+9.09s) 3 🟢 9 🔴
Llm_duration 106s (+18.27s) 3 🟢 9 🔴

@coderabbitai coderabbitai Bot mentioned this pull request Feb 3, 2026
awaseem pushed a commit that referenced this pull request Feb 3, 2026
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

docs update

## What is the new behavior?

Adds PostgREST mirror codes



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Added a comprehensive PostgREST Error Codes guide covering database-
and API-level errors, HTTP status mappings, JSON examples, SQL query
samples, and log-analysis/debugging tips.
* Updated REST API Guides navigation to include the new Error Codes
documentation link.
* **Style**
* Expanded spelling allow-list to include "Grantor" (case variant) and
"SQL".
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Chris Chinchilla <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants