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 [, …
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί postgresql β€Ί postgresql-drop-index
PostgreSQL - DROP INDEX - GeeksforGeeks
July 15, 2025 - Before dropping an index, use the EXPLAIN statement to analyze whether the index is being used by the query optimizer. To avoid errors during the removal process, use the IF EXISTS option. Be cautious of dependent objects when using the CASCADE option. Use the CONCURRENTLY option to minimize the impact on database availability during the index removal. The PostgreSQL DROP INDEX command is a powerful tool for managing and optimizing your database.
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
🌐
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. CREATE INDEX idx_customer_name ON customers (customer_name); This example creates an index on the customer_name column of the customers table to enhance query ...
🌐
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.
Call Β  +1-503-667-4564
Address Β  2950 Newmarket ST STE 101 - 231, 98226, Bellingham
🌐
Neon
neon.com β€Ί postgresql β€Ί postgresql-indexes β€Ί postgresql-drop-index
PostgreSQL DROP INDEX Statement
February 28, 2024 - 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 ];
🌐
EDUCBA
educba.com β€Ί home β€Ί data science β€Ί data science tutorials β€Ί postgresql tutorial β€Ί postgresql drop index
PostgreSQL DROP INDEX | Examples, Syntax and Parameters
May 12, 2023 - If exists parameter will skip the index. ... In the below example, we have used the parameter concurrently with the drop index command. We have drop the c_index from the student table. \d+ student drop index concurrently "c_index"; \d+ student Β· We hope that this EDUCBA information on β€œPostgreSQL DROP INDEX” was beneficial to you.
Call Β  +917738666252
Address Β  Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
ObjectRocket
kb.objectrocket.com β€Ί postgresql β€Ί how-to-drop-an-index-in-postgresql-789
How to Drop an Index in PostgreSQL | ObjectRocket
In some cases, PostgreSQL’s built-in optimizer will not use an index if PostgreSQL finds it more efficient to just browse the whole table. We can see an example of this in action with the following query: You’ll get results that look something like this: We can see that the index idx_leader_first_name isn’t very useful at this moment; therefore, we’ll delete it using the DROP INDEX command:
Find elsewhere
🌐
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)
🌐
Sqliz
sqliz.com β€Ί postgresql β€Ί drop-index
PostgreSQL Drop Indexes
In PostgreSQL, you can drop an existing index from a table using the DROP INDEX statement. Sometimes, you may wish to drop existing indexes from your database system. To do this, you can use the following DROP INDEX statement: DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] name [ CASCADE | RESTRICT ];
🌐
Datareportive
datareportive.com β€Ί tutorial β€Ί postgresql β€Ί how-to-drop-an-index
How to Drop an Index in PostgreSQL | DataReportive Tutorials
This command removes the idx_users_email index if it exists. If an index is used by other objects like constraints, you can use CASCADE to automatically drop those dependent objects:
🌐
Linux Hint
linuxhint.com β€Ί create-drop-index-postgres
Linux Hint – Linux Hint
March 4, 2022 - Linux Hint LLC, [email protected] 1210 Kelly Park Circle, Morgan Hill, CA 95037 Privacy Policy and Terms of Use
🌐
PHP
durak.org β€Ί sean β€Ί pubs β€Ί software β€Ί postgresql-9.2.0 β€Ί sql-dropindex.html
DROP INDEX - PostgreSQL 9.2.0 Documentation
DROP INDEX drops an existing index from the database system. To execute this command you must be the owner of the index. ... Do not throw an error if the index does not exist. A notice is issued in this case. ... When this option is used, PostgreSQL will drop the index without taking any locks that prevent concurrent selects, inserts, updates, or deletes on the table; whereas a standard index drop waits for a lock that locks out everything on the table until it's done.
🌐
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. When executing the DROP INDEX command in PostgreSQL, you have the option to include IF EXISTS to prevent errors if the specified index does not exist.
🌐
TechOnTheNet
techonthenet.com β€Ί postgresql β€Ί indexes.php
PostgreSQL: Indexes
In this example, we've dropped an index called websites_idx from the websites table. You can rename an index in PostgreSQL using the ALTER INDEX statement. The syntax to rename an index using the ALTER INDEX statement is: ALTER INDEX [IF EXISTS] index_name, RENAME TO new_index_name;
🌐
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];
🌐
PostgreSQL
postgresql.org β€Ί docs β€Ί 9.3 β€Ί sql-dropindex.html
PostgreSQL: Documentation: 9.3: DROP INDEX
August 21, 2021 - Do not throw an error if the index does not exist. A notice is issued in this case. ... The name (optionally schema-qualified) of an index to remove. ... Automatically drop objects that depend on the index. ... Refuse to drop the index if any objects depend on it. This is the default. ... DROP INDEX is a PostgreSQL ...