vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Marcelo Costa wrote: > Hi to all, > > Anybody can help me how to proced to delete all index from my database, > exists any command to this ? Sure, you can create a PL/pgSQL function that loops around a "select relname from pg_class where relkind='i' AND ..." and then issues DROP INDEX for each (or you can do it in shell). Be careful to include a clause to select only indexes that are not in system catalogs! -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support ---------------------------(end of broadcast)--------------------------- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate |
| |||
| On 27/11/06, Alvaro Herrera <alvherre@commandprompt.com> wrote: > Marcelo Costa wrote: > > Hi to all, > > > > Anybody can help me how to proced to delete all index from my database, > > exists any command to this ? > > Sure, you can create a PL/pgSQL function that loops around a "select > relname from pg_class where relkind='i' AND ..." and then issues DROP > INDEX for each (or you can do it in shell). Be careful to include a > clause to select only indexes that are not in system catalogs! > > -- Why do you want to? If you are going to do that you'll have problems with Primary Keys because you can't drop primary key indexes with drop index so you'll get quite a few error messages. If you want to remove them you need "alter table x drop constraint y;" Peter. ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |
| |||
| > >Marcelo Costa wrote: > >> Hi to all, > >> > >> Anybody can help me how to proced to delete all index from my database, > >> exists any command to this ? BTW if you speak spanish you may find yourself more comfortable on the pgsql-es-ayuda list. (This is addressed to Marcelo, somewhere the "From/Cc" list was trimmed so I don't have his address here. Please don't do that.) -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |
| ||||
| Hi, Alvaro, thanks, I make a function to do this. [],s Marcelo. 2006/11/27, Alvaro Herrera <alvherre@commandprompt.com>: > > Marcelo Costa wrote: > > Hi to all, > > > > Anybody can help me how to proced to delete all index from my database, > > exists any command to this ? > > Sure, you can create a PL/pgSQL function that loops around a "select > relname from pg_class where relkind='i' AND ..." and then issues DROP > INDEX for each (or you can do it in shell). Be careful to include a > clause to select only indexes that are not in system catalogs! > > -- > Alvaro Herrera > http://www.CommandPrompt.com/ > PostgreSQL Replication, Consulting, Custom Development, 24x7 support > -- Marcelo Costa |