Re: about partitioning

From: kevin kempter <kevin(at)kevinkempterllc(dot)com>
To: Joao Ferreira gmail <joao(dot)miguel(dot)c(dot)ferreira(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: about partitioning
Date: 2008-09-15 22:52:20
Message-ID: 96681D11-42D7-436F-920B-0196C1A7C5F2@kevinkempterllc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I may be wrong and I didn't double check the docs but I think you need
this (leave the INTO keyword off):

> CREATE RULE measurement_update_y2004m02 AS ON UPDATE TO measurement
> WHERE ( logdate >= DATE '2004-02-01' AND logdate < DATE '2004-03-01' )
> DO INSTEAD UPDATE measurement_y2004m02 VALUES (NEW.city_id,
> NEW.logdate, NEW.peaktemp, NEW.unitsales)

On Sep 15, 2008, at 4:48 PM, Joao Ferreira gmail wrote:

> Hi Robert and all,
>
>
> I've been trying to follow the examples on the pg docs, section 5.9,
> with your presentation as aditional guide.
>
> I've bumped into the UPDATES. I'm getting this:
>
> ----------------------------------------------------------
> CREATE RULE measurement_update_y2004m02 AS ON UPDATE TO measurement
> WHERE ( logdate >= DATE '2004-02-01' AND logdate < DATE '2004-03-01' )
> DO INSTEAD UPDATE INTO measurement_y2004m02 VALUES (NEW.city_id,
> NEW.logdate, NEW.peaktemp, NEW.unitsales);
> ERROR: syntax error at or near "INTO"
> LINE 1: ...D logdate < DATE '2004-03-01' ) DO INSTEAD UPDATE INTO
> measu...
> -------------------------------------------------
>
> it doesn't like the INTO part.
>
> can you help me?
>
> thanks
> joao
>
>
>
> On Sat, 2008-09-13 at 16:48 -0400, Robert Treat wrote:
>> On Thursday 11 September 2008 07:47:00 Joao Ferreira gmail wrote:
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2008-09-15 22:55:07 Re: Oracle and Postgresql
Previous Message Joao Ferreira gmail 2008-09-15 22:48:49 Re: about partitioning