Is there any way to assign unique id automatically in postgreSQL like mongodb does?

is there any way to assign unique id automatically in PostgreSQL as MongoDB does?

Yes there is a way to do that with the help of a predefined datatypes-

smallserial for range 1 to 32767
serial for range 1 to 2147483647
bigserial for range 1 to 9223372036854775807