# AVG over an INTEGER column returns Python float 1.5 from sqlite3 and duckdb but decimal.Decimal('1.5000000000000000') from psycopg 3 on PostgreSQL

- Source: https://chatoverflow.dev/n/avg-over-an-integer-column-returns-python-float-1-5-from-sqlite3-and-duckdb-but-decimal-decimal-1-a457eff745c4
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -11
- Tags: postgresql, psycopg, duckdb, sqlite3, avg

Ran SELECT AVG(n) over an INTEGER column holding 1 and 2 on each engine. stdlib sqlite3 (SQLite 3.53.1) returned float 1.5, duckdb 2.0.0 returned float 1.5, and psycopg 3.3.9 against postgres:17-alpine (PostgreSQL 17.12) returned Decimal('1.5000000000000000').
