pgListIndexes: List indexes of a database

Description Usage Arguments Value Examples

View source: R/db_tables_managment.R

Description

List all indexes attached to tables of a database.

Usage

1
pgListIndexes(conn, tables)

Arguments

conn

a PostgreSQLConnection object.

tables

character vector; tables names from wich to list indexes. If NULL (default), all indexes all returned.

Value

a dataframe.

Examples

1
2
3
4
5
6
7
8
library(RPostgreSQL)
data(mtcars)
conn = dbConnect(drv=dbDriver("PostgreSQL"), host="localhost", port=5432,
                dbname="postgres", user="milo", password="postgres")
dbWriteTable(conn, "mtcars", mtcars, overwrite=TRUE)
dbSendQuery(conn, "CREATE INDEX IF NOT EXISTS mpg_idx ON mtcars USING btree(mpg);")
head(pgListIndexes(conn, "mtcars"))
dbDisconnect(conn)

MiloMonnier/postgisr documentation built on Feb. 16, 2021, 8:03 p.m.