How to add function to particular column in while creating table in Postgres?
There is serial and bigserial numeric type to autogenerate numbers i.e. autoincrement.
If you want to have custom function then you need to create trigger functions first and assign it to the trigger on insert.

More in the postgresql docs: 
http://www.postgresql.org/docs/9.4/static/datatype-numeric.html