16th June 2022: PostgreSQL 14.4 Released!
Unsupported versions: 7.1
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead.

4.6. Redirecting SELECT Queries

Any SELECT query can be redirected to a new table

SELECT * INTO TABLE temp FROM weather;

This forms an implicit CREATE command, creating a new table temp with the column names and types specified in the target list of the SELECT INTO command. We can then, of course, perform any operations on the resulting table that we can perform on other tables.