DROP INDEX - dropping index of a table in a named schema

Started by PG Bug reporting formalmost 3 years ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

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.

Consider
CREATE INDEX indexname ON schemaname.tablename (<some columns>)

To drop it you will have to perform
DROP INDEX schemaname.indexname
(as I have read that indices are tied to schemas)

The following statement will fail (which was not clear from documentation)
DROP INDEX indexname

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: PG Bug reporting form (#1)
Re: DROP INDEX - dropping index of a table in a named schema

On Monday, May 22, 2023, PG Doc comments form <noreply@postgresql.org>
wrote:

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.

David J.