I am trying to build a database for my company and my programmer does not know how to have a number which fills itself in like in Access 2003. In Access, you can have auto number with a field and it will insert for you. How do you do this in Postgresql? My programmer needs help, and he cannot find a book on it. Thanks very much!
Postgresql documentation: 8.1.4. Serial Types
CREATE TABLE tablename (
colname SERIAL
);
The data types serial
and bigserial
are not true types, but merely a notational convenience for creating unique identifier columns (similar to the AUTO_INCREMENT property supported by some other databases).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With