Learn R Programming

rpg (version 1.6)

list_tables: PostgreSQL database information

Description

Get information about tables in a database

Usage

list_tables(only.names = TRUE)

describe_table(tablename, schemaname = NULL)

list_schema(only.names = TRUE)

list_databases(only.names = TRUE)

Arguments

only.names

if true, just list the table names

tablename

the name of a PostgreSQL table

schemaname

if not null, look only in this schema

Value

list_tables: a vector of table names or a data frame

describe_table: a data frame with column information

See Also

psql

Examples

Run this code
# 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