#1123·chartdb

Serial and integer cannot form a relation in PostgreSQL

Author: DefaultLPCreated Apr 20, 2026Updated Apr 20, 2026

When I try to create a relation between a serial and an integer, an error message pops up saying that Relationships can only be created between compatible field types. From what I gathered, this seems to have been fixed in the past, but reappeared (#229).

I'm using the latest Docker version, but I also tried it on chartdb.io, with the same result. It is possible to create a reference when writing it in DBML, but that is rather inconvenient. From my testing, both bigserial/bigint and smallserial/smallint work. So this bug is specific to the serial/int relation.