CREATE TABLE AS statement
PostgreSQL CREATE TABLE AS statement is used to create a table from an existing table by copying columns of a current table. It is important to note that building a table will fill the new table with records from the existing table (based on the SELECT operator).

The syntax for CREATE TABLE AS in PostgreSQL
CREATE TABLE new_table AS
SELECT expressions
FROM existing_tables
[WHERE conditions];
Parameters and arguments of the statement
- table_name – The name of the table you want to create.
- expressions – Columns from existing_tables that you want to create in new_table. Will move the definitions of the columns from these columns to the new_table you made.
- existing_tables – Existing tables from which you can copy the column definitions and related entries (as suggested by WHERE).
- WHERE conditions – Optional. Requirements that must meet to copy records to the new_table.
Note:
- will copy column definitions from existing_tables to the new_table.
- new_table will be filled with entries based on conditions in the WHERE proposal.
Take the example of PostgreSQLCREATE TABLE, which shows how to create a table by copying all columns from another table.
CREATE TABLE current_inventory AS
SELECT *
FROM products
WHERE quantity > 0;
In this example, we will create a new table named current_inventory, including all columns from the products table. If the products table has records, fill the new current_inventory table with descriptions returned by the SELECT operator. Meanwhile, all entries from the product table with a number greater than 0 will be inserted into the current_inventory table when it is created.
Next, consider CREATE TABLE AS, which shows how to create a table by copying selected columns from multiple tables.
For example:
CREATE TABLE current_inventory AS
SELECT products.product_id, products.product_name, categories.category_name
FROM products
INNER JOIN categories
ON products.category_id = categories.category_id
WHERE products.quantity > 0;
This example will create a new table named current_inventory based on the column definitions from the products and categories tables. Also, the new current_inventory table will only add entries that satisfy the SELECT operator conditions.
PostgreSQL: Creating Tables with Constraints | Course
About Enteros
IT organizations routinely spend days and weeks troubleshooting production database performance issues across multitudes of critical business systems. Fast and reliable resolution of database performance problems by Enteros enables businesses to generate and save millions of direct revenue, minimize waste of employees’ productivity, reduce the number of licenses, servers, and cloud resources and maximize the productivity of the application, database, and IT operations teams.
The views expressed on this blog are those of the author and do not necessarily reflect the opinions of Enteros Inc. This blog may contain links to the content of third-party sites. By providing such links, Enteros Inc. does not adopt, guarantee, approve, or endorse the information, views, or products available on such sites.
Are you interested in writing for Enteros’ Blog? Please send us a pitch!
RELATED POSTS
What Drives Growth in Technology Platforms: Enteros AI SQL, Database Management, and Performance Metrics
- 11 March 2026
- Database Performance Management
Introduction Technology platforms have become the backbone of the modern digital economy. From SaaS products and cloud-native applications to AI-powered analytics and global digital marketplaces, technology enterprises rely on robust infrastructure to deliver reliable, scalable services to millions of users. At the center of these digital ecosystems lies one of the most critical components of … Continue reading “What Drives Growth in Technology Platforms: Enteros AI SQL, Database Management, and Performance Metrics”
How to Modernize Fashion Data Platforms with Enteros Database Management and Generative AI
Introduction The global fashion industry has transformed dramatically in the digital era. Once driven primarily by seasonal collections and physical retail, fashion brands today rely heavily on digital platforms, e-commerce marketplaces, data analytics, and AI-powered customer experiences. From trend forecasting and inventory management to real-time customer engagement, modern fashion businesses are powered by complex data … Continue reading “How to Modernize Fashion Data Platforms with Enteros Database Management and Generative AI”
How Banking Platforms Achieve Accurate Cost Estimation with Enteros GenAI and Cloud Cost Attribution
- 10 March 2026
- Database Performance Management
Introduction The banking industry is undergoing one of the most significant technological transformations in its history. Digital banking platforms, mobile payment systems, AI-powered fraud detection, and real-time financial analytics are now fundamental components of modern banking operations. These innovations rely on powerful cloud infrastructure and highly optimized databases to process millions of financial transactions every … Continue reading “How Banking Platforms Achieve Accurate Cost Estimation with Enteros GenAI and Cloud Cost Attribution”
From Performance Monitoring to Growth Intelligence: Enteros AIOps for Technology Enterprises
Introduction Technology enterprises are operating in an era where digital platforms determine market success. Software products, cloud platforms, SaaS applications, data analytics tools, and AI-powered systems are the backbone of modern businesses. Behind these digital services lies an intricate ecosystem of databases, cloud infrastructure, and applications that must operate at peak performance. For technology companies, … Continue reading “From Performance Monitoring to Growth Intelligence: Enteros AIOps for Technology Enterprises”