- Odoo 11 Development Essentials(Third Edition)
- Daniel Reis
- 256字
- 2021-08-27 19:32:38
Managing Odoo databases
We've seen how to create and initialize new Odoo databases from the command line. There are more commands worth knowing about for managing databases.
Although the Odoo server automatically takes care of that, we can manually create PostgreSQL databases from the command line, using:
$ createdb MyDB
More interesting, it can also create a new database by copying an existing one, using the --template option. For this to work, the copied database can't have open connections to it, so make sure your Odoo instance is stopped and there is no other connection open for it. The command to use looks like this:
$ createdb --template=MyDB MyDB2
In fact, every time we create a database, a template is used. If none is specified, a predefined one called template1 is used.
To list the existing databases in your system, use the PostgreSQL psql utility with the -l option:
$ psql -l
Running it will list the two databases we have created so far: MyDB and MyDB2. The list will also display the encoding used in each database. The default is UTF-8, which is the encoding needed for Odoo databases.
To remove a database you no longer need (or want to recreate), use the dropdb command:
$ dropdb MyDB2
Now you know the basics to work with databases. To learn more about PostgreSQL, refer to the official documentation at http://www.postgresql.org/docs/.
- Word/Excel/PPT 2007辦公技巧
- 用友ERP-U8(8.72版)標(biāo)準(zhǔn)財(cái)務(wù)模擬實(shí)訓(xùn)
- 漫!動(dòng)作!人體動(dòng)態(tài)漫畫(huà)素描技法超級(jí)大全
- Word/Excel 2016商務(wù)辦公實(shí)戰(zhàn)從新手到高手
- Unity 2017虛擬現(xiàn)實(shí)開(kāi)發(fā)標(biāo)準(zhǔn)教程
- 精通Excel數(shù)據(jù)統(tǒng)計(jì)與分析
- Word/Excel/PPT 2016高效辦公實(shí)戰(zhàn)從入門到精通
- 文秘辦公自動(dòng)化培訓(xùn)教程
- 零基礎(chǔ)學(xué)游戲UI設(shè)計(jì)
- Excel 2010電子表格自學(xué)成才
- Excel 2010表格處理直通車
- 學(xué)Office 2007辦公應(yīng)用
- 隨身查:Excel函數(shù)與公式綜合應(yīng)用技巧
- Word/Excel/PPT/PS就這么高效
- Word/Excel/PPT 2016辦公三合一傻瓜書(shū)