Re: Partition Help

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: akshunj <rickjackson001(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Partition Help
Date: 2015-04-30 18:14:33
Message-ID: CANu8Fix4dXUjGt_UNJeJg2-RcB9AhN4jQRrgXf=NBF050+1u0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rick,

I am glad I could help, but I am not quite sure you understand the
purpose/use of the trigger to
partition the table.

The trigger merely decides which child should get the data, the "query" is
not passed, only the data,
To be more specific, if your appropriate child table were child_1000, then
the insert statement
would be
INSERT INTO child_1000 VALUES (NEW.*);

To insert by column name, then it would be:
INSERT INTO child_1000
( col_a, col_b, col_c)
VALUES
(NEW.col_a, NEW.col_b, NEW.col_c);

On Wed, Apr 29, 2015 at 7:25 PM, akshunj <rickjackson001(at)gmail(dot)com> wrote:

> Melvin, thanks. Syntax was indeed the problem there. Any idea how to pass
> the
> original query to the child table? My insert has 113 parameters passed in,
> but based on the constraint violations I am seeing, it seems they are not
> making. I suspect that: VALUE (NEW.*) does not pass in the original query,
> only the column I used for the comparison?
>
>
>
> --
> View this message in context:
> http://postgresql.nabble.com/Re-Partition-Help-tp5847286p5847360.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
>
> --
> 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
>

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Qingqing Zhou 2015-04-30 18:14:34 how to read all physical rows (visible or not) from a heap
Previous Message Ladislav Lenart 2015-04-30 18:05:30 Re: newsfeed type query