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

HINT: Use DROP ... CASCADE to also remove linked objects. Partitioning table causing error? #467

Open
lidyum opened this issue Nov 16, 2022 · 0 comments

Comments

@lidyum
Copy link

lidyum commented Nov 16, 2022

Is there a solution for this error?

I use architect 0.6.0 for table partitioning. betik_app_staff_workinghourmodel_y2022m05 table is a partition table.

Error: public.betik_app_staff_workinghourmodel_y2022m05 table depends on public.betik_app_staff_workinghourmodel table object

HINT: Use DROP ... CASCADE to also remove linked objects.

Traceback (most recent call last):
container@testserver    |   File "manage.py", line 22, in <module>
container@testserver    |     main()
container@testserver    |   File "manage.py", line 18, in main
container@testserver    |     execute_from_command_line(sys.argv)
container@testserver    |   File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
container@testserver    |     utility.execute()
container@testserver    |   File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 413, in execute
container@testserver    |     self.fetch_command(subcommand).run_from_argv(self.argv)
container@testserver    |   File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
container@testserver    |     self.execute(*args, **cmd_options)
container@testserver    |   File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute
container@testserver    |     output = self.handle(*args, **options)
container@testserver    |   File "/usr/local/lib/python3.8/site-packages/dbbackup/management/commands/dbrestore.py", line 68, in handle
container@testserver    |     self._restore_backup()
container@testserver    |   File "/usr/local/lib/python3.8/site-packages/dbbackup/management/commands/dbrestore.py", line 118, in _restore_backup
container@testserver    |     self.connector.restore_dump(input_file)
container@testserver    |   File "/usr/local/lib/python3.8/site-packages/dbbackup/db/base.py", line 105, in restore_dump
container@testserver    |     return self._restore_dump(dump)
container@testserver    |   File "/usr/local/lib/python3.8/site-packages/dbbackup/db/postgresql.py", line 89, in _restore_dump
container@testserver    |     return super()._restore_dump(dump)
container@testserver    |   File "/usr/local/lib/python3.8/site-packages/dbbackup/db/postgresql.py", line 64, in _restore_dump
container@testserver    |     stdout, stderr = self.run_command(cmd, stdin=dump, env=self.restore_env)
container@testserver    |   File "/usr/local/lib/python3.8/site-packages/dbbackup/db/base.py", line 171, in run_command
container@testserver    |     raise exceptions.CommandConnectorError(
container@testserver    | dbbackup.db.exceptions.CommandConnectorError: Error running:  psql --dbname=postgresql://postgres_user:postgres_pass@db:5432/db --set ON_ERROR_STOP=on --single-transaction db
container@testserver    | ERROR:  Unable to remove table "public.betik_app_staff_workinghourmodel" because other objects depend on it
container@testserver    | DETAIL:  **public.betik_app_staff_workinghourmodel_y2022m05** table depends on **public.betik_app_staff_workinghourmodel** table object
@lidyum lidyum changed the title HINT: Use DROP ... CASCADE to also remove linked objects. HINT: Use DROP ... CASCADE to also remove linked objects. Partition table causing error? Nov 23, 2022
@lidyum lidyum changed the title HINT: Use DROP ... CASCADE to also remove linked objects. Partition table causing error? HINT: Use DROP ... CASCADE to also remove linked objects. Partitioning table causing error? Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant