Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009

    Unanswered: How can I break the objects dependecies ?

    hi fellows,

    as pg is highly structured language, while creating a view on table is tightly coupled means if I want to change the datatype in view, it won't allow me to do that. Like in MSSQL I can change the view's columns data type.
    How can i break this relation if i want to make changes in either table or view.

    why dependent objects has to be deleted first if i want to change any object's structure. How can I forcefully delete the object while not deleting the dependent objects. e.g. if i have a view B which is created on view A, and now how can i change view A without deleting view B.


  2. #2
    Join Date
    Jun 2004
    Arizona, USA
    In some cases, the dependent object might not need to be deleted first... In the case of dependent tables, you would need to drop the dependency first. (the foreign key constraint.) Then, after you change the data type in both locations, alter the table to add the foreign key constraint again.

    As far as views; save them in SQL, then drop them, and after the data type is updated, run the SQL to recreate the views.

    As far as PostgreSQL not adhering to Microsoft's standards... it's being developed open source. The developers are volunteers, and don't have billions of dollars to spend on behind the scenes 'polishing' ...
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts