Re: primary key generation

From: Chris Albertson <chrisalbertson90278(at)yahoo(dot)com>
To: Ned Matson <ned(at)go(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: primary key generation
Date: 2001-12-11 22:27:03
Message-ID: 20011211222703.13732.qmail@web14704.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Here is an example:

CREATE SEQUENCE format_id_count;
CREATE TABLE format (
FOREIGN KEY(vehicle_id) REFERENCES vehicle(vehicle_id),

format_id INTEGER PRIMARY KEY
DEFAULT
NEXTVAL('format_id_count
'),
vehicle_id INTEGER,

format_type VARCHAR(11),
description VARCHAR(31),
.......

--- Ned Matson <ned(at)go(dot)com> wrote:
> Does postgres have any built-in methods for auto-generating unique
> integer
> primary keys or is managing this task the responsibility of the user?
>
> Thanks in advance...
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

=====
Chris Albertson
Home: 310-376-1029 chrisalbertson90278(at)yahoo(dot)com
Cell: 310-990-7550
Office: 310-336-5189 Christopher(dot)J(dot)Albertson(at)aero(dot)org

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message amin 2001-12-11 23:04:31 7.1.3 XLogWrite Error
Previous Message Chris Albertson 2001-12-11 22:22:19 Re: Problem with indexes