我搜索了PostgreSQL和C#之间的类型转换表,但什么也找不到.

Postgre Type --->C# Type

bigint --->Int64

bigserial --->

bit [ (n) ] --->Byte[]

bit varying [ (n) ] --->Byte

boolean --->Boolean

box --->

bytea --->Byte[]

character varying [ (n) ] ---> String

character --->String

cidr

circle 

date --->DateTime

double precision --->Double

inet

integer --->Int32

interval [ (p) ] --->TimeSpan

line 

lseg 

macaddr

money

numeric [ (p, s) ] --->Decimal

decimal [ (p, s) ] --->Decimal

path  

point 

polygon 

real --->Single

smallint --->Int16

serial 

text --->String

time [ (p) ] [ without time zone ] --->

time [ (p) ] with time zone --->

timestamp [ (p) ] [ without time zone ] --->

timestamp [ (p) ] with time zone --->

tsquery 

tsvector 

txid_snapshot

uuid --->Guid

xml   

推荐答案

也许你可以通过查看

This page of the documentation实际上包含了一个完整的表格,里面有你要找的东西.搜索"4.当前Npgsql状态"-"支持的数据类型".这里有一个很好的表,其中包含所有PostgreSQL数据类型及其对应项.网

Postgresql  NpgsqlDbType System.DbType Enum .Net System Type
----------  ------------ ------------------ ----------------
int8        Bigint       Int64              Int64
bool        Boolean      Boolean            Boolean
bytea       Bytea        Binary             Byte[]
date        Date         Date               DateTime
float8      Double       Double             Double
int4        Integer      Int32              Int32
money       Money        Decimal            Decimal
numeric     Numeric      Decimal            Decimal
float4      Real         Single             Single
int2        Smallint     Int16              Int16
text        Text         String             String
time        Time         Time               DateTime
timetz      Time         Time               DateTime
timestamp   Timestamp    DateTime           DateTime
timestamptz TimestampTZ  DateTime           DateTime
interval    Interval     Object             TimeSpan
varchar     Varchar      String             String
inet        Inet         Object             IPAddress
bit         Bit          Boolean            Boolean
uuid        Uuid         Guid               Guid
array       Array        Object             Array

Postgresql相关问答推荐

横向联接返回的行数太多

锁定模式与PostgreSQL中的另一种锁定模式冲突到底是什么意思?

使用 pgx 扫描范围类型

@符号在yacc中的函数中是什么意思

对 Postgres 进行身份验证时如何使用自定义密码哈希算法?

如何在 postgresql 中创建一个空的 JSON 对象?

Heroku Rails 4 无法连接到服务器:connection refused

postgresql 更新错误ERROR: invalid input syntax for type boolean:

处理 sqlalchemy 断开连接的更好方法

Postgres/psycopg2 - 插入字符串数组

如何在 PostgreSQL 中截断日期?

在执行 postgresql 函数时提交事务

更详细地解释 JOIN 与 LEFT JOIN 和 WHERE 条件性能建议

无法登录 PostgreSQL 数据库

SQL Select 一列中具有重复值的所有行

在 postgres 中插入语句用于没有时区 NOT NULL 的数据类型时间戳,

错误:prepared statement "S_1" already exists

如何获取一个月的天数?

如何为 Postgresql 中的所有数据库创建具有只读权限的用户?

PostgreSQL 的EXPLAIN解释中的 width字段是什么意思?