Re: [COMMITTERS] pgsql: Implement table partitioning.

From: Keith Fiske <keith(at)omniti(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Implement table partitioning.
Date: 2016-12-09 18:23:44
Message-ID: CAG1_KcCfJhpPHg9QSnytshC-K-Hu=mj1i9Jb3_6YA4O2SOto7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Fri, Dec 9, 2016 at 1:13 PM, Amit Langote <amitlangote09(at)gmail(dot)com>
wrote:

> Hi Keith,
>
> On Sat, Dec 10, 2016 at 3:00 AM, Keith Fiske <keith(at)omniti(dot)com> wrote:
> > Being that table partitioning is something I'm slightly interested in,
> > figured I'd give it a whirl.
> >
> > This example in the docs has an extraneous comma after the second column
> >
> > CREATE TABLE cities (
> > name text not null,
> > population int,
> > ) PARTITION BY LIST (initcap(name));
> >
> > And the WITH OPTIONS clause does not appear to be working using another
> > example from the docs. Not seeing any obvious typos.
> >
> > keith(at)keith=# CREATE TABLE measurement_y2016m07
> > keith-# PARTITION OF measurement (
> > keith(# unitsales WITH OPTIONS DEFAULT 0
> > keith(# ) FOR VALUES FROM ('2016-07-01') TO ('2016-08-01');
> > 2016-12-09 12:51:48.728 EST [11711] ERROR: syntax error at or near
> "WITH"
> > at character 80
> > 2016-12-09 12:51:48.728 EST [11711] STATEMENT: CREATE TABLE
> > measurement_y2016m07
> > PARTITION OF measurement (
> > unitsales WITH OPTIONS DEFAULT 0
> > ) FOR VALUES FROM ('2016-07-01') TO ('2016-08-01');
> > ERROR: syntax error at or near "WITH"
> > LINE 3: unitsales WITH OPTIONS DEFAULT 0
> > ^
> > Time: 0.184 ms
> >
> > Removing the unit_sales default allows it to work fine
>
> WITH OPTIONS keyword phrase is something that was made redundant in
> the last version of the patch, but I forgot to remove the same in the
> example. I've sent a doc patch to fix that.
>
> If you try - unitsales DEFAULT 0, it will work. Note that I did not
> specify WITH OPTIONS.
>
> Thanks,
> Amit
>

That works. Thanks!

keith(at)keith=# CREATE TABLE measurement_y2016m07
PARTITION OF measurement (
unitsales DEFAULT 0
) FOR VALUES FROM ('2016-07-01') TO ('2016-08-01');
CREATE TABLE
Time: 4.091 ms

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-12-09 20:27:47 pgsql: Be more careful about Python refcounts while creating exception
Previous Message Amit Langote 2016-12-09 18:13:54 Re: [COMMITTERS] pgsql: Implement table partitioning.

Browse pgsql-hackers by date

  From Date Subject
Next Message Ian Jackson 2016-12-09 18:26:30 [OSSTEST PATCH 0/1] PostgreSQL db: Retry on constraint violation
Previous Message Fabrízio de Royes Mello 2016-12-09 18:18:57 Re: new table partitioning breaks \d table to older versions