程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> MYSQL數據庫 >> MySQL綜合教程 >> USE “schema_name” in PostgreSQL,postgresqlschema

USE “schema_name” in PostgreSQL,postgresqlschema

編輯:MySQL綜合教程

USE “schema_name” in PostgreSQL,postgresqlschema


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.

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved