

BIGINT is usually chosen when INTEGER’s range is too small for the purpose. The INTEGER data type is more commonly used, as it offers a better balance between range, storage size, and performance. The difference is the range of numbers allowed to be stored in each type: Data type The difference is the range of numbers allowed to be stored in each type: Numerical Data Types in PostgreSQLīoth INTEGER and BIGINT data types are used to store whole numbers in PostgreSQL. BIGINTīoth INTEGER and BIGINT data types are used to store whole numbers in PostgreSQL. Let’s see how the numbers are managed in PostgreSQL. The world of numbers is very vast thus, there is a need to store different numbers, like whole numbers or rational numbers, in different data types. To store data like salaries, prices, quantities, or ID numbers, we use numerical data types. For each of the presented data types, we’ll examine its syntax, storage size, and use cases. We’ll start with numerical data types and work our way through the text data types, date and time data types, BOOLEAN data types, and beyond. In this article, I’ll focus on one of Postgres’ basic (but crucial) features: data types. It contains over 800 exercises and covers the basic, intermediate, and advanced topics of SQL in PostgreSQL. If you're looking for comprehensive SQL course in PostgreSQL, I recommend the interactive SQL from A to Z in PostgreSQL learning path. It is SQL-compliant, extensible, and includes all standard relational database features, such as database constraints, transactions, views, triggers, stored procedures, and more. PostgreSQL, also called Postgres, is a well-known open-source object-relational database management system (DBMS). In this article, we’ll go through the most common data types used in PostgreSQL. Read on to see which data type suits which use case! There are numerous PostgreSQL data types across various categories. That’s why every column has its data type. It’s vital to know what you actually store in your database.
