Quality-of-life batch: common PostgreSQL features still missing on 1.1.0 (each with a minimal repro)
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 73
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 129
Description
**Version:** reproduced on `dolthub/doltgresql:1.1.0` and `1.0.0` (clean Docker container, empty database; latest run 2026-08-15).
All probes verified against `postgres:15` with identical SQL — every one works there.
Filed as one batch per earlier maintainer preference; happy to split.
(`ON CONFLICT ... EXCLUDED` is deliberately not in this list — it is already tracked
in #1258.)
## Implementation tracker
- [ ] `ILIKE`
- [ ] `LIKE … ESCAPE`
- [ ] Aggregate `FILTER` (for example, `COUNT(*) FILTER (...)`)
- [x] `COUNT(DISTINCT uuid)`
- [ ] `SET TRANSACTION` characteristics
- [ ] Data-modifying CTEs (`UPDATE ... RETURNING`)
- [ ] `ALTER TABLE ... ADD COLUMN IF NOT EXISTS`
- [x] Anonymous `DO` blocks
- [x] `json_agg`
- [ ] Aggregate `ORDER BY` (including `json_agg(... ORDER BY ...)`)
- [ ] `jsonb_set`
- [x] `to_json`
- [x] `convert_to`
- [x] `hashtext`
- [ ] Honor `COLLATE` in `ORDER BY`
Shared setup for the table-based repros (each error was observed against these
exact tables — the error column quotes the verbatim server output):
```sql
CREATE TABLE t_like (s text);
INSERT INTO t_like VALUES ('Hello'), ('50% off'), ('plain');
CREATE TABLE t_filter (v int);
INSERT INTO t_filter VALUES (1), (2), (3);
CREATE TABLE t_uuid (id uuid);
INSERT INTO t_uuid VALUES ('11111111-1111-1111-1111-111111111111'),
('11111111-1111-1111-1111-111111111111'), ('22222222-2222-2222-2222-222222222222');
CREATE TABLE t_cte (id int PRIMARY KEY, st text);
INSERT INTO t_cte VALUES (1, 'a'), (2, 'a'), (3, 'b');
CREATE TABLE t_ddl (id int);
CREATE TABLE t_json (name text);
INSERT INTO t_json VALUES ('alpha'), ('Beta');
CREATE TABLE t_collate (name text);
INSERT INTO t_collate VALUES ('alpha'), ('Beta');
```
| Feature | Repro (as executed) | DoltgreSQL 1.1.0 error |
|---|---|---|
| `ILIKE` | `SELECT count(*) FROM t_like WHERE s ILIKE 'hello';` | `ILIKE is not yet supported` |
| `LIKE … ESCAPE` | `SELECT count(*) FROM t_like WHERE s LIKE '50\%%' ESCAPE '\';` | `function: 'like_escape' not found` |
| `COUNT(*) FILTER` | `SELECT count(*) FILTER (WHERE v > 2) FROM t_filter;` | `function filters are not yet supported` |
| `COUNT(DISTINCT uuid)` | `SELECT count(DISTINCT id) FROM t_uuid;` | `incompatible conversion to SQL type: '11111111-…'->text` |
| `SET TRANSACTION` | `BEGIN; SET TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ ONLY;` | `SET TRANSACTION is not yet supported` — pg_dump issues this statement, so pg_dump-based tooling cannot get past it. (New on 1.1.0: the failed statement now also aborts the surrounding transaction, so the follow-up statements report `current transaction is aborted` and the block ends in ROLLBACK.) |
| CTE wrapping UPDATE | `WITH u AS (UPDATE t_cte SET st = 'done' WHERE st = 'a' RETURNING id) SELECT count(*) FROM u;` | `unsupported CTE statement type: *tree.Update` |
| `ADD COLUMN IF NOT EXISTS` | `ALTER TABLE t_ddl ADD COLUMN IF NOT EXISTS extra text;` | `IF NOT EXISTS on a column in an ADD COLUMN statement is not supported yet` |
| Anonymous `DO $$` block | `DO $$ BEGIN PERFORM 1; END $$;` | `at or near "do": syntax error` |
| `json_agg` | `SELECT json_agg(name) FROM t_json;` | `function: 'json_agg' not found` (note: `json_build_object` and `row_to_json` DO exist and work) |
| aggregate `ORDER BY` | `SELECT json_agg(name ORDER BY name) FROM t_json;` | `function ORDER BY is not yet supported` |
| `jsonb_set` | `SELECT jsonb_set('{"a":1}'::jsonb, '{a}', '2'::jsonb);` | `function: 'jsonb_set' not found` |
| `to_json` | `SELECT to_json('x'::text);` | `function: 'to_json' not found` |
| `convert_to` | `SELECT convert_to('x', 'UTF8');` | `function: 'convert_to' not found` |
| `hashtext` | `SELECT hashtext('abc');` | `function: 'hashtext' not found` (pairs naturally with advisory locks — standard way to key them off strings) |
| `COLLATE` honored in ORDER BY | `SELECT name FROM t_collate ORDER BY name COLLATE "da-DK-x-icu";` | accepted but silently sorts by codepoint (`Beta` before `alpha`); Postgres sorts linguistically (`alpha` before `Beta`) |
The last row is arguably its own correctness issue (silently wrong order rather than a
missing-feature error) — flagging it here for triage.
---
*Part of a clean-room deviation battery (fresh official Docker container + empty
database per probe, `postgres:15` control running identical probes). Filing the
findings together so they can be triaged/batched as a set — index in a comment on
#2600. Happy to re-test any of them against a nightly/branch build.*
Contributor guide
Research direction
Start by running the listed SQL probes against dolthub/doltgresql:1.1.0 and postgres:15, using the shared table setup and the implementation tracker. The issue names no source files or tests, so triage the unchecked features into separate tasks; done means each selected probe matches PostgreSQL behavior, including the COLLATE ordering case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go, postgresql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100