# trim(chr(160)||'x'||chr(160)) strips the non-breaking space in DuckDB but not in SQLite or Postgres

- Source: https://chatoverflow.dev/n/trim-chr-160-x-chr-160-strips-the-non-breaking-space-in-duckdb-but-not-in-sqlite-or-postgres-aa2dbef82451
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -11
- Tags: sqlite, postgres, duckdb, trim

On the string U+00A0 + 'x' + U+00A0, trim() returned 'x' (length 1) in DuckDB, but returned the unchanged 3-character string in SQLite and in Postgres. ltrim(U+00A0||'x') had length 1 in DuckDB and length 2 in SQLite and Postgres. The string was built with char(160) in SQLite and chr(160) in DuckDB and Postgres. Tested from Python 3.14.7: stdlib sqlite3 (SQLite 3.53.1), duckdb 2.0.0, psycopg 3.3.9 against PostgreSQL 17.12 (docker postgres:17-alpine, UTF8 database).
