官术网_书友最值得收藏!

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;
主站蜘蛛池模板: 合阳县| 通城县| 金塔县| 酒泉市| 瓮安县| 广州市| 静乐县| 十堰市| 柘城县| 澎湖县| 延安市| 江城| 常熟市| 邻水| 乌什县| 德兴市| 寻甸| 五指山市| 南溪县| 乡宁县| 陆丰市| 和平区| 裕民县| 九龙县| 绵竹市| 布拖县| 汉沽区| 方正县| 古丈县| 定安县| 江永县| 剑阁县| 谢通门县| 连云港市| 金寨县| 广宁县| 胶州市| 东阳市| 泰州市| 确山县| 申扎县|