Auto increment

From: "Fontenot, Paul" <Paul(dot)Fontenot(at)bannerhealth(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Auto increment
Date: 2003-05-27 17:37:26
Message-ID: 230BCAB977308F43BD851AFAE55A86413D6CFA@phx01018.bannerhealth.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

When creating a table how do you make an auto incrementing field? I'm
using:

Create table hosts (
id int not null unique primary key,
ip char(16),
hostname text
);

Is there a way to make the host.id field automagicaly increment?

***PRIVILEGED & CONFIDENTIAL***
Unless expressly stated otherwise, this message (and any attachment(s)
thereto) is confidential and may be privileged. It is intended for the
addressee(s) only. If you are not an addressee, any disclosure or
copying of the contents of this e-mail or any action taken (or not
taken) in reliance on it is strictly prohibited. If you are not an
addressee, please inform sender immediately and delete this message from
your system.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Rory Campbell-Lange 2003-05-27 17:51:51 Transaction in function problem
Previous Message Nabil Sayegh 2003-05-27 17:03:13 Re: Examples of accessing postgresql with scripts?