If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > PostgreSQL > How can I break the objects dependecies ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-27-11, 08:50
naumanikram naumanikram is offline
Registered User
 
Join Date: Jun 2009
Posts: 9
How can I break the objects dependecies ?

hi fellows,

1)
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.

2)
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.

Regards,
Reply With Quote
  #2 (permalink)  
Old 08-25-11, 14:04
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
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' ...
__________________
Lou
使大吃一惊
"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

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On