maigar
maigar

Reputation: 197

Partition table created using 'CREATE TABLE AS'

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

Answers (1)

Erwin Brandstetter
Erwin Brandstetter

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

Related Questions