Creating a partition table

Поиск
Список
Период
Сортировка
От John Scalia
Тема Creating a partition table
Дата
Msg-id BFBB87D2-4AFB-4B2A-A140-E19860849936@gmail.com
обсуждение исходный текст
Ответы Re: Creating a partition table  (Laurenz Albe <laurenz.albe@cybertec.at>)
Re: Creating a partition table  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
Hi all,

I have a PostgreSQL server version 11.3 that my devs are asking for some partitioned tables. I can’t seem to get the
syntaxcorrect though. My SQL code is: 

CREATE TABLE schema.temp_table
AS (SELECT * FROM schema.original_table)
PARTITION BY LIST(attribute_name);

As what I want to do is create a copy of the current table, create the partitions on the new temp table, and when
everythingworks, drop the original table and do an alter table rename on the new one. 

The error is:
ERROR: syntax error at or near “PARTITION”
Line 3: PARTITION BY LIST(attribute_name);

I’ve tried using the word RANGE as opposed to LIST, but the error remains. Does PostgreSQL not support a construct like
thisone or am I doing something wrong? 
—
Jay

Sent from my iPad


В списке pgsql-admin по дате отправления:

Предыдущее
От:
Дата:
Сообщение: RE: TCP/IP connections refused
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: Creating a partition table