In this overload first parameter is name of a collection, and second parameter is the array of restrictions to be applied when querying information. These restrictions specify which subset of the collection will be returned. The restrictions can include, for example, the database name (in this case, only collection elements belonging to this database will be returned) or the mask for the name of collection elements (only the elements satisfying this mask will be returned). The quantity and description of restrictions allowed for each metadata collection are represented in the table here. Their number can also be obtained from the return of the GetSchema() method. If the second parameter is null/Nothing, it is ignored.
Instead of specifying the metadata collection name as a string constant, you may use members of System.Data.DbMetaDataCollectionNames and Devart.Data.PostgreSql.PgSqlMetadataCollectionNames as the first GetSchema argument values. The members of these classes are the string fields, each field stores the corresponding metadata collection name. It is recommended to use these fields rather than manually input the collection names manually as the string constants because in case of using these fields, you will find misspellings at compile-time, and intellisense will show you all the available metadata collection names.
GetSchema Method Reference
GetSchema supports two kinds of wildcards: "%" and "_". These special characters behave exactly as in LIKE operator. "%" means zero or more of any characters, "_" means any single character.
When calling the GetSchema method, you can pass all or few of restrictions, applicable to the chosen collection. In the latter case, you have to put "%" wildcard in the place of omitted restriction, if it must be specified before the restriction you want to apply. For example, GetSchema("Casts", new string[] { "%", "%", "date" }) returns list of all casts to type "date". Or, suppose you want to query all functions within a certain schema: GetSchema("Functions", new string[] { "%", "public" }) returns list of all functions in schema public. Note that this collection may accept 8 restrictions, however, you do not need to specify all of them.
The following table provides detailed information on metadata collections that can be retrieved using the GetSchema method, and restrictions that can be applied for them. Some collections may be not supported in older server versions. If you try to get metadata for unsupported collection you will get exception with message "Collection not defined".
Collection Name
Number of restrictions
Remarks
MetaDataCollections 0
Returns this list. Same as using GetSchema() method without parameters.
ReservedWords 0
Lists all reserved words used in the server.
AggregateFunctions 2
GetSchema("AggregateFunctions") returns detailed list of all aggregate functions on the server.
  • The first restriction for this collection is a name of a function. If specified, the method returns all overloads with given name.
  • The second restriction is name of function definer. For example, you can issue "%" as the first restriction, and "postgres" as the second one, to obtain list of functions defined by user "postgres".
Arguments 5
GetSchema("AggregateFunctions") returns the list of the function arguments. The following restrictions may be specified:
  • Schema name
  • Function name
  • User name
  • Type
  • Function OID (for overload functions)
Casts 3
GetSchema("Casts") returns list of casts available on the server.
  • The first restriction for this collection is namespace of a cast.
  • The second restriction is source type for the cast.
  • The third restriction is target type for the cast.
Columns 3
Returns list of columns, their schema, table, type, and some extra information.
  • Restricted by schema name, GetSchema returns columns of all tables within the schema.
  • The second restriction is name of a table that GetSchema method should search in.
  • At last, you can set column name pattern to filter columns by name.
Databases 3
Returns list of databases on the server.
  • The first restriction is a name of a database.
  • The second restriction is definer's name.
  • The last restriction is encoding of the database.
DatasourceInformation 1
Returns information about data sources.
The only restriction is schema name.
Domains 9
Returns list of domains on the server. The restrictions for this collection are the following:
  • Domain name
  • Definer
  • OID type
  • Base type
  • Type length
  • Typmod
  • Number of dimensions
  • Schema name
  • OID
ForeignKeys 4
Returns list of foreign keys on the server. The restrictions for this collection are the following:
  • Key name
  • Schema name
  • Table name
  • OID
Functions 8
Returns list of functions on the server. The following restrictions may be specified:
  • Function name
  • Schema name
  • Definer
  • Language
  • Arguments count
  • Return type OID
  • Return type
  • OID
Groups 1
Lists all groups on the server, including IDs and members.
The only restriction is a group name.
Indexes 4
Returns list of indexes and their details. Restricted by:
  • Index name
  • Schema name
  • Table name
  • OID
Languages 2
Lists all languages on the server.
The first restriction is a language name, the second is OID.
NestedTables 5
Lists nested tables on the server. Restricted by:
  • Table name
  • Schema name
  • Parent table name
  • Parent schema name
  • OID
Operators 2
Returns list of operators allowed on the server.
Restrict it by OID and name.
PrimaryKeys 3
Returns list of primary keys on the server.
  • First restriction is key name.
  • Second is schema name
  • Third is table name
Schemas 2
Returns list of schemas on the server.
  • The first restriction is OID
  • The second restriction is schema name
Tables 4
Returns list of tables on the server. Restrict the collection with:
  • OID
  • Table name
  • Schema name
  • Definer
Triggers 6
Returns list of triggers on the server. Restricted by:
  • OID
  • Trigger name
  • Schema name
  • Definer
  • Language
  • Arguments count
Types 5
Returns list of types on the server. Restricted by:
  • OID
  • Type name
  • Schema name
  • Definer
  • Type Length
Users 1
Lists all users on the server.
When restricted by username, returns information about specific user.
Views 4
Returns list of types on the server. Restricted by:
  • OID
  • View name
  • Schema name
  • Definer

Npgsql 集合:

MetaDataCollections
Restrictions
Databases
Tables
Columns
Views
Users

https://github.com/npgsql/Npgsql/releases/tag/v2.2.4.3

http://npgsql.projects.pgfoundry.org/docs/api/Npgsql.NpgsqlConnection.GetSchema_overloads.html

http://www.codeproject.com/Articles/37154/PostgreSQL-PostGis-Operations

数据类型:

bit System.Int64 1560
varbit System.Int64 1560
bit varying System.Int64 1560
bool System.Boolean 16
boolean System.Boolean 16
smallint System.Int16 21
int System.Int32 23
integer System.Int32 23
int4 System.Int32 23
serial System.Int32 23
serial4 System.Int32 23
bigint System.Int64 20
int8 System.Int64 20
bigserial System.Int64 20
serial8 System.Int64 20
float System.Single 700
real System.Single 700
float4 System.Single 700
double System.Double 701
double precision System.Double 701
decimal System.Decimal 1700
numeric System.Decimal 1700
dec System.Decimal 1700
date System.DateTime 1082
timestamp System.DateTime 1114
timestamptz System.DateTime 1184
time System.TimeSpan 1083
timetz System.TimeSpan 1266
interval System.TimeSpan 1186
char System.String 1042
character System.String 1042
uuid System.Guid 2950
varchar System.String 1043
character varying System.String 1043
text System.String 25
binary System.Byte[] 17
bytea System.Byte[] 17
cidr System.String 29
circle System.String 718
inet System.String 869
line System.String 628
lseg System.String 601
macaddr System.String 829
box System.String 603
path System.String 602
point System.String 600
polygon System.String 604
money System.Double 790

集合:

