标签
PostgreSQL , ms sql , SQL Server , 类型映射
https://github.com/digoal/blog/blob/master/201808/20180818_03.md#%E8%83%8C%E6%99%AF 背景
PostgreSQL与SQL Server的类型映射:
1、常用类型映射
https://www.codeproject.com/tips/1068276/convert-sql-server-database-to-postgresqlchar char / text
nchar char / text
varchar varchar / text
nvarchar varchar / text
xml xml
int integer
bigint bigint
bit boolean
uniqueidentifier uuid
hierarchyid bytea
geography geography
tinyint smallint
float float
real real
double double precision
numeric numeric
decimal numeric
money numeric
smallmoney numeric
binary bytea
varbinary bytea
image bytea
datetime timestamptz
datetime2 timestamptz
2、所有类型映射请参考手册
2.1、SQL Server 官方类型手册
https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-types-transact-sql?view=sql-server-20162.2、PostgreSQL 官方类型手册
https://www.postgresql.org/docs/devel/static/datatype.html2.3、空间类型通过新建PostGIS插件,与SQL Server geometry, geography对应。
2.4、SQL Server , PostgreSQL , Oracle , MySQL 详细的开发者使用对比手册
https://www.w3resource.com/sql/sql-syntax.phphttps://github.com/digoal/blog/blob/master/201808/20180818_03.md#%E5%8F%82%E8%80%83 参考
https://github.com/dalibo/sqlserver2pgsql https://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#Microsoft_SQL_Server https://wiki.postgresql.org/wiki/Microsoft_SQL_Server_to_PostgreSQL_Migration_by_Ian_Harding http://www.postgresonline.com/journal/index.php?/archives/219-SQL-Server-to-PostgreSQL-Converting-table-structure.htmlSQL Server 官方类型手册
PostgreSQL 官方类型手册
空间类型通过新建PostGIS插件,与SQL Server geometry, geography对应。
SQL Server , PostgreSQL , Oracle , MySQL 详细的开发者使用对比手册