zoukankan      html  css  js  c++  java
  • C# 数据类型与PostgreSQL 数据类型映射

    Npgsql 是基于ADO.NET 的PostgreSQL 数据驱动。

    Npgsql 官方 已经提供C# 数据类型与PostgreSQL数据类型的对应映射

    地址: http://www.npgsql.org/doc/types.html

    Type mappings

    Type mappings when reading values sent from the backend

    PostgreSQL typeDefault .NET typeProvider-specific typeOther .NET types
    bool bool    
    int2 short   byte, sbyte, int, long, float, double, decimal, string
    int4 int   byte, short, long, float, double, decimal, string
    int8 long   long, byte, short, int, float, double, decimal, string
    float4 float   double
    float8 double    
    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
    lseg 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 DateTimeOffset
    time TimeSpan    
    timetz DateTimeOffset   DateTimeOffset, DateTime, TimeSpan
    bytea byte[]    
    oid uint    
    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)    

                  有需要的朋友可以去看看。

  • 相关阅读:
    QPS、PV和需要部署机器数量计算公式
    libevent 源码深度剖析十三
    libevent源码深度剖析十二
    libevent源码深度剖析十一
    libevent源码深度剖析十
    libevent源码深度剖析九
    libevent源码深度剖析八
    ADO.NET入门教程(三) 连接字符串,你小觑了吗?
    配置文件的使用,如果要跨平台,建议直接用 xml, json, ini 或者本文档,看自己方便
    firemonkey 去掉ios 虚拟键盘上的‘done’toolbar
  • 原文地址:https://www.cnblogs.com/yunfeng83/p/5265782.html
Copyright © 2011-2022 走看看