Re: pgadmin 3

From: Mike G <mike(at)thegodshalls(dot)com>
To: "raptor(at)tvskat(dot)net" <raptor(at)tvskat(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pgadmin 3
Date: 2004-07-21 05:06:09
Message-ID: 20040721050609.GA32649@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,
try alter table modems add column id serial set default

Set default tells postgres to automatically fill in the column data using a sequence on your behalf.

OID could be used for primary key I suppose. To use as a foreign key you would manually have to somehow copy the value in table A and insert into B. AFAIK system generated OIDS are unique to each table.

HTH

mike
> In pgadmin3 I'm tring to add auto_inc column like this
>
> ALTER TABLE public.modems ADD COLUMN id serial;
>
> But get this error :
>
> NOTICE: ALTER TABLE will create implicit sequence "modems_id_seq" for "serial" column "modems.id"
>
> ERROR: adding columns with defaults is not implemented
> HINT: Add the column, then use ALTER TABLE SET DEFAULT.
>
>
> How to add auto_inc fields... thanx
>
> PS. Can I use OID column for primary/foreign functionality, or it
> has some restriction ...i mean i may not use auto_inc field ?
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

In response to

  • pgadmin 3 at 2004-07-20 13:20:25 from raptor@tvskat.net

Responses

  • Re: pgadmin 3 at 2004-07-22 00:24:06 from Martijn van Oosterhout

Browse pgsql-general by date

  From Date Subject
Next Message Vinay Jain 2004-07-21 05:06:50 Aligned Output!!
Previous Message Anton Maksimenkov 2004-07-21 05:00:06 Why index used/not used