Fixes #3567: Fixed the bug that smallint was treated as string for PostgreSQL