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)



---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to