PostgreSQL - How to insert rows of data into a table?
To insert a full row of data to PostgreSQL table:
INSERT INTO table_name
VALUES('value1', 'value2', 'value3', 'value4', 'value5', 'value6');
If you want to insert value to some specific columns:
INSERT INTO table_name (col1, col2, col3, col4, col6)
VALUES('value1', 'value2', 'value3', 'value4', 'value6');
If you want to use the default value for a data cell, use DEFAULT
INSERT INTO table_name (col1, col2, col3, col4, col6)
VALUES('value1', DEFAULT, 'value3', 'value4', 'value6');
Or insert default values for the entire row:
INSERT INTO table_name DEFAULT VALUES;
Insert multiple rows of data:
INSERT INTO table_name (col1, col2, col3, col4, col5, col6) VALUES
('value1_1', 'value2_1', 'value3_1', 'value4_1', 'value5_1' 'value6_1')
('value1_2', 'value2_2', 'value3_2', 'value4_2', 'value5_2' 'value6_2');
In TablePlus, insert data from the GUI Tool:
Double-click on the empty row at the end of the Table, or click on the + Row
button
TablePlus is a modern, native tool with an elegant UI that allows you to simultaneously manage multiple databases such as MySQL, PostgreSQL, SQLite, Microsoft SQL Server and more.
Not on Mac? Download TablePlus for Windows.
On Linux? Download TablePlus for Linux
Need a quick edit on the go? Download TablePlus for iOS.