PSQL Notes 3


Anomalies

ex: phone calls to certain numbers

Great article on double vs single quotes in PSQL

http://blog.lerner.co.il/quoting-postgresql/

Extracting an 1:M Relationship

When extracting data:

  1. Create a table for new relation
  2. Insert data
  3. Create relationship
  4. Update films table to reference new relation
  5. Clean up
    • set relation ‘table name’_id to NOT NULL
    • remove redundant data from original table: drop columns
    • move constraints to new table