dbTalk Databases Forums  

[BUGS] BUG #1434: ERROR: type "bigserial" does not exist

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1434: ERROR: type "bigserial" does not exist in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Brad Snobar
 
Posts: n/a

Default [BUGS] BUG #1434: ERROR: type "bigserial" does not exist - 01-24-2005 , 12:58 AM







The following bug has been logged online:

Bug reference: 1434
Logged by: Brad Snobar
Email address: bradsnobar (AT) netscape (DOT) net
PostgreSQL version: 8.0
Operating system: Linux
Description: ERROR: type "bigserial" does not exist
Details:

The column was a primary key bigint.

ALTER TABLE "public"."CategoryBuildingRankSchemas"
ALTER COLUMN "IDCategoryBuildingRankSchema" TYPE BIGSERIAL;

ERROR: type "bigserial" does not exist

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)

Reply With Quote
  #2  
Old   
Alvaro Herrera
 
Posts: n/a

Default Re: [BUGS] BUG #1434: ERROR: type "bigserial" does not exist - 01-24-2005 , 08:09 AM






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

Quote:
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)

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
  #3  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] BUG #1434: ERROR: type "bigserial" does not exist - 01-29-2005 , 10:37 AM



Alvaro Herrera wrote:
Quote:
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.
I tried just altering the column from 'integer' to 'bigint' and it
seemed to work:

test=> create table test (x serial);
NOTICE: CREATE TABLE will create implicit sequence "test_x_seq" for serial column "test.x"
CREATE TABLE
test=> \d test
Table "public.test"
Column | Type | Modifiers
--------+---------+-----------------------------------------------------
x | integer | not null default nextval('public.test_x_seq'::text)

test=> alter table test alter column x type bigint;
ALTER TABLE
test=> \d test
Table "public.test"
Column | Type | Modifiers
--------+--------+-----------------------------------------------------
x | bigint | not null default nextval('public.test_x_seq'::text)

All sequences are bigint so there is nothing to change there.

So, I think the trick is to change the underlying column type but not
change the default which is tied to the sequence.

This certainly is an interesting usage report.

--
Bruce Momjian | http://candle.pha.pa.us
pgman (AT) candle (DOT) pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
  #4  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] BUG #1434: ERROR: type "bigserial" does not exist - 01-30-2005 , 08:26 AM



Bradley D. Snobar wrote:
Quote:
I'm confused, this looks fairly unrelated to the original message that I had sent?
Unrelated? You mean the original column was bigint, and not a serial.
Oh, sorry, I read it wrong.

---------------------------------------------------------------------------


Quote:
Bruce Momjian <pgman (AT) candle (DOT) pha.pa.us> wrote:

Alvaro Herrera wrote:
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.

I tried just altering the column from 'integer' to 'bigint' and it
seemed to work:

? ?test=> create table test (x serial);
? ?NOTICE: ?CREATE TABLE will create implicit sequence "test_x_seq" for serial column "test.x"
? ?CREATE TABLE
? ?test=> \d test
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Table "public.test"
? ? Column | ?Type ? | ? ? ? ? ? ? ? ? ? ? ?Modifiers
? ?--------+---------+-----------------------------------------------------
? ? x ? ? ?| integer | not null default nextval('public.test_x_seq'::text)
? ?
? ?test=> alter table test alter column x type bigint;
? ?ALTER TABLE
? ?test=> \d test
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Table "public.test"
? ? Column | ?Type ?| ? ? ? ? ? ? ? ? ? ? ?Modifiers
? ?--------+--------+-----------------------------------------------------
? ? x ? ? ?| bigint | not null default nextval('public.test_x_seq'::text)

All sequences are bigint so there is nothing to change there.

So, I think the trick is to change the underlying column type but not
change the default which is tied to the sequence.

This certainly is an interesting usage report.

--
?Bruce Momjian ? ? ? ? ? ? ? ? ? ? ? ?| ?http://candle.pha.pa.us
?pgman (AT) candle (DOT) pha.pa.us ? ? ? ? ? ? ? | ?(610) 359-1001
?+ ?If your life is a hard drive, ? ? | ?13 Roberts Road
?+ ?Christ can be your backup. ? ? ? ?| ?Newtown Square, Pennsylvania 19073


__________________________________________________ ________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp

--
Bruce Momjian | http://candle.pha.pa.us
pgman (AT) candle (DOT) pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #5  
Old   
Bradley D. Snobar
 
Posts: n/a

Default Re: [BUGS] BUG #1434: ERROR: type "bigserial" does not exist - 01-31-2005 , 08:58 PM



I'm confused, this looks fairly unrelated to the original message that I had sent?

Bruce Momjian <pgman (AT) candle (DOT) pha.pa.us> wrote:

Quote:
Alvaro Herrera wrote:
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.

I tried just altering the column from 'integer' to 'bigint' and it
seemed to work:

* *test=> create table test (x serial);
* *NOTICE: *CREATE TABLE will create implicit sequence "test_x_seq" for serial column "test.x"
* *CREATE TABLE
* *test=> \d test
* * * * * * * * * * * * * * *Table "public.test"
* * Column | *Type * | * * * * * * * * * * *Modifiers
* *--------+---------+-----------------------------------------------------
* * x * * *| integer | not null default nextval('public.test_x_seq'::text)
* *
* *test=> alter table test alter column x type bigint;
* *ALTER TABLE
* *test=> \d test
* * * * * * * * * * * * * * *Table "public.test"
* * Column | *Type *| * * * * * * * * * * *Modifiers
* *--------+--------+-----------------------------------------------------
* * x * * *| bigint | not null default nextval('public.test_x_seq'::text)

All sequences are bigint so there is nothing to change there.

So, I think the trick is to change the underlying column type but not
change the default which is tied to the sequence.

This certainly is an interesting usage report.

--
*Bruce Momjian * * * * * * * * * * * *| *http://candle.pha.pa.us
*pgman (AT) candle (DOT) pha.pa.us * * * * * * * | *(610) 359-1001
*+ *If your life is a hard drive, * * | *13 Roberts Road
*+ *Christ can be your backup. * * * *| *Newtown Square, Pennsylvania 19073

__________________________________________________ ________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.