Re: How to add partitions to the existing table in PostgreSQL

Поиск
Список
Период
Сортировка
От Nagaraj Raj
Тема Re: How to add partitions to the existing table in PostgreSQL
Дата
Msg-id 244012893.2409051.1601970602436@mail.yahoo.com
обсуждение исходный текст
Ответ на How to add partitions to the existing table in PostgreSQL  (Naveen Kumar <naveenmcp@gmail.com>)
Ответы Re: How to add partitions to the existing table in PostgreSQL  (Naveen Kumar <naveenmcp@gmail.com>)
Список pgsql-admin

There is no way to add a partition to an existing table. All you need to do create a new table with the partition on the desired column and copy data from old to new then do alter table name. 



Thanks,
Rj





On Monday, October 5, 2020, 11:31:28 PM PDT, Naveen Kumar <naveenmcp@gmail.com> wrote:


How to add partitions to the existing table in PostgreSQL

for ex, below is my table definition:

CREATE TABLE ot.employee
(
    empno smallint NOT NULL,
    ename character varying(20),
    job character varying(20),
    deptno smallint
)

Now I would like to add partition to deptno column

I don't see any alter table command to add the partition to the existing table.

Please help me on this.

Thank you
Naveen

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

Предыдущее
От: Paul Förster
Дата:
Сообщение: Re: How to return multiple rows by stored procedure in postgresql
Следующее
От: Holger Jakobs
Дата:
Сообщение: Re: How to return multiple rows by stored procedure in postgresql