postgresqlHow do I insert data into a PostgreSQL database?
The following example shows how to insert data into a PostgreSQL database using the INSERT
statement:
INSERT INTO table_name (column1, column2, column3)
VALUES (value1, value2, value3);
Code explanation
**
INSERT INTO
: This is a keyword used to indicate that data is being inserted into the database.table_name
: This is the name of the table that the data will be inserted into.column1, column2, column3
: This is a list of the columns that the data will be inserted into.VALUES
: This is a keyword used to indicate the values that will be inserted into the columns.value1, value2, value3
: This is a list of the values that will be inserted into the columns.
## Helpful links
More of Postgresql
- How do I use the PostgreSQL hash function?
- How do I use PostgreSQL's XMLTABLE to parse XML data?
- How can I troubleshoot zero damaged pages in PostgreSQL?
- How do I use PostgreSQL ZonedDateTime to store date and time information?
- How do I use PostgreSQL's XMIN and XMAX features?
- How can I set a PostgreSQL interval to zero?
- How can I convert XML data to a PostgreSQL table?
- How can I extract the year from a date in PostgreSQL?
- How do I use the PostgreSQL XML type?
- How do I set the PostgreSQL work_mem parameter?
See more codes...