码迷,mamicode.com
首页 > 数据库 > 详细

USE “schema_name” in PostgreSQL

时间:2016-05-18 06:53:50      阅读:258      评论:0      收藏:0      [点我收藏+]

标签:

http://timmurphy.org/tag/mysql/

http://timmurphy.org/2009/11/17/use-schema_name-in-postgresql/

 ====================================

For those moving from MySQL to PostgreSQL, there are a few differences which you will need to get used to.  One of these differences is the USE command, used to select the schema to select tables, views, etc from.

PostgreSQL does not have the USE command.  Instead, you can use:

SET search_path TO [schema_name]

For example, if we have a schema mySchema in which we are querying the person table, instead of SELECT * FROM mySchema.person, we can simply type SET search_path TO mySchema and use SELECT * FROM person for all subsequent queries.  mySchema will remain the default schema until the next SET command is issued, or the connection is closed.

USE “schema_name” in PostgreSQL

标签:

原文地址:http://www.cnblogs.com/kungfupanda/p/5503862.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!