Welcome! 登入 註冊
美寶首頁 美寶百科 美寶論壇 美寶落格 美寶地圖

Advanced

PostgreSQL的數值資料型態(Numeric Data Types)速查表

Posted by HP 
PostgreSQL的數值資料型態(Numeric Data Types)速查表

分類標籤: PostgreSQL
在設定 PostgreSQL 資料庫時經常會用到,節錄此表方便大家查詢:

NameStorage SizeDescriptionRange
smallint2 bytessmall-range integer-32768 to +32767
integer4 bytesusual choice for integer-2,147,483,648 to +2,147,483,647
bigint8 byteslarge-range integer-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
decimalvariableuser-specified precision, exactno limit
numericvariableuser-specified precision, exactno limit
real4 bytesvariable-precision, inexact6 decimal digits precision
double precision8 bytesvariable-precision, inexact15 decimal digits precision
serial4 bytesautoincrementing integer1 to 2147483647
bigserial8 byteslarge autoincrementing integer1 to 9223372036854775807


基本上常用的 integer 的大小是十億等級(2.1 billion),bigint (big integer) 是 92 萬兆(京)。

Reference:
http://www.postgresql.org/docs/8.3/static/datatype-numeric.html



Edited 2 time(s). Last edit at 02/11/2010 04:28PM by HP.
(編輯記錄)