Chapter 5. Tables and Data

In this chapter, we will cover the following recipes:

  • Choosing good names for database objects
  • Handling objects with quoted names
  • Enforcing the same name and definition for columns
  • Identifying and removing duplicates
  • Preventing duplicate rows
  • Finding a unique key for a set of data
  • Generating test data
  • Randomly sampling data
  • Loading data from a spreadsheet
  • Loading data from flat files

Introduction

This chapter covers a range of general recipes for your tables and working with the data they contain. Many of the recipes contain general advice, though with specific PostgreSQL examples.

Some system administrators I've met work only on the external aspects of the database server. What's actually in the database is someone else's problem. ...

Get PostgreSQL 9 Administration Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.