postgresql_16:7.1.84 CREATE TABLE AS
PostgreSQL 16 > Reference > SQL Commands > CREATE TABLE AS
define a new table from the results of a query
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXISTS ] table_name
[ (column_name [, ...] ) ]
[ USING method ]
[ WITH ( storage_parameter [= value] [, ... ] ) | WITHOUT OIDS ]
[ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
[ TABLESPACE tablespace_name ]
AS query
[ WITH [ NO ] DATA ]
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXISTS ] table_name
[ (column_name [, ...] ) ]
[ USING method ]
[ WITH ( storage_parameter [= value] [, ... ] ) | WITHOUT OIDS ]
[ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
[ TABLESPACE tablespace_name ]
AS query
[ WITH [ NO ] DATA ]
Subsections
- postgresql_16:7.1.84.1 Description
- postgresql_16:7.1.84.2 Parameters
- postgresql_16:7.1.84.3 Notes
- postgresql_16:7.1.84.4 Examples
- postgresql_16:7.1.84.5 Compatibility
- postgresql_16:7.1.84.6 See Also