Sinsing analysis on the mode in PostgreSQL

Source: Internet
Author: User

A database contains one or more named schemas, and the schema can contain database objects such as tables. Patterns are a bit like namespaces, and we can use the same names in different namespaces without conflicting. The pattern is not strictly separate, it is just a logical distinction.

Schema creation Syntax format: Create schema schema name;

Schema deletion syntax format: drop schema name [cascade];

When we use cascade when we delete the schema, which is called cascade Delete, it deletes the schema and all its objects.

When we use a database object, we can use its full name to locate, but this is usually very cumbersome, so we can set the value of Search_path, its syntax format is: set Search_path to mode 1, Mode 2 ...;

Of course we can also check the current search path through show Search_path .

By default, users do not see objects in the pattern that are not owned by them, and in order for them to see that the owner of the pattern needs to give the usage permission on the schema.

We can also associate the user name with the schema name so that we associate the pattern to the specified role in the format: CREATE schema name AUTHORIZATION user name;


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Sinsing analysis on the mode in PostgreSQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.