Reputation: 197
How do we partition a table created using the CREATE TABLE AS
command in PostgreSQL. I tried the following:
CREATE TABLE schema.table2 AS TABLE schema.table1 PARTITION BY LIST(col1)
but it gives this error:
ERROR: syntax error at or near "PARTITION"
Upvotes: 1
Views: 63
Reputation: 656241
That's not possible.
CREATE TABLE AS
is different from CREATE TABLE
and only supports a subset of features for the latter.
Upvotes: 1