从逻辑上看,schema,table,都是位于database之下。

首先,在postgres数据库下建立表(相当于建立在public schema下):

[pgsql@localhost bin]$ ./psql -d postgres
psql (9.1.2)
Type "help" for help. postgres=# create table tab200(id integer);
CREATE TABLE
postgres=# \q

然后,再在tester数据库下建立表(相当于建立在public schema下):

[pgsql@localhost bin]$ ./psql -d tester
psql (9.1.2)
Type "help" for help. tester=# create table tab200(id integer);
CREATE TABLE
tester=# \q

然后,再在其他的数据库下进行查看:

[pgsql@localhost bin]$ ./psql
psql (9.1.2)
Type "help" for help. pgsql=# SELECT * FROM information_schema.tables WHERE table_name='tab200';
table_catalog | table_schema | table_name | table_type | self_referencing_column_name | reference_generation | user_de
fined_type_catalog | user_defined_type_schema | user_defined_type_name | is_insertable_into | is_typed | commit_action
---------------+--------------+------------+------------+------------------------------+----------------------+--------
-------------------+--------------------------+------------------------+--------------------+----------+---------------
(0 rows) pgsql=# \q

然后,再在 postgres数据库和tester数据库下分别查看:

[pgsql@localhost bin]$ ./psql -d tester
psql (9.1.2)
Type "help" for help. tester=# SELECT * FROM information_schema.tables WHERE table_name='tab200';
table_catalog | table_schema | table_name | table_type | self_referencing_column_name | reference_generation | user_de
fined_type_catalog | user_defined_type_schema | user_defined_type_name | is_insertable_into | is_typed | commit_action
---------------+--------------+------------+------------+------------------------------+----------------------+--------
-------------------+--------------------------+------------------------+--------------------+----------+---------------
tester | public | tab200 | BASE TABLE | | |
| | | YES | NO |
(1 row) tester=# \q
[pgsql@localhost bin]$ ./psql -d postgres
psql (9.1.2)
Type "help" for help. postgres=# SELECT * FROM information_schema.tables WHERE table_name='tab200';
table_catalog | table_schema | table_name | table_type | self_referencing_column_name | reference_generation | user_de
fined_type_catalog | user_defined_type_schema | user_defined_type_name | is_insertable_into | is_typed | commit_action
---------------+--------------+------------+------------+------------------------------+----------------------+--------
-------------------+--------------------------+------------------------+--------------------+----------+---------------
postgres | public | tab200 | BASE TABLE | | |
| | | YES | NO |
(1 row)

PostgreSQL中,database,schema,table之间关系的更多相关文章

  1. Android中sp和px之间关系探究

    记得当时在刚接触Android时都在说不要用px,要用sp,所以在实际工作当中当然就按照这个规则,所以都要将px换算成sp,而我在实际工作中的换算规则是dp=px * 1.5,而且用这种规则到现在基本 ...

  2. Excel Open Xml中CellStyleXfs,cellStyle,cellXfs之间关系的总结

    最近这几个东东打交道了几天,总算是弄明白了,综合多个帖子,现在总结如下: 在创建stylesheet时,必须创建fonts,Fills,Borders 和cellXfs(CellFormats)四个节 ...

  3. PostgreSQL模式(schema)介绍

    一个PostgreSQL数据库集群包含一个或多个已命名数据库.用户和用户组在整个集群范围内是共享的,但是其它数据并不共享.任何与服务器连接的客户都只能访问那个在连接请求里声明的数据库. 注意: 集群中 ...

  4. [原创]PostgreSQL中十进制、二进制、十六进制之间的相互转换

    在PostgreSQL中,二进制.十进制.十六进制之间的转换是非常方便的,如下: 十进制转十六进制和二进制 mydb=# SELECT to_hex(10); to_hex -------- a (1 ...

  5. Postgresql中临时表(temporary table)的特性和用法

    熟悉Oracle的人,相比对临时表(temporary table)并不陌生,很多场景对解决问题起到不错的作用,开源库Postgresql中,也有临时表的概念,虽然和Oracle中临时表名字相同,使用 ...

  6. PostgreSQL、SQL Server数据库中的数据类型的映射关系

    PostgreSQL 8.1 轰动发布,我也打算将原来使用 SQL Server 的一些应用迁移到 PostgreSQL 上,首先需要迁移的是表,那么这就必须要先搞清楚这两个数据库中的数据类型的映射关 ...

  7. talend openstudio 在OracleInput组件中guess Schema 出现Database connection is failed 的错误

    错误描述: talend openstudio 在OracleInput组件中guess Schema 出现Database connection is failed 的错误. 查看错误详情,发现错误 ...

  8. HBase入门实例: Table中Family和Qualifier的关系与区别

    Table中Family和Qualifier的关系与区别 就像用MySQL一样,我们要做的是表设计,MySQL中的表,行,列的在HBase已经有所区别了,在HBase中主要是Table和Family和 ...

  9. 数据库中的Schema是什么?

    在数据库中,schema(发音 “skee-muh” 或者“skee-mah”,中文叫模式)是数据库的组织和结构,schemas andschemata都可以作为复数形式.模式中包含了schema对象 ...

随机推荐

  1. FZU 1591 Coral的烦恼

    Problem Description 程序设计课的老师给Coral布置了一道题:用T(n)表示所有能整除n的正整数之和,对于给定的数字n,记S(n)=T(1)+T(2)+…+ T(n).你的任务就是 ...

  2. 调试WEB APP多设备浏览器(转)

      方法:adobe shadow  \ opera远程调试\ weinre adobe shadow: 我们经常使用Firefox的firebug或者Chrome的开发人员工具进行Web调试页面,J ...

  3. jquery加入购物车飞入的效果

    主要原理是:点击当前图片的时候,复制(克隆)当前图片在当前位置,然后利用jQuery的animate()方法实现图像的飞入效果 效果预览:http://runjs.cn/detail/qmf0mtm1 ...

  4. iOS-利用AFNetworking(AFN 1.x)-实现文件上传

    转:http://www.kaifazhe.com/ios_school/380067.html 官方建议AFN的使用方法 1. 定义一个全局的AFHttpClient:包含有 1> baseU ...

  5. ASIHttpRequest编译不通过

    转:http://blog.sina.com.cn/s/blog_67a5e47201014tof.html Undefined symbols for architecture i386:   &q ...

  6. 选择或者放弃MySQL的理由

    MySQL 作为一个开源数据库,自从被 Oracle 接管后,其发展前景就一直受到开发社区的关注,其中也有质疑,最近,两位开发者分别发表了选择和放弃MySQL 的理由,值得数据库相关人员参考. And ...

  7. 一些网站的Android客户端

    实际上就是浏览器(WebView),外面包装上了用户体验更好的外壳

  8. MSSQL 2005数据库与SP4补丁安装

    Sql Server 2005 正确安装之前的win7配置: http://wenku.baidu.com/link?url=6T3jzVnu2XY_sfqfe9ZqQ_6dUOdrZwHc83baW ...

  9. Unable to execute dex: method ID not in [0, 0xffff]: 65536

    http://ingramchen.io/blog/2014/09/prevention-of-android-dex-64k-method-size-limit.html

  10. Delphi中编辑word

      其他(28)   //启动Word   try     wordapplication1.connect;   except     messagedlg('word may not be ins ...