Re: BUG #1434: ERROR: type "bigserial" does not exist

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Brad Snobar <bradsnobar(at)netscape(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1434: ERROR: type "bigserial" does not exist
Date: 2005-01-24 14:03:49
Message-ID: 20050124140349.GB28988@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Jan 22, 2005 at 10:28:16PM +0000, Brad Snobar wrote:

> The column was a primary key bigint.
>
> ALTER TABLE "public"."CategoryBuildingRankSchemas"
> ALTER COLUMN "IDCategoryBuildingRankSchema" TYPE BIGSERIAL;
>
> ERROR: type "bigserial" does not exist

Bigserial is not a type. Rather, it's a type "with strings
attached". You can achieve the same effect by using

alter table foo alter column a type bigint,
alter column a set default nextval('seq');

Sadly, you have to create the sequence by hand, and it won't be dropped
when the table is dropped.

--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
"Right now the sectors on the hard disk run clockwise, but I heard a rumor that
you can squeeze 0.2% more throughput by running them counterclockwise.
It's worth the effort. Recommended." (Gerry Pourwelle)

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Sam Hahn 2005-01-24 14:17:00 Re: BUG #1432: type "cube" does not exist
Previous Message Martin Drinck 2005-01-24 09:23:20 BUG #1439: unable to create more than 21 database connections