Book Image

PostgreSQL 9 Administration Cookbook - Second Edition

Book Image

PostgreSQL 9 Administration Cookbook - Second Edition

Overview of this book

Table of Contents (19 chapters)
PostgreSQL 9 Administration Cookbook Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Choosing good names for database objects


The easiest way to help other people understand a database is to ensure that all the objects have a meaningful name.

What makes a name meaningful?

Getting ready

Take some time to reflect on your database to make sure you have a clear view of its purpose and main use cases. This is because all the items in this recipe describe certain naming choices, which you need to consider carefully in view of your specific circumstances.

How to do it…

Here are the points you should consider when naming your database objects:

  • The name follows the existing standards and practices in place. Inventing new standards isn't helpful; enforcing existing standards is.

  • The name clearly describes the role or table contents.

  • For major tables, use short, powerful names.

  • Name lookup tables after the table to which they are linked, such as account_status.

  • For associative or linked tables, use all the names of the major tables to which they relate, such as customer_account.

  • Make sure that...