I've had lots of responses to this, and I think I have it sussed now. If anyone has the same problem, the answer is: Use the SERIAL type! http://www.postgresql.org/docs/postgres/datatype.htm#AEN949
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных