PostgreSQL stores much of its metadata in system catalogs that are accessible to a connected user. This function takes a connection and returns the database catalog as a data frame.

sp_pg_catalog(connection)

Arguments

connection

A valid open DBI connection to a PostgreSQL database.

Value

A data frame with the contents of the database catalog. The columns are schemas, name, and type, where type is "matview" (materialized view), "view" or "table".

Examples

if (FALSE) { library(sqlpetr) library(dplyr) connection <- sp_get_postgres_connection( user = "postgres", password = "postgres", dbname = "dvdrental" ) print(sp_pg_catalog(connection)) }