Unable to Increase the column which was part of Primary key - Mailing list pgsql-general

From karthikeyan
Subject Unable to Increase the column which was part of Primary key
Date
Msg-id 1325100580167-5105943.post@n5.nabble.com
Whole thread Raw
Responses Re: Unable to Increase the column which was part of Primary key
Re: Unable to Increase the column which was part of Primary key
List 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.

pgsql-general by date:

Previous
From: Ondrej Ivanič
Date:
Subject: Re: checking for table bloat
Next
From: Tom Lane
Date:
Subject: Re: Unable to Increase the column which was part of Primary key