开发者

Postgresql equivalent of an Access autonumber field

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开发者_如何学Python 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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