Re: Primary Key

From: Mike G <mike(at)thegodshalls(dot)com>
To: Eduardo V(dot) Rodríguez <evazquez(at)insys-corp(dot)com(dot)mx>
Cc: "Postgres (E-mail)" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Primary Key
Date: 2004-06-15 04:34:56
Message-ID: 20040615043456.GC9511@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


If you want to use a primary key that increase in value by one each time consider using a sequence.

See http://www.postgresql.org/docs/7.4/static/sql-createsequence.html

On Mon, Jun 14, 2004 at 07:17:37PM -0500, Eduardo V. Rodríguez wrote:
> Hi
>
> I try to do the following in a table that has 4 columns,
>
> id - month - day- time
>
> The column id is the primary key, for example
>
> id - month . day - time
> 1 Jan 22 16:15
> 2 Jan 22 16:16
> 3 Jan 22 16:17
> 4 Jan 22 16:18
>
> But I pretend that automatically when I made an INSERT INTO table (month,
> day, time) values (A,B,C) the primary key update his value increasing by one
>
>
> I dont know how to do this, Iam using Postgres 7.4 with PgAdminIII
>
> Thank you
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

In response to

  • Primary Key at 2004-06-15 00:17:37 from Eduardo V. Rodríguez

Browse pgsql-novice by date

  From Date Subject
Next Message Nabil Sayegh 2004-06-15 09:55:05 Re: Primary Key
Previous Message Eduardo V. Rodríguez 2004-06-15 00:17:37 Primary Key