pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
DROP INDEX - dropping index of a table in a named schema
2+ messages / 2 participants
[nested] [flat]

* DROP INDEX - dropping index of a table in a named schema
@ 2023-05-22 13:43 PG Doc comments form <noreply@postgresql.org>
  2023-05-22 14:13 ` Re: DROP INDEX - dropping index of a table in a named schema David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Doc comments form @ 2023-05-22 13:43 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: pugin2011ilya@gmail.com

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


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: DROP INDEX - dropping index of a table in a named schema
  2023-05-22 13:43 DROP INDEX - dropping index of a table in a named schema PG Doc comments form <noreply@postgresql.org>
@ 2023-05-22 14:13 ` David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: David G. Johnston @ 2023-05-22 14:13 UTC (permalink / raw)
  To: pugin2011ilya@gmail.com <pugin2011ilya@gmail.com>; pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

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.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2023-05-22 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-05-22 13:43 DROP INDEX - dropping index of a table in a named schema PG Doc comments form <noreply@postgresql.org>
2023-05-22 14:13 ` David G. Johnston <david.g.johnston@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox