![]() The public schema is the second element in the search path, so to access the staff table in the public schema, you must qualify the table name as follows: SELECT * FROM public. To access the staff table in the sales schema you can use one of the following statement: SELECT * FROM staff The following picture shows the new schema sales and the staff table that belongs to the sales schema: Now, if you create a new table named staff without specifying the schema name, PostgreSQL will put this staff table into the sales schema: CREATE TABLE staff( To add the new schema to the search path, you use the following command: SET search_path TO sales, public Code language: PHP ( php ) To create a new schema, you use the CREATE SCHEMA statement: CREATE SCHEMA sales
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |