I've had lots of responses to this, and I think I have it sussed now. Ifanyone has the same problem, the answer is:
Use the SERIAL type!
http://stream.boxwatch.ru/docs/postgres/datatype.htm#AEN949