PostgreSQLMySQL相容性之-數字型別
TINYINT
MySQL
TINYINT[(M)] [UNSIGNED] [ZEROFILL]
A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255.
PostgreSQL
TINYINT 對應 PostgreSQL
postgres=# create domain tinyint as smallint constraint ck check (value between -127 and 128);
CREATE DOMAIN
TINYINT [UNSIGNED] 對應 PostgreSQL
postgres=# create domain utinyint as smallint constraint ck check (value between 0 and 255);
CREATE DOMAIN
boolean
MySQL
boolean
PostgreSQL
boolean
SMALLINT
MySQL
SMALLINT[(M)] [UNSIGNED] [ZEROFILL]
A small integer. The signed range is -32768 to 32767. The unsigned range is 0 to 65535.
PostgreSQL
SMALLINT[(M)] 對應 PostgreSQL
smallint
SMALLINT[(M)] [UNSIGNED] 對應 PostgreSQL
postgres=# create domain usmallint as int constraint ck check (value between 0 and 65535);
CREATE DOMAIN
MEDIUMINT
MySQL
MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]
The signed range is -8388608 to 8388607. The unsigned range is 0 to 16777215.
PostgreSQL
MEDIUMINT[(M)] 對應 PostgreSQL
postgres=# create domain MEDIUMINT as int constraint ck check (value between -8388608 and 8388607);
CREATE DOMAIN
MEDIUMINT[(M)] [UNSIGNED] 對應 PostgreSQL
postgres=# create domain UMEDIUMINT as int constraint ck check (value between 0 and 16777215);
CREATE DOMAIN
INT
MySQL
INT[(M)] [UNSIGNED]
INTEGER[(M)] [UNSIGNED] [ZEROFILL]
When marked UNSIGNED, it ranges from 0 to 4294967295, otherwise its range is -2147483648 to 2147483647 (SIGNED is the default).
PostgreSQL
INT[(M)] INTEGER[(M)] 對應 PostgreSQL
INT
INT[(M)] [UNSIGNED] 對應 PostgreSQL
INTEGER[(M)] [UNSIGNED] 對應 PostgreSQL
postgres=# create domain UINT as int8 constraint ck check (value between 0 and 4294967295);
CREATE DOMAIN
BIGINT
MySQL
BIGINT[(M)] [UNSIGNED] [ZEROFILL]
The signed range is -9223372036854775808 to 9223372036854775807. The unsigned range is 0 to 18446744073709551615.
PostgreSQL
BIGINT[(M)] 對應 PostgreSQL
BIGINT
BIGINT[(M)] [UNSIGNED] 對應 PostgreSQL
postgres=# create domain UBIGINT as numeric(20,0) constraint ck check (value between 0 and 18446744073709551615);
CREATE DOMAIN
decimal, dec, numeric, fixed
MySQL
DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]
DEC[(M[,D])] [UNSIGNED] [ZEROFILL]
NUMERIC[(M[,D])] [UNSIGNED] [ZEROFILL]
FIXED[(M[,D])] [UNSIGNED] [ZEROFILL]
PostgreSQL
DECIMAL[(M[,D])] 對應 PostgreSQL
decimal[(M[,D])]
DECIMAL[(M[,D])] [UNSIGNED] 對應 PostgreSQL
postgres=# create domain udecimal as numeric constraint ck check (value >=0);
CREATE DOMAIN
# 不能改domain的scale,precise.
FLOAT
MySQL
FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]
PostgreSQL
FLOAT[(M,D)] 對應 PostgreSQL
float4
FLOAT[(M,D)] [UNSIGNED] 對應 PostgreSQL
postgres=# create domain ufloat4 as float4 constraint ck check (value >=0);
CREATE DOMAIN
# 不能改domain的scale,precise.
DOUBLE
MySQL
DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]
DOUBLE PRECISION[(M,D)] [UNSIGNED] [ZEROFILL]
REAL[(M,D)] [UNSIGNED] [ZEROFILL]
PostgreSQL
DOUBLE[(M,D)]
DOUBLE PRECISION[(M,D)]
REAL[(M,D)] 對應 PostgreSQL
float8
DOUBLE[(M,D)] [UNSIGNED]
DOUBLE PRECISION[(M,D)] [UNSIGNED]
REAL[(M,D)] [UNSIGNED] 對應 PostgreSQL
postgres=# create domain ufloat8 as float8 constraint ck check (value >=0);
CREATE DOMAIN
# 不能改domain的scale,precise.
bit
MySQL
BIT[(M)]
A bit-field type. M indicates the number of bits per value, from 1 to 64. The default is 1 if M is omitted.
PostgreSQL
BIT[(M)]
相關文章
- PostgreSQLMySQL相容性之-Gis型別MySql型別
- PostgreSQLMySQL相容性之-時間型別MySql型別
- 數字型別型別
- javascript型別系統——Number數字型別JavaScript型別
- Python數字型別有哪些Python型別
- java中數字型別轉換Java型別
- Python基礎(01):數字型別Python型別
- 表單填寫數字型別驗證型別
- javaScript中Number數字型別方法入門JavaScript型別
- 數字型別的不正確轉換漏洞型別
- 【BBED】使用bbed修改數字型別資料型別
- Java下數字型別的轉換 (轉)Java型別
- 正規表示式數字數字型別驗證程式碼型別
- lodash裡to系列之將資料轉換成數字型別實現示例詳解型別
- 字串:怎樣轉換字串為數字型別? (轉)字串型別
- js判斷變數是不是數字型別程式碼例項JS變數型別
- CSS 字型新玩法之彩色字型CSS
- Oracle基本資料型別儲存格式淺析(二)——數字型別Oracle資料型別
- python數字型別是什麼?主要包括幾種?Python型別
- 字串:怎樣將數字型別轉換為字串 (轉)字串型別
- 利用符號進行的型別轉換,轉換成數字型別 ~~符號型別
- PostgreSQLOracle相容性之NUMTODSINTERVALSQLOracle
- Web字型格式介紹及瀏覽器相容性一覽Web瀏覽器
- Python程式哪幾部分組成?包含哪些數字型別?Python型別
- MySQL數字型別int與tinyint、float與decimal如何選擇MySql型別Decimal
- SQL隱碼攻擊之字元型和數字型注入SQL字元
- lodash原始碼分析之資料型別獲取的相容性原始碼資料型別
- ORACLE 數字型別(number)的值長時,科學計數顯示問題Oracle型別
- PostgreSQLOracle相容性之-roundintervalSQLOracle
- input,select, v-model 繫結的值為數字型別型別
- 關於mysql字元和數字型別轉換的問題研究MySql字元型別
- 《從零開始學Swift》學習筆記(Day 15)——請注意數字型別之間的轉換Swift筆記型別
- 學習Pytorch+Python之MNIST手寫字型識別PyTorchPython
- Ubuntu 字型美化之安裝蘋果麗黑字型 LiHeiUbuntu蘋果
- Mysql 資料型別之整數型別MySQL 資料型別
- 深入Go語言文字型別Go型別
- 「Adobe國際認證」字型與字型有區別嗎?字型區別的真正“奧義”秘籍,你掌握了嗎!
- PostgreSQLOracle相容性-Analysis函式之keepSQLOracle函式