# relation "pet" does not exist / no such table: pet

Source: https://sqlstreak.com/sql/errors/relation-does-not-exist · Tested on PostgreSQL 18.6 and SQLite 3.54.1; results generated 2026-11-22.


**Short answer:** The database can't find a table with that exact name in the schemas it searches. Usually it's a typo or singular/plural mix-up, a table created with quoted capitals, or a table that lives in another schema.

## The exact messages

- PostgreSQL: `ERROR: relation "pet" does not exist`
- SQLite: `no such table: pet`

## How PostgreSQL prints it

```
ERROR:  relation "pet" does not exist
LINE 1: SELECT * FROM pet;
                      ^
```

## Why it happens

### Typo or singular vs plural

`pet` vs `pets`. Check the real name: in PostgreSQL run `\dt` in psql, in SQLite run `.tables`.

### Quoted capitals

A table created as `"Pets"` must always be written `"Pets"`. Unquoted names are folded to lowercase in PostgreSQL.

### A different schema

PostgreSQL only searches the schemas in `search_path` (usually `public`). Use `schema_name.table_name` or update the search path.

### Wrong database or uncommitted table

You may be connected to a different database, or the CREATE TABLE ran in a transaction that was rolled back.

## The broken query

```sql
SELECT * FROM pet;
```

## The fix

```sql
SELECT * FROM pets;
```

Use the exact table name. When in doubt, list the tables first.

| id | name | species | breed | age | weight_kg | adopted | arrived_on |
| --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | Biscuit | dog | Beagle | 3 | 11.2 | false | 2026-01-14 |
| 2 | Mochi | cat | Siamese | 2 | 4.1 | true | 2025-11-02 |
| 3 | Pickles | dog | NULL | 7 | 24.5 | false | 2025-09-21 |
| 4 | Luna | cat | NULL | 5 | 3.8 | false | 2026-02-03 |
| 5 | Waffles | rabbit | Holland Lop | 1 | 1.6 | true | 2026-03-11 |
| 6 | Bruno | dog | Boxer | 9 | 30.1 | false | 2025-06-30 |

(6 of 20 rows)
