Re: Dropping dependent tables

2021-06-03 Thread Tiffany Thang
On Thu, Jun 3, 2021 at 10:18 AM Tom Lane wrote: > Tiffany Thang writes: > > I would like to write a SQL statement to drop all the tables owned by me > > but a problem I’m struggling with is with referential integrity. The > > statement I have now to generate the drop statements is > > > select '

Re: Dropping dependent tables

2021-06-03 Thread Tom Lane
Tiffany Thang writes: > I would like to write a SQL statement to drop all the tables owned by me > but a problem I’m struggling with is with referential integrity. The > statement I have now to generate the drop statements is > select 'drop table '||tablename||' cascade;' from pg_tables where > t

Dropping dependent tables

2021-06-03 Thread Tiffany Thang
Hi, I would like to write a SQL statement to drop all the tables owned by me but a problem I’m struggling with is with referential integrity. The statement I have now to generate the drop statements is select 'drop table '||tablename||' cascade;' from pg_tables where tableowner=''; The generated