Weirdess when altering serial column type - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Weirdess when altering serial column type
Date
Msg-id 42649372.50004@familyhealth.com.au
Whole thread Raw
Responses Re: Weirdess when altering serial column type
List pgsql-hackers
Should that sequence really stick around as an integer, numeric and text 
field???


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

test=# alter table test alter a type integer;
ALTER TABLE
test=# \d test                          Table "public.test" Column |  Type   |                      Modifiers
--------+---------+----------------------------------------------------- a      | integer | not null default
nextval('public.test_a_seq'::text)

test=# alter table test alter a type numeric;
ALTER TABLE
test=# \d test                          Table "public.test" Column |  Type   |                      Modifiers
--------+---------+----------------------------------------------------- a      | numeric | not null default
nextval('public.test_a_seq'::text)

test=# alter table test alter a type text;
ALTER TABLE
test=# \d test                         Table "public.test" Column | Type |                      Modifiers
--------+------+----------------------------------------------------- a      | text | not null default
nextval('public.test_a_seq'::text)




pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: Problem with PITR recovery
Next
From: Tom Lane
Date:
Subject: Re: Weirdess when altering serial column type