It is weird that the index name needs quotation around it. Below command worked absolutely fine and dropped the index as well

drop index my_schema."users_dept_idx"
Answer from newbie on Stack Overflow
🌐
PostgreSQL
postgresql.org › docs › current › sql-dropindex.html
PostgreSQL: Documentation: 18: DROP INDEX
May 14, 2026 - DROP INDEX DROP INDEX — remove an index Synopsis DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] name [, …
Discussions

problem with DROP INDEX
for my query, i create multiple indices and then drop them after the query execution. Why? What problem are you trying to solve with that approach? Can't you just keep the indexes around? More on reddit.com
🌐 r/PostgreSQL
8
0
October 2, 2024
how to create big indexes
https://www.visuality.pl/posts/indexing-partitioned-table---postgres-stories Like this article (and the docs) say, I'd recommend creating an "invalid" index on the table as a whole using ONLY, then create the indexes concurrently on the partitions and attach one at a time. A bit slower, but much safer. You can use this query to generate the create index and alter index statements for the partitions SELECT nmsp_parent.nspname AS parent_schema, parent.relname AS parent, nmsp_child.nspname AS child_schema, child.relname AS child, 'CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_'|| child.relname || 'on_column_name ON ' || child.relname || '(column_name);' as "idx_create", 'ALTER INDEX idx_table_on_column_name ATTACH PARTITION idx' || child.relname || '_on_column_name;' as "idx_alter" FROM pg_inherits JOIN pg_class parent ON pg_inherits.inhparent = parent.oid JOIN pg_class child ON pg_inherits.inhrelid = child.oid JOIN pg_namespace nmsp_parent ON nmsp_parent.oid = parent.relnamespace JOIN pg_namespace nmsp_child ON nmsp_child.oid = child.relnamespace WHERE parent.relname='tablename'; More on reddit.com
🌐 r/PostgreSQL
5
8
June 9, 2024
ERROR: Constraint "constraint_name" of relation "relation_name" does not exist; ERROR relation "relation_name" already exists.
Do you have a constraint named "unique_user_number" on a different table? You can try running DROP INDEX unique_user_number, you will probably get an error message but this will help you figure out what's going on. Or better yet, use the describe feature: \d unique_user_number. I'm not a DBA either, but would imagine that it's better practice to let the database name your constraints for you, so you are less likely to run into a problem like this. ALTER TABLE "users_user" UNIQUE ("user_id, "number"); More on reddit.com
🌐 r/PostgreSQL
2
0
September 13, 2023
When adding a UNIQUE INDEX, is the constraint added automatically?
No. Adding index adds index. Adding contraint adds constraint and and index. Adding index can't make constraint because it's perfectly possible to make unique index that can't be made into constraint. At all. In psql you can see it easily: $ alter table test add constraint whatever_name unique (id); ALTER TABLE $ \d test Table "public.test" Column │ Type │ Collation │ Nullable │ Default ────────┼─────────┼───────────┼──────────┼───────── id │ integer │ │ │ Indexes: "whatever_name" UNIQUE CONSTRAINT, btree (id) $ alter table test drop constraint whatever_name ; ALTER TABLE $ create unique index zzz on test (id); CREATE INDEX $ \d test Table "public.test" Column │ Type │ Collation │ Nullable │ Default ────────┼─────────┼───────────┼──────────┼───────── id │ integer │ │ │ Indexes: "zzz" UNIQUE, btree (id) More on reddit.com
🌐 r/PostgreSQL
9
2
July 11, 2022
🌐
Neon
neon.com › postgresql › indexes › drop-index
PostgreSQL DROP INDEX Statement
Sometimes, you may want to remove an existing index from the database system. To do it, you use the DROP INDEX statement as follows: DROP INDEX [ CONCURRENTLY] [ IF EXISTS ] index_name [ CASCADE | RESTRICT ];
🌐
GeeksforGeeks
geeksforgeeks.org › postgresql › postgresql-drop-index
PostgreSQL - DROP INDEX - GeeksforGeeks
July 15, 2025 - The PostgreSQL DROP INDEX command is used to remove an existing index from a database, freeing up system resources and improving performance. It includes options like IF EXISTS to prevent errors and CONCURRENTLY to drop indexes without blocking ...
🌐
DataCamp
datacamp.com › doc › postgresql › dropping-unused-indexes
PostgreSQL Dropping Unused Indexes
In this syntax, DROP INDEX IF EXISTS index_name removes the index if it exists, preventing error messages if the index is not present.
🌐
PostgreSQL
postgresql.org › docs › current › sql-createindex.html
PostgreSQL: Documentation: 18: CREATE INDEX
May 14, 2026 - Use DROP INDEX to remove an index. Like any long-running transaction, CREATE INDEX on a table can affect which tuples can be removed by concurrent VACUUM on any other table. Prior releases of PostgreSQL also had an R-tree index method.
Find elsewhere
🌐
pgPedia
pgpedia.info › d › drop-index.html
DROP INDEX - pgPedia - a PostgreSQL Encyclopedia
DROP INDEX has always been present in PostgreSQL. ... DROP INDEX IF EXISTS ...
🌐
RisingWave
risingwave.com › home › blog › dropping an index in postgresql: a step-by-step guide
Dropping an Index in PostgreSQL: A Step-by-Step Guide | RisingWave
July 2, 2024 - To remove an existing index in PostgreSQL, use the DROP INDEX statement followed by the name of the index you intend to delete. This straightforward command ensures the seamless elimination of unnecessary indexes from your database schema.
🌐
Shayon Mukherjee
shayon.dev › post › 2024 › 225 › stop-relying-on-if-not-exists-for-concurrent-index-creation-in-postgresql
Stop Relying on IF NOT EXISTS for Concurrent Index Creation in PostgreSQL
August 12, 2024 - When you use `IF NOT EXISTS` and re-run your index creation, the task can silently complete while leaving behind an invalid index.
🌐
EDUCBA
educba.com › home › data science › data science tutorials › postgresql tutorial › postgresql drop index
PostgreSQL DROP INDEX | Examples, Syntax and Parameters
May 12, 2023 - After using concurrent options with the drop index command, it is not possible to perform cascade operations. If it exists: This option is used when the index is not present on the database table; after using these options, it will not show ...
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
PostgreSQL Tutorial
pgtutorial.com › home › postgresql tutorial › postgresql drop index statement
PostgreSQL DROP INDEX statement
March 7, 2025 - The DROP INDEX statement allows you to drop an existing index from a database. Here’s the basic syntax of the DROP INDEX statement: DROP INDEX [CONCURRENTLY] [IF EXISTS] index_name [CASCADE | RESTRICT]Code language: PostgreSQL SQL dialect and PL/pgSQL (pgsql)
🌐
ObjectRocket
kb.objectrocket.com › postgresql › how-to-drop-an-index-in-postgresql-789
How to Drop an Index in PostgreSQL | ObjectRocket
The clause IF EXISTS serves as a conditional option where the specified index name will only be deleted if it exists within the database system. If we tried to remove an index that doesn’t exist while using the IF EXISTS clause, PostgreSQL will return a notification instead of an error.
🌐
CommandPrompt Inc.
commandprompt.com › education › how-to-drop-an-index-in-postgresql
How to Drop an INDEX in PostgreSQL — CommandPrompt Inc.
June 1, 2023 - - The use of the CONCURRENTLY option blocks access to the table while dropping the index. - After that, type the name of the index with the IF EXISTS clause which checks the existence of the index in the table.
Address   2950 Newmarket ST STE 101 - 231, 98226, Bellingham
🌐
DevArt
blog.devart.com › home › products › sql server tools › sql drop index statement with syntax, examples
SQL DROP INDEX Statement: Syntax, Examples
May 5, 2025 - In PostgreSQL and DB2/Oracle, you only need to specify the index name. The database system already knows which table the index belongs to. ... MySQL’s approach is different from that of other database systems.
🌐
PostgreSQL
postgresql.org › message-id › CAKFQuwa=X0bQbPKwMC0HL8Ka+9vSQec-Q8QcgoX=U2BevpxP=w@mail.gmail.com
PostgreSQL: Re: DROP INDEX - dropping index of a table in a named schema
May 22, 2023 - > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/15/sql-dropindex.html > Description: > > I had to find out (as it is not in the given documentation) that to drop an > index for a table in a named schema (later "schemaname.tablename") you have > to prefix the schemaname for the index inte DROP statement. > The create index docs say that an index for a table always exists within the same schema as that table. If that schema isn’t in your search_path then it follows you need to schema qualify references to it.
🌐
GeeksforGeeks
geeksforgeeks.org › sql › sql-drop-index
SQL DROP INDEX Statement - GeeksforGeeks
When an index becomes unnecessary, ... use. PRIMARY KEY / UNIQUE indexes need constraint removal first. IF EXISTS avoids errors when index is missing....
Published   June 19, 2026
🌐
CastorDoc
castordoc.com › how-to › how-to-drop-an-index-in-postgresql
How to Drop an Index in PostgreSQL?
The DROP INDEX command is used to remove an index from a table in PostgreSQL. To drop an index, you need to provide the name of the index and the table it belongs to. Here's the basic syntax: DROP INDEX [IF EXISTS] index_name [CASCADE | RESTRICT];