Fixed tinyint for PostgreSQL in a more generic way