创建M-Compatibility数据库及用户
创建M-Compatibility数据库需要在非M-Compatibility数据库下进行,需要确保当前环境中已有templatem模板数据库。
gaussdb=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+-------+----------+-------------+-------------+-------------------
postgres | omm | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | omm | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/omm +
| | | | | omm=CTc/omm
template1 | omm | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/omm +
| | | | | omm=CTc/omm
templatem | omm | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/omm +
| | | | | omm=CTc/omm
(4 rows)
从505.1.0之前的版本升级到最新版本,基础包中如果templatem模板库未创建,升级之后templatem模板库也不会创建。
使用M-Compatibility数据库,需要先通过以下示例创建数据库。
gaussdb=# CREATE DATABASE m_db dbcompatibility = 'M' template=templatem; gaussdb=# \c m_db Non-SSL connection (SSL connection is recommended when requiring high-security) You are now connected to database "m_db" as user "omm". m_db=# CREATE USER omm_test password '********'; m_db=# GRANT ALL privileges to omm_test;
创建M-Compatibility数据库后,其它操作请参考SQL参考。
建议在升级至505.1版本之前检查是否存在非M-Compatibility的templatem数据库,若用户已创建templatem数据库,请联系华为技术工程师提供技术支持。如不处理,会影响到M-Compatibility数据库的相关特性。