Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md for AWXBackup pg_dump_suffix #2020

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

mcen1
Copy link

@mcen1 mcen1 commented Feb 24, 2025

SUMMARY

The original command in this README.md does not seem to yield a usable AWXBackup object for me. I receive the following error when using it:
[\"pg_restore: error: could not execute query: ERROR: insert or update on table \\\"main_activitystream_job\\\" violates foreign key constraint \\\"main_activitystream__job_id_aa6811b5_fk_main_job_\\\"\", \"DETAIL: Key (job_id)=(56322) is not present in table \\\"main_job\\\".\", \"Command was: ALTER TABLE ONLY public.main_activitystream_job\", \" ADD CONSTRAINT main_activitystream__job_id_aa6811b5_fk_main_job_ FOREIGN KEY (job_id) REFERENCES public.main_job(unifiedjob_ptr_id) DEFERRABLE INITIALLY DEFERRED;\", \"\", \"\", \"pg_restore: error: could not execute query: ERROR: insert or update on table \\\"main_host\\\" violates foreign key constraint \\\"main_host_last_job_id_d247075b_fk_main_job_unifiedjob_ptr_id\\\"\", \"DETAIL: Key (last_job_id)=(57349) is not present in table \\\"main_job\\\".\", \"Command was: ALTER TABLE ONLY public.main_host\", \" ADD CONSTRAINT main_host_last_job_id_d247075b_fk_main_job_unifiedjob_ptr_id FOREIGN KEY (last_job_id) REFERENCES public.main_job(unifiedjob_ptr_id) DEFERRABLE INITIALLY DEFERRED;\", \"\", \"\", \"pg_restore: error: could not execute query: ERROR: insert or update on table \\\"main_jobhostsummary\\\" violates foreign key constraint \\\"main_jobhostsummary_job_id_8d60afa0_fk_main_job_\\\"\", \"DETAIL: Key (job_id)=(57072) is not present in table \\\"main_job\\\".\", \"Command was: ALTER TABLE ONLY public.main_jobhostsummary\", \" ADD CONSTRAINT main_jobhostsummary_job_id_8d60afa0_fk_main_job_ FOREIGN KEY (job_id) REFERENCES public.main_job(unifiedjob_ptr_id) DEFERRABLE INITIALLY DEFERRED;\", \"\", \"\", \"pg_restore: warning: errors ignored on restore: 3\", \"Terminated\"], \"stdout\": \"keepalive_pid: 56\\nMigrating data from old database...\\n\", \"stdout_lines\": [\"keepalive_pid: 56\", \"Migrating data from old database...\"]}

The updated command for pg_dump_suffix, "--exclude-table-data 'main_jobevent*' --exclude-table-data '*main_systemjobevent*' --exclude-table-data '*main_activitystream_*'" seems to yield a usable AWXBackup object that is approximately 97% smaller than a full backup without the command. I'm hoping this might help others who run in to the issue.

If there's anything I'm missing, please let me know.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change

The original command does not seem to yield a usable AWXBackup object. I receive the following error when using it:
`[\"pg_restore: error: could not execute query: ERROR:  insert or update on table \\\"main_activitystream_job\\\" violates foreign key constraint \\\"main_activitystream__job_id_aa6811b5_fk_main_job_\\\"\", \"DETAIL:  Key (job_id)=(56322) is not present in table \\\"main_job\\\".\", \"Command was: ALTER TABLE ONLY public.main_activitystream_job\", \"    ADD CONSTRAINT main_activitystream__job_id_aa6811b5_fk_main_job_ FOREIGN KEY (job_id) REFERENCES public.main_job(unifiedjob_ptr_id) DEFERRABLE INITIALLY DEFERRED;\", \"\", \"\", \"pg_restore: error: could not execute query: ERROR:  insert or update on table \\\"main_host\\\" violates foreign key constraint \\\"main_host_last_job_id_d247075b_fk_main_job_unifiedjob_ptr_id\\\"\", \"DETAIL:  Key (last_job_id)=(57349) is not present in table \\\"main_job\\\".\", \"Command was: ALTER TABLE ONLY public.main_host\", \"    ADD CONSTRAINT main_host_last_job_id_d247075b_fk_main_job_unifiedjob_ptr_id FOREIGN KEY (last_job_id) REFERENCES public.main_job(unifiedjob_ptr_id) DEFERRABLE INITIALLY DEFERRED;\", \"\", \"\", \"pg_restore: error: could not execute query: ERROR:  insert or update on table \\\"main_jobhostsummary\\\" violates foreign key constraint \\\"main_jobhostsummary_job_id_8d60afa0_fk_main_job_\\\"\", \"DETAIL:  Key (job_id)=(57072) is not present in table \\\"main_job\\\".\", \"Command was: ALTER TABLE ONLY public.main_jobhostsummary\", \"    ADD CONSTRAINT main_jobhostsummary_job_id_8d60afa0_fk_main_job_ FOREIGN KEY (job_id) REFERENCES public.main_job(unifiedjob_ptr_id) DEFERRABLE INITIALLY DEFERRED;\", \"\", \"\", \"pg_restore: warning: errors ignored on restore: 3\", \"Terminated\"], \"stdout\": \"keepalive_pid: 56\\nMigrating data from old database...\\n\", \"stdout_lines\": [\"keepalive_pid: 56\", \"Migrating data from old database...\"]}`

The updated command seems to yield a usable AWXBackup object that is approximately 97% smaller than a full backup without the command.

If there's anything I'm missing, please let me know.
@mcen1 mcen1 changed the title Update README.md Update README.md for AWXBackup pg_dump_suffix Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant