select open change scope Open full search

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

Unsupported versions: 7.0 / 6.4
Historical version. PostgreSQL 6.4 reached end of support in October 2003. See the current manual for supported releases.

CREATE TABLE AS

Name

CREATE TABLE AS — Creates a new table
CREATE TABLE table [ ( column [, ...] ) ] AS select_clause
  

Inputs

table

The name of a new table to be created.

column

The name of a column. Multiple column names can be specified using a comma-delimited list of column names.

select_clause

A valid query statement. Refer to SELECT for a description of the allowed syntax.

Outputs

Refer to CREATE TABLE and SELECT for a summary of possible output messages.

Description

CREATE TABLE AS enables a table to be created from the contents of an existing table. It has functionality equivalent to SELECT TABLE INTO, but with perhaps a more obvious syntax.

Report a documentation issue

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