Unable to Increase the column which was part of Primary key

From: karthikeyan <karthi(at)relationalsolutions(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Unable to Increase the column which was part of Primary key
Date: 2011-12-28 19:29:40
Message-ID: 1325100580167-5105943.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I am trying to increase size of the column which was/is part of the Primary.

Exiting table
CREATE TABLE test_dim_store
(
storek integer NOT NULL DEFAULT
nextval('dim_store_storek_seq1'::regclass),
retailerk character varying(10) NOT NULL,
store_nbr character varying(5) NOT NULL,
store_name character varying(25) NOT NULL,
CONSTRAINT test_dim_store_pkey PRIMARY KEY (retailerk, store_nbr)
)
WITHOUT OIDS;

I am trying to increase size of the column - store_nbr (which was part of
the Primary) from Varchar(5) to varchar(10).

I tried the following :
1) drop the Primary key - ALTER TABLE test_dim_store DROP CONSTRAINT
test_dim_store_pkey ;
2) Increase the size of Column - store_nbr - ALTER TABLE test_dim_store
ALTER COLUMN store_nbr TYPE varchar(10);

Error message:

ERROR: xdb-83016: cannot alter scatter column
relation "test_dim_store" column "store_nbr"

********** Error **********

ERROR: xdb-83016: cannot alter scatter column
relation "test_dim_store" column "store_nbr"
SQL state: 42809

3) I was not able to drop the column store_nbr either.

Have anyone encountered the same issue? it is expected or it is Bug?

Can anyone please help me or suggest the best way to increase the size the
column which was/is the part of Primary key?

Thank you in Advance.

Thanks,
Karthi

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Unable-to-Increase-the-column-which-was-part-of-Primary-key-tp5105943p5105943.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Donald 2011-12-28 21:02:39 Re: PostgreSQL 9.1 pg_dump setval() sets wrong value
Previous Message Tom Lane 2011-12-28 19:01:59 Re: PostgreSQL 9.1 pg_dump setval() sets wrong value