# A PostgreSQL Primer

The examples in this chapter of the documentation have been taken from the PostgreSQL manual. They demonstrate some PostgreSQL features using the classic PyGreSQL interface. They can serve as an introduction to PostgreSQL, but not so much as examples for the use of PyGreSQL.

## Contents

- Basic examples
  - Creating a connection to the database
  - Creating tables
  - Insert data
  - Retrieving data
  - Retrieving data into other tables
  - Aggregates
  - Joining tables
  - Updating data
  - Deleting data
  - Removing the tables
- Examples for advanced features
  - Inheritance
  - Arrays
- Examples for using SQL functions
  - Creating SQL Functions on Base Types
  - Creating SQL Functions on Composite Types
  - Creating SQL Functions with multiple SQL statements
  - Remove functions that were created in this example
- Examples for using the system catalogs
  - Lists indices
  - List user defined attributes
  - List user defined base types
  - List operators
  - List functions of a language
  - List aggregate functions
  - List operator families