Fix some issues with PostgreSQL in tables definitions and in people

query