RefLib

Reference library for AI

Back

postgresql_16:7.1.171.3 Notes

PostgreSQL 16 > Reference > SQL Commands > SELECT INTO > Notes

CREATE TABLE AS (see postgresql_16:7.1.84) is functionally similar to SELECT INTO. CREATE TABLE AS is the recommended syntax, since this form of SELECT INTO is not available in ECPG or PL/pgSQL, because they interpret the INTO clause differently. Furthermore, CREATE TABLE AS offers a superset of the functionality provided by SELECT INTO.

In contrast to CREATE TABLE AS, SELECT INTO does not allow specifying properties like a table's access method with (see sql-createtable-method) or the table's tablespace with (see sql-createtable-tablespace). Use CREATE TABLE AS if necessary. Therefore, the default table access method is chosen for the new table. See (see guc-default-table-access-method) for more information.

Back