PostgreSQL: Documentation: 8.1: CREATE TABLE AS

<< turns out there was already a way to create tables with data

Search Documentation: Home → Documentation → Manuals → PostgreSQL 8.1 This page in other versions: 9.0 / 9.1 / 9.2 / 9.3 / 9.4 |  Development versions: devel |  Unsupported versions: 7.1 / 7.2 / 7.3 / 7.4 / 8.0 / 8.1 / 8.2 / 8.3 / 8.4 PostgreSQL 8.1.23 Documentation Prev Fast Backward Fast Forward Next CREATE TABLE AS -- define a new table from the results of a query CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name [ ( column_name [, ...] ) ] [ [ WITH | WITHOUT ] OIDS ] AS query CREATE TABLE AS creates a table and fills it with data computed by a SELECT command or an EXECUTE that runs a prepared SELECT command. The table columns have the names and data types associated with the output columns of the SELECT (except that you can override the column names by giving an explicit list of new colum...

Linked on 2015-05-28 23:59:29 | Similar Links