Re: pg_restore option --clean

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



But it does not work for the structure
# CONSTRAINT test FOREIGN KEY (id_tab_key) REFERENCES tab(id) ON DELETE cascade ON UPDATE CASCADE

ERROR:  cannot drop table tab because other objects depend on it

Regards,

Fabrice

On Wed, Feb 21, 2024 at 12:47 PM M Sarwar <sarwarmd02@xxxxxxxxxxx> wrote:
Look around for

ALTER TABLE TABLE-NAME
  ADD constraint fk-name foreign key col-name refers to tab-name ( col-name )
     on UPDATE cascase
   on DELETE CASCADE
;
Good luck,
Sarwar


From: Fabrice Chapuis <fabrice636861@xxxxxxxxx>
Sent: Wednesday, February 21, 2024 4:17 AM
To: pgsql-admin@xxxxxxxxxxxxxxxxxxxx <pgsql-admin@xxxxxxxxxxxxxxxxxxxx>
Subject: Fwd: pg_restore option --clean
 


Hi,
The --clean option of pg_restore allows you to replace an object before being imported. However, dependencies such as foreign keys or views prevent the deletion of the object. Is there a way to add the cascade option to force the deletion?
Thanks for helping
Fabrice

[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux