var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Alter Column Used In View
is it possible to alter a column in a table which is used in the view
The column's data type in the view is determined by the underlying table's column.
What exactly are you trying to do?
Please post the DDL to create the table and the view, otherwise this will just be wild guesses
Actually I had a column code character varying(2)
and values stored in the code column as 'in','uk','us','it'............
and the in the view i am checking the where condition as site::text = 'uk'::text
and i tried by changing where condition as site::character varying(3)= 'uk'::character varying(3) also.........
but now i want to alter the code column as character varying(3)
but giving me error as
ERROR: cannot alter type of a column used by a view or rule
DETAIL: rule _RETURN on view vw_test depends on column "code"
is it possible to alter a column which is used in the view or not? if yes how?
As you refuse to show any DDL for the table and the view this is really hard (if not impossible) to tell.
Why do you need to cast anyway? Why not simply write site = 'uk'
You'll have to drop the view, change the table and recreate the view. And casting varchar <-> text is pointless.