The PostgreSQL database server can be accessed from R through the RPostgreSQL library. You can either create a new database, insert data into an existing database, or perform queries on the existing data tables. In this recipe, you will connect R with the PostgreSQL database server and create a table under the postgres database, and insert data into the database.