C#数据类型与PostgreSQL数据类型映射
Npgsql 是基于ADO 的PostgreSQL 数据驱动。
Npgsql 官⽅已经提供C# 数据类型与PostgreSQL数据类型的对应映射
Type mappings
学会放手Type mappings when reading values nt from the backend
PostgreSQL type Default type Provider-specific type Other types
bool bool
int2short byte, sbyte, int, long, float, double, decimal, string int4int byte, short, long, float, double, decimal, string
int8long long, byte, short, int, float, double, decimal, string float4float double
float8double
numeric decimal byte, short, int, long, float, double, string money decimal
text string char[]
varchar string char[]
挤公交车bpchar string char[]
citext string char[]
json string char[]
检查模板
jsonb string char[]
xml string char[]
point NpgsqlPoint string
出去玩作文lg NpgsqlLSeg string
path NpgsqlPath
polygon NpgsqlPolygon
体温枪图片
line NpgsqlLine string
circle NpgsqlCircle string
box NpgsqlBox string
bit(1)bool BitArray
bit(n)BitArray
varbit BitArray
hstore IDictionary<string, string>string
uuid Guid string
cidr NpgsqlInet string
inet IPAddress NpgsqlInet string
macaddr PhysicalAddress string
tsquery NpgsqlTsQuery
tsvector NpgsqlTsVector
date DateTime NpgsqlDate
interval TimeSpan NpgsqlTimeSpan
尼斯湖水怪之谜的真相timestamp DateTime NpgsqlDateTime
timestamptz DateTime NpgsqlDateTime DateTimeOfft
事事顺心time TimeSpan
高三励志语录
timetz DateTimeOfft DateTimeOfft, DateTime, TimeSpan
bytea byte[]
oid uint
PostgreSQL type Default type Provider-specific type Other types xid uint
cid uint
oidvector uint[]
name string char[]
(internal) char char byte, short, int, long
geometry (PostGIS)PostgisGeometry
record object[]
composite types T
range subtypes NpgsqlRange
enum types TEnum
array types Array (of child element type)
有需要的朋友可以去看看。