I have two tables 'jobs' and 'jobs_history' and for some reason 'jobs' inherites from 'jobs_history'. I want to change the inheritance such that 'jobs_history' inherites from 'jobs'. Since the columns are the same, there are some triggers and constraints which are not inherited I though this should be done easily by:

ALTER TABLE jobs NO INHERIT jobs_history;
ALTER TABLE jobs_history INHERIT jobs;

and this executes without errors. The only thing is that the data has also moved. So all the data in jobs_history are now in jobs and vice versa.

Does anybody have an idea to why the above command makes the data move?

  • 1
    how about renaming table names? (and also rename table names in procedures, triggers etc) – Sahap Asci Sep 10 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.