MetaDataCollections
ReservedWords
AggregateFunctions
Arguments
Casts
CompositeTypeAttributes
Columns
DataSourceInformation
DataTypes
Databases
Domains
ForeignKeys
ForeignKeyColumns
Functions
Groups
Indexes
Indexcolumns
Languages
NestedTables
Operators
OperatorClasses
PrimaryKeys
Rules
Schemas
Sequences
Tables
Triggers
Types
Users
UserPrivileges
UniqueKeys
Views
Restrictions
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 Metadata的更多相关文章

  1. streamsets Processors 说明

    Processors 表示对于一种数据操作处理,在pipeline中可以应用多个Processors, 同时根据不同的执行模式,可以分为独立模式的,集群模式.边缘模式(agent),以及 帮助测试的测 ...

  2. Asp.net Core基于MVC框架实现PostgreSQL操作

    简单介绍 Asp.net Core最大的价值在于跨平台.跨平台.跨平台.重要的事情说三遍.但是目前毕竟是在开发初期,虽然推出了1.0.0 正式版,但是其实好多功能还没有完善.比方说编译时的一些文件编码 ...

  3. ubuntu14.04, Cloudera Manager 5.11.1, cdh5.11.1 postgresql离线部署

    最近一段时间团队接到的项目需要处理的数据量非常大,之前的处理方式难以满足现有需求.最近两周前前后后折腾了不少,在搭建了hadoop+hbase+hive+spark的一个集群后,由于感觉管理和监控太麻 ...

  4. PostgreSQL Q&A: Building an Enterprise-Grade PostgreSQL Setup Using Open Source Tools

    转自:https://www.percona.com/blog/2018/10/19/postgresql-building-enterprise-grade-setup-with-open-sour ...

  5. Distributed PostgreSQL on a Google Spanner Architecture – Query Layer

    转自:https://blog.yugabyte.com/distributed-postgresql-on-a-google-spanner-architecture-query-layer/ Ou ...

  6. SQLite metadata

    http://www.devart.com/dotconnect/sqlite/docs/MetaData.html https://github.com/sqlitebrowser/sqlitebr ...

  7. PostgreSQL源码分析之shared buffer与磁盘文件

    我们知道,PostgreSQL数据库中的信息,最终是要写入持久设备的.那么PostgreSQL是怎么将信息组织存储在磁盘上的呢? Bruce Momjian有一个slide <Insider P ...

  8. 连接postgresql

    # psycopg2 engine=create_engine('postgresql+psycopg2://scott:tiger@localhost/mydatabase')#  python 连 ...

  9. Kubernetes stateful set讲解以及一个基于postgreSQL的具体例子

    Stateful Set是Kubernetes 1.9版本新引入的一个概念,用于管理有状态的应用. Kubernetes官方文档: https://kubernetes.io/docs/concept ...

随机推荐

  1. django实战-留言板

    对应github链接:https://github.com/pshyms/django/tree/master/liuyanban 第一天 1. 创建一个新项目后,新建一个应用程序 python ma ...

  2. String 源码浅析————终结篇

    写在前面 说说这几天看源码的感受吧,其实 jdk 中的源码设计是最值得进阶学习的地方.我们在对 api 较为熟悉之后,完全可以去尝试阅读一些 jdk 源码,打开 jdk 源码后,如果你英文能力稍微过得 ...

  3. jpetStore 学习总结(2)

    在写jpetstore时,最难理解的应该是数据库还有每个表之间的关系了,我在这里对数据库简单的介绍. 以下是数据库的所有表:    account表是个人信息表,里面包括用户的名字,邮箱,地址,哪个城 ...

  4. C++类的构造函数及定义

    定义一个普通的类时,一定要定义它自己的构造函数.原因有三:第一个原因是编译器只有在发现类不包含任何构造函数的情况下才会替我们生成一个默认的构造函数,一旦我们定义了一些其他的构造函数,那么除非我们再定义 ...

  5. Codeforces Round #556 (Div. 2)-ABC(这次的题前三题真心水)

    A. Stock Arbitraging 直接上代码: #include<cstdio> #include<cstring> #include<iostream> ...

  6. hiho# 1398 最大权闭合子图 网络流

    题目传送门 题意:给出n个活动,m个人,请人需要花费$a[i]$的钱,举办一次活动可以赚$b[i]$的钱,但是需要固定的几个人在场,一个人只需要请一次后就必定在场,问最大收益. 思路: 下列结论来自h ...

  7. 分享一个电子发票信息提取工具(Python)

    电子发票太多,想统计下总额异常困难,网上工具不好用,花了2个小时实现一份,测试过中石油.京东开具的电子发票还行,部分发票名称失败有问题不影响统计,有需要的小伙伴自己拿去改吧. import cmd i ...

  8. Maven 安装jar文件到本地repository

    Reference: https://maven.apache.org/general.html#importing-jars mvn install:install-file \ -Dfile=&l ...

  9. 基于MVC4+EF5.0+Ajax+Json+CSS3的简单注册页面(get&post)

    使用mvc4可以很快速的创建页面,但封装的过多,难免会有些性能上的问题.所以基于此,通过使用简单的手写html,加ajax,json来创建一个注册页面,会比较干净,简洁. 本项目的环境是MVC4+EF ...

  10. Python案例之QQ空间自动登录程序实现

    不多说,直接上干货! 工具选择: 电脑系统:win7,32 位,下面第二部安装SetupTools时注意系统版本要求: Python: 2.7.11,  相信只要是2.7的就可以实现: Seleniu ...