Postgr-sql Basic Concepts

Source: Internet
Author: User
Tags db2

http://wenjiesu.iteye.com/blog/801129

"What is schema?"

What exactly is a schema? This question has been bothering me for a long time.

We only discuss the schema in the database, not the schema in the XML.

On the wiki, this explains the schema:

In a relational database, the schema defines the tables, views, indexes, packages,

Procedures, functions, queues, triggers, types, sequences, materialized views, synonyms,

Database links, directories, Java, XML schemas, and other elements.

In fact, a schema is a collection of database objects.

"Why is there a need for schema?" "

In order to distinguish between the collections, we need to give this set a name, in fact the name is the schema.

Example: Access to the EMP table under the Scott user, via the Select from EMP in fact,

The complete syntax for this SQL statement is select from Scott.emp. For the database, different users, there are different schemas. There are different tables.

Actually in use, the schema and user exactly the same, there is no difference between the name of the schema can also appear in the user name.

"What is a pattern":

The schema in the database refers to the schema.

This mode of interpretation in CSDN:

You can create the same table name in different modes

The schema name is used when the DB2 system accesses a Table object. Table Object

For table objects that do not indicate a pattern, the current logged in user mode is accessed as an implicit mode.

"What is a tablespace?" 】

The wiki explains this:

The tablespace is where the actual data is stored.

A database schema may exist in more than one table space, and similarly a table space can serve multiple schemas.

"Table Space function":

By using Tablespace, administrators can control the layout of the disk.

The most common function of table spaces is to optimize performance,

For example, one of the most commonly used indexes can be built on very fast hard disks,

Tables that are less commonly used can be built on inexpensive hard drives, such as those used to store archived files.

"Default tablespace in DB2 database"

The table space for HP users is Userspace1.

If you create a new tablespace, set the table to the table space you created, unless you specify it.

PostgreSQL Manual (Catalogue)

Http://www.cnblogs.com/stephen-liu74/archive/2012/06/08/2315679.html

Http://www.cnblogs.com/stephen-liu74/archive/2011/12/16/2290803.html

Server [localhost]:
Database [Postgres]:
Port [5432]:
Username [Postgres]:
' Chcp ' is not an internal or external command, nor is it a running program
or batch file.
Psql (8.4.6)
Ê?è? "Help" à′?? È?°?? Úd?? ¢.

postgres=#

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.