INSERT

Insert rows or column values into a table either by selecting them from other tables or by specifying a list of values to insert.

[ WITH name AS (subquery) [, ...] ]
INSERT INTO table_name [ AS alias ] [ ( column_name [, ...] ) ]
    { DEFAULT VALUES | VALUES ( { expression } [, ...] ) [, ...] | query }
WITH
See WITH Clause for syntax details.
DEFAULT VALUES
Insert all columns with default values if they are defined; otherwise, insert NULL values.
VALUES(expression [,…]
Insert a list of specific values into the table. You do not have to specify values for all columns.
VALUES (DEFAULT [,…])
Insert the specified columns with default values if they are defined; otherwise, insert NULL values.
Note: You can define WLM rules for INSERT INTO...SELECT statements but not for INSERT INTO...VALUES statements. INSERT INTO...VALUES operations are not executed by the backend database.
query
Insert the results of any valid query into the named table. Use a SELECT statement.
For example, insert a set of values into the season table:
premdb=# insert into season 
values(26, '2017-2018', 20, null);
INSERT 0 1
For example, load the hometeam table by selecting from the team table:
premdb=# insert into hometeam 
select htid,name from team;
INSERT 0 50
Insert a row of NULL values into the season table, which has no DEFAULT values assigned to its columns:
premdb=# insert into season default values;
INSERT 0 1
Select data from an external table and insert it into a regular database table. You do not have to declare the column list for the file in this case; it is optional. The USING clause is required. See External Tables and USING Options.
premdb=# insert into season 
select * from external 'ext_db/season.csv' 
using(format csv);
INSERT 0 25

The external table in this statement uses the schema of the target table (season). The columns in the external data file must be in the same order as they are in the target table, and every column in the target table must also exist in the external file.