Re: PostgreSQL - Ordering Table based of Foreign Key

2021-10-04 Thread FOUTE K . Jaurès
Hello, Thx for all the feedback. After googling that, I saw this link that can be a way I can go. https://stackoverflow.com/questions/51279588/sort-tables-in-order-of-dependency-postgres Le dim. 3 oct.

Re: PostgreSQL - Ordering Table based of Foreign Key

2021-10-03 Thread David G. Johnston
On Sun, Oct 3, 2021, 00:48 FOUTE K. Jaurès wrote: > Hello, > > I want to order tables based on the foreign key so that I can delete > tables one by one without facing "ERROR: update or delete on table > "table" violates foreign key constraint. DETAIL: Key is still referenced > from table" > As

Re: PostgreSQL - Ordering Table based of Foreign Key

2021-10-03 Thread Adrian Klaver
On 10/3/21 9:24 AM, FOUTE K. Jaurès wrote: Please don't top post, inline/bottom posting is the preferred style on this list. I need to delete data from about 100 table in the production system for a specific client without stopping application. Honestly that is not that much more

Re: PostgreSQL - Ordering Table based of Foreign Key

2021-10-03 Thread FOUTE K . Jaurès
I need to delete data from about 100 table in the production system for a specific client without stopping application. On Sun, 3 Oct 2021, 17:19 Adrian Klaver, wrote: > On 10/3/21 7:40 AM, FOUTE K. Jaurès wrote: > > Thanks for your input but I want to make a delete with where clause > > Then

Re: PostgreSQL - Ordering Table based of Foreign Key

2021-10-03 Thread Adrian Klaver
On 10/3/21 7:40 AM, FOUTE K. Jaurès wrote: Thanks for your input but I want to make a delete with where clause Then Thomas Kellerer's suggestion of having "ON DELETE CASCADE" on the FK would seem to be what you need. If not then you will need to provide more information about what you are

Re: PostgreSQL - Ordering Table based of Foreign Key

2021-10-03 Thread FOUTE K . Jaurès
Thanks for your input but I want to make a delete with where clause On Sun, 3 Oct 2021, 10:26 Andreas Joseph Krogh, wrote: > På søndag 03. oktober 2021 kl. 10:49:49, skrev Thomas Kellerer < > sham...@gmx.net>: > > FOUTE K. Jaurès schrieb am 03.10.2021 um 09:48: > > I want to order tables based

Re: PostgreSQL - Ordering Table based of Foreign Key

2021-10-03 Thread Andreas Joseph Krogh
På søndag 03. oktober 2021 kl. 10:49:49, skrev Thomas Kellerer mailto:sham...@gmx.net>>: FOUTE K. Jaurès schrieb am 03.10.2021 um 09:48: > I want to order tables based on the foreign key so that I can delete > tables one by one without facing "ERROR: update or delete on table > "table"

Re: PostgreSQL - Ordering Table based of Foreign Key

2021-10-03 Thread Thomas Kellerer
FOUTE K. Jaurès schrieb am 03.10.2021 um 09:48: I want to order tables based on the foreign key so that I can delete tables one by one without facing "ERROR: update or delete on table "table" violates foreign key constraint. DETAIL: Key is still referenced from table" You can create the

Re: PostgreSQL - Ordering Table based of Foreign Key

2021-10-03 Thread Karsten Hilbert
Am Sun, Oct 03, 2021 at 08:48:13AM +0100 schrieb FOUTE K. Jaurès: > I want to order tables based on the foreign key so that I can delete tables > one by one without facing "ERROR: update or delete on table "table" > violates foreign key constraint. DETAIL: Key is still referenced from table"

PostgreSQL - Ordering Table based of Foreign Key

2021-10-03 Thread FOUTE K . Jaurès
Hello, I want to order tables based on the foreign key so that I can delete tables one by one without facing "ERROR: update or delete on table "table" violates foreign key constraint. DETAIL: Key is still referenced from table" Any help is appreciated. Thank you in advance. Best regards Jaurès