select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Unsupported versions: 7.1
Historical version. PostgreSQL 7.1 reached end of support in April 2006. See the current manual for supported releases.

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.

Report a documentation issue

Read the upstream documentation. For corrections, first check the current manual.