# LIMIT #,# syntax is not supported (PostgreSQL)

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


**Short answer:** `LIMIT offset, count` is MySQL syntax that SQLite also accepts. PostgreSQL wants the standard form: `LIMIT 3 OFFSET 2` (three rows, after skipping two). That form works in SQLite too.

## The exact messages

- PostgreSQL: `ERROR: LIMIT #,# syntax is not supported`

## How PostgreSQL prints it

```
ERROR:  LIMIT #,# syntax is not supported
LINE 4: LIMIT 2, 3;
        ^
HINT:  Use separate LIMIT and OFFSET clauses.
```

## Why it happens

### A query written for MySQL or SQLite

Paging code often uses `LIMIT offset, count`. Swap it for `LIMIT count OFFSET offset`.

### The numbers read backwards

In `LIMIT 2, 3` the 2 is the offset. In `LIMIT 3 OFFSET 2` the order is explicit, which avoids a quiet off-by-one.

## The broken query

```sql
SELECT name
FROM pets
ORDER BY name
LIMIT 2, 3;
```

## The fix

```sql
SELECT name
FROM pets
ORDER BY name
LIMIT 3 OFFSET 2;
```

Skip two rows, return three. Same rows as SQLite's `LIMIT 2, 3`, in a form every database accepts.

| name |
| --- |
| Bruno |
| Clover |
| Gizmo |

## What SQLite does instead

SQLite accepts the MySQL-style `LIMIT 2, 3`, where the first number is the offset and the second the count. Easy to misread, and not portable.
