Get information about tables in a database
list_tables(only.names = TRUE)describe_table(tablename, schemaname = NULL)
list_schema(only.names = TRUE)
list_databases(only.names = TRUE)
if true, just list the table names
the name of a PostgreSQL table
if not null, look only in this schema
list_tables
: a vector of table names or a data frame
describe_table
: a data frame with column information
# NOT RUN {
createdb("rpgtesting")
connect("rpgtesting")
begin()
# write data frame contents
data(mtcars)
write_table(mtcars)
# get some information
list_tables()
describe_table("mtcars")
list_schema()
list_databases()
#cleanup
rollback()
disconnect()
dropdb("rpgtesting")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab