http://www.postgresql.org/docs/techdocs.7 example on how to implement row-level protection in PostgreSQL