Re: BUG #1434: ERROR: type "bigserial" does not exist - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #1434: ERROR: type "bigserial" does not exist
Date
Msg-id 20050124140349.GB28988@dcc.uchile.cl
Whole thread Raw
In response to BUG #1434: ERROR: type "bigserial" does not exist  ("Brad Snobar" <bradsnobar@netscape.net>)
Responses Re: BUG #1434: ERROR: type "bigserial" does not exist  (Bruce Momjian <pgman@candle.pha.pa.us>)
List 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[@]dcc.uchile.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)

pgsql-bugs by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: 8.0.0 gmake check fails if on disk, passes on ram disk....
Next
From: Tom Lane
Date:
Subject: Re: BUG #1429: stats tests fails