As for number 5 - Postgres already does that. This feature is called "constraints". Such constraints can be applied to multiple columns and are used to build better query plans (as well as limiting DML operations)
pg_dump -Fc mydb > db.dump
Restore: http://www.postgresql.org/docs/current/static/app-pgrestore.... pg_restore -C -d postgres db.dump
Command directly from the shell: psql -c "psql command"