Cannot change column data type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bogie
    New Member
    • Aug 2007
    • 10

    Cannot change column data type

    Hello

    I have some problem to change my column data type in my table property from character(15) to character(100). I use Postgresql 7.4.
    The problem is I try to make new column with charcater(100) then i copy the data from teh original column to the new column, then i try to drop the column but i get the following ERROR : Cannot drop table invention column invention_cite because the other objects depend on it.
    Is any body can help me to solve this problem ?

    bogie
  • michaelb
    Recognized Expert Contributor
    • Nov 2006
    • 534

    #2
    Originally posted by bogie
    Hello
    ... ... ...
    ERROR : Cannot drop table invention column invention_cite because the other objects depend on it.
    The message says it all, you have some other objects that depend on this column.
    Open the psql session and run
    \d+ invention
    The output of this command can give you an idea on what's involved.

    Comment

    • bogie
      New Member
      • Aug 2007
      • 10

      #3
      Originally posted by michaelb
      The message says it all, you have some other objects that depend on this column.
      Open the psql session and run
      \d+ invention
      The output of this command can give you an idea on what's involved.

      Hallo

      Thankyou for replying my question, Continue with my problem : After I know the relation of the dependent object, what should i do to change my column data type in my table invention ?, Should I use the DROP ... CASCADE command to destroy the dependent object one by one ? and connected again to the new column after i drop the old column ?, or is there any other way, I mean an easy way to change my column data type without destroying the dependent object ?. Because the changes is not so significant but the effort to do this is so complicated. Can any body help me to solve this problem?.
      Thank you very much in advance

      Bogie

      Comment

      Working...