Re: Partition Help - Mailing list pgsql-general

From Melvin Davidson
Subject Re: Partition Help
Date
Msg-id CANu8Fix4dXUjGt_UNJeJg2-RcB9AhN4jQRrgXf=NBF050+1u0A@mail.gmail.com
Whole thread Raw
In response to Re: Partition Help  (akshunj <rickjackson001@gmail.com>)
List 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@gmail.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@postgresql.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.

pgsql-general by date:

Previous
From: Qingqing Zhou
Date:
Subject: how to read all physical rows (visible or not) from a heap
Next
From: "Greg Sabino Mullane"
Date:
Subject: Re: PostgreSQL HA config recommendations