![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I want to drop all tables which start with a common prefix. I found this solution. Are there better/different ones? psql -t -d mydb -c "SELECT 'DROP TABLE ' || tablename || ' CASCADE ;' FROM pg_catalog.pg_tables where tablename like 'myprefix_%'" > droptables psql -d mydb -f droptables |
#3
| |||
| |||
|
|
I want to drop all tables which start with a common prefix. I found this solution. Are there better/different ones? psql -t -d mydb -c "SELECT 'DROP TABLE ' || tablename || ' CASCADE ;' FROM pg_catalog.pg_tables where tablename like 'myprefix_%'" > droptables psql -d mydb -f droptables |
#4
| |||
| |||
|
|
I want to drop all tables which start with a common prefix. I found this solution. Are there better/different ones? psql -t -d mydb -c "SELECT 'DROP TABLE ' || tablename || ' CASCADE ;' FROM pg_catalog.pg_tables where tablename like 'myprefix_%'" > droptables psql -d mydb -f droptables |
#5
| |||
| |||
|
|
I want to drop all tables which start with a common prefix. I found this solution. Are there better/different ones? psql -t -d mydb -c "SELECT 'DROP TABLE ' || tablename || ' CASCADE ;' FROM pg_catalog.pg_tables where tablename like 'myprefix_%'" > droptables psql -d mydb -f droptables |
#6
| |||
| |||
|
|
I want to drop all tables which start with a common prefix. I found this solution. Are there better/different ones? psql -t -d mydb -c "SELECT 'DROP TABLE ' || tablename || ' CASCADE ;' FROM pg_catalog.pg_tables where tablename like 'myprefix_%'" > droptables psql -d mydb -f droptables |
#7
| |||
| |||
|
|
I want to drop all tables which start with a common prefix. I found this solution. Are there better/different ones? psql -t -d mydb -c "SELECT 'DROP TABLE ' || tablename || ' CASCADE ;' FROM pg_catalog.pg_tables where tablename like 'myprefix_%'" > droptables psql -d mydb -f droptables |
#8
| |||
| |||
|
|
I want to drop all tables which start with a common prefix. I found this solution. Are there better/different ones? psql -t -d mydb -c "SELECT 'DROP TABLE ' || tablename || ' CASCADE ;' FROM pg_catalog.pg_tables where tablename like 'myprefix_%'" > droptables psql -d mydb -f droptables |
#9
| |||
| |||
|
|
I want to drop all tables which start with a common prefix. I found this solution. Are there better/different ones? psql -t -d mydb -c "SELECT 'DROP TABLE ' || tablename || ' CASCADE ;' FROM pg_catalog.pg_tables where tablename like 'myprefix_%'" > droptables psql -d mydb -f droptables |
![]() |
| Thread Tools | |
| Display Modes | |
| |