How to add function to particular column in while creating table in Postgres? I want to add a function to particular column while creating a table in PostgreSQL. After creating table, it has to generate auto generated id when we insert values into to the table.
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