How to insert row in PostgreSQL

INSERT command inserts new rows into a table. for this tutorial we already have db created with with name "test_db". "test_db" is having table with name testtable. testtable contains two columns "id" and "name".
if you don't have dbs created than follow the link How to create database and tables in PostgreSQL.to create dbs and tables.

  • Switch to postgres shell with below two commands
  • Switch to database "test_db"
  • Execute insert command

  • Category: PostgreSQL