- Learning PostgreSQL 10(Second Edition)
- Salahaldin Juba Andrey Volkov
- 290字
- 2021-07-02 22:42:12
Version control system
It is a good idea to maintain your code using a revision control system such as Git or SVN. When writing an SQL code, it is better to create an installation script and execute it in one transaction. This approach makes it easy to clean up if an error occurs.
Database objects have different properties: some are a part of the physical schema, and some control database access. The following is a proposal for organizing the database code in order to increase the separation of concern (SoC).
For each database in a PostgreSQL cluster, one should maintain the DDL script for objects that are part of the physical schema, and the DML script, which populates the tables with static data together. The state of an object in the physical schema is defined by the object structure and the data that is contained by this object; thus, the object cannot be recreated without being dropped first. Also, the structure of the physical schema object does not change often. In addition to that, the refactoring of some of the physical schema objects, such as tables, might require data migration. In other words, changing the definition of a physical schema object requires some planning.
Store the DDL scripts for objects that are not part of the physical schema, such as views and functions, separately. Keeping the definitions of views and functions together allows the developer to refactor them easily. Also, the developer will be able to extract the dependency trees between these objects.
Maintain the DCL script separately. This allows the developer to separate the security aspect from the functional requirements of the database. It allows the database developers and administrators to work closely without interfering with each other's work.
- Microsoft Power BI Quick Start Guide
- Mastering VMware vSphere 6.5
- Visual C# 2008開發技術實例詳解
- 統計學習理論與方法:R語言版
- Mastering Game Development with Unreal Engine 4(Second Edition)
- Statistics for Data Science
- Linux系統下C程序開發詳解
- 大數據導論
- 工業機器人集成應用
- 計算機應用基礎實訓(職業模塊)
- Microsoft Dynamics CRM 2013 Marketing Automation
- 軟件測試設計
- Flash CS3動畫制作
- Office 2010輕松入門
- PVCBOT零基礎機器人制作(第2版)