I was wondering how to drop an index in postgresql. I know to use DROP INDEX, but many of the examples I see online show creating an index and dropping the known index such as this site: https://www.geeksforgeeks.org/postgresql-drop-index/.
However, what I am looking for is going into a table and just dropping already existing indexes. I found this site that tells me how to show the different index names and index defs: https://www.postgresqltutorial.com/postgresql-indexes/postgresql-list-indexes/, but not sure how to drop the indexes from here. Or in other words, how would I get/query an index name from the database, and then drop that index?
I'm quite new to sql and querying in general so I was wondering if the way to do this is to make a new table based on the SELECT/FROM/WHERE and this way I would have access to the index names and defs in a table which I could use to drop them? Could I just replace the SELECT with a DROP INDEX? Is there a better way to do this?