I l @ ve RuBoard |
Numeric data types store a variety of number-related data. The 7.X series of releases has brought some changes to this area. Namely, PostgreSQL now uses a more descriptive naming convention for number- related data types (for example, BIGINT versus INT8 ). Recently, some data types have become deprecated over the last few releases. For instance, use of the MONEY data type is no longer encouraged; instead, it is preferential to use the DECIMAL data type. BIGINT (or INT8 )DescriptionHolds a very large integer. InputsLarge integer (approximately 1 x 10^18 ) Storage Size8 bytes NotesVersions of PostgreSQL before 7.1 might refer to this data type as INT8 . DECIMAL (or NUMERIC )DescriptionHolds a number of user -defined length with a decimal-width specification. Inputs(x,y) x ”Total length. y ”Decimal width. Storage Size8 bytes NotesVersions of PostgreSQL before 7.1 might refer to this data type as NUMERIC. DOUBLE PRECISION (or FLOAT8 )DescriptionHolds a large floating-point number. InputsVariable precision ”15 decimal places. Storage Size8 bytes NotesVersions of PostgreSQL before 7.1 might refer to this data type as FLOAT8. INTEGER (or INT4 )DescriptionHolds an integer. InputsRange from -2,147,483,648 to +2,147,483,648 Storage Size4 bytes NotesVersions of PostgreSQL before 7.1 might refer to this data type as INT4. REAL (or FLOAT4 )DescriptionHolds a standard floating-point number. InputsVariable precision up to six decimal places. Storage Size4 bytes NotesVersions of PostgreSQL before 7.1 might refer to this data type as FLOAT4. SERIALDescriptionHolds an integer and is used for auto-increment fields. InputsRange from to + 2,147,483,647 Storage Size4 bytes NotesThe SERIAL data type is actually just a standard INTEGER type with some additional features: The SERIAL data type is an INTEGER with an automatically created SEQUENCE and INDEX on the specified column. When a table containing a SERIAL type is dropped, the associated SEQUENCE must also be explicitly dropped ”it does not occur automatically. SMALLINT (or INT2 )DescriptionHolds a small integer. InputsRange from -32,768 to +32,768 Storage Size2 bytes NotesVersions of PostgreSQL before 7.1 might refer to this data type as INT2. |
I l @ ve RuBoard |