Re: Table Partition

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: dpandey(at)secf(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Table Partition
Date: 2005-04-22 15:15:01
Message-ID: 1114182901.13303.55.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2005-04-22 at 05:51, Dinesh Pandey wrote:
> How to create this table (with partition) in Postgres.
>
>
>
> --ORACLE
>
> CREATE TABLE A (col1 NUMBER NOT NULL,
>
> col2 DATE NOT NULL,
>
> col3 VARCHAR2(500)
>
> )
>
> PARTITION BY RANGE (col2) (
>
> PARTITION partition_one VALUES LESS THAN
> (TO_DATE('01/04/2001', 'DD/MM/YYYY')) TABLESPACE MYTABSPACE
>
> );

Unfortunately, postgresql does not currently support partitioning.

If you want this, you'll have to "roll your own" so to speak. You'll
need to create two different tables in two different tablespaces, create
a view on top of them, and then create on update triggers to put the
data into the right table when it comes in.

it's a pain, but it works.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2005-04-22 15:27:22 Re: Table modifications with dependent views - best
Previous Message Scott Marlowe 2005-04-22 15:08:46 Re: UltraSPARC versus AMD