Creating PostgreSQL table from command line
Using the psql command, we can populate a table that has already been created in the database: $ psql -h <server-hostname> -d <database> -U <user> -c "COPY <table-name>(col1, col2, col3, col4) FROM STDIN with delimiter as ','" < csvfile.csv For example: $ psql -h mypersonalserver.csdfklecf.us-east-1.rds.amazonaws.com -d blogdb -U readonly -c "COPY posts(nid, title, created, username, author, path, series) FROM STDIN with delimiter as ','" < historical_posts.csv I've found that I have used this many time to get a quick look at some data. It is one way to populate a table in seconds with one command!