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

From: Naveen Kumar <naveenmcp(at)gmail(dot)com>
To: Nagaraj Raj <nagaraj(dot)sf(at)yahoo(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How to add partitions to the existing table in PostgreSQL
Date: 2020-10-06 08:21:52
Message-ID: CAN+uLsHxomCKzT=YSaYro04bbhnF1iTJ7AP2K113G6hPaq_tNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thanks Raj.

Regards
Naveen

On Tue, Oct 6, 2020 at 1:20 PM Nagaraj Raj <nagaraj(dot)sf(at)yahoo(dot)com> wrote:

>
> 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(at)gmail(dot)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
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Naveen Kumar 2020-10-06 08:24:53 Re: How to return multiple rows by stored procedure in postgresql
Previous Message Holger Jakobs 2020-10-06 08:00:55 Re: How to return multiple rows by stored procedure in postgresql