- Learning PostgreSQL 11
- Salahaldin Juba Andrey Volkov
- 181字
- 2021-07-02 13:11:49
PostgreSQL high-level object interaction
To sum up, a PostgreSQL server can contain many databases, programming languages, roles, and tablespaces. Each database has an owner and a default tablespace; a role can be granted permission to access or can own several databases. The settings can be used to control the behavior of the PostgreSQL server on several levels, such as the database and the session.
Finally, a database can use several programming languages:

In order to create a database, you need to specify the owner and the encoding of the database; if the encoding of template1 doesn't match the required encoding, template0 should be used explicitly.
For the car-web high-level objects interaction-portal database, let's assume the database owner is the car_portal_role role and the encoding is UTF-8. To create this database on Linux, execute the following commands:
CREATE ROLE car_portal_app LOGIN;
CREATE DATABASE car_portal ENCODING 'UTF-8' LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8' TEMPLATE template0 OWNER car_portal_app;
On Windows, the CREATE DATABASE syntax is a bit different due to locale:
CREATE DATABASE car_portal ENCODING 'UTF-8' LC_COLLATE 'English_United States' LC_CTYPE 'English_United States' TEMPLATE template0 OWNER car_portal_app;
- 一步一步學(xué)Spring Boot 2:微服務(wù)項目實戰(zhàn)
- MySQL數(shù)據(jù)庫管理實戰(zhàn)
- JavaScript+DHTML語法與范例詳解詞典
- Visual Basic程序設(shè)計教程
- Hands-On GPU:Accelerated Computer Vision with OpenCV and CUDA
- Android Native Development Kit Cookbook
- Instant Lucene.NET
- Android應(yīng)用案例開發(fā)大全(第二版)
- 圖數(shù)據(jù)庫實戰(zhàn)
- Python項目實戰(zhàn)從入門到精通
- Mastering Elasticsearch(Second Edition)
- JBoss:Developer's Guide
- Python機器學(xué)習(xí)
- Swift Essentials(Second Edition)
- 開源網(wǎng)絡(luò)地圖可視化:基于Leaflet的在線地圖開發(fā)