Here is a working example of trigger based partitioning with a view and
'do instead' that works with ORM tools using the affected rows return
(example attached).
The key things that make it work are:
1. RETURN NEW; (in the function after inserting into the partition)
2. INSTEAD OF INSERT (in th
On 03/23/2016 02:48 AM, Chris Travers wrote:
On Wed, Mar 23, 2016 at 9:39 AM, Chris Travers
mailto:chris.trav...@gmail.com>> wrote:
Use a view with a DO INSTEAD trigger. That will allow you to
return the tuple properly.
On Tue, Mar 22, 2016 at 7:40 PM, CS DBA
mailto:cs_...
On Wed, Mar 23, 2016 at 9:39 AM, Chris Travers
wrote:
> Use a view with a DO INSTEAD trigger. That will allow you to return the
> tuple properly.
>
> On Tue, Mar 22, 2016 at 7:40 PM, CS DBA
> wrote:
>
>> Hi All;
>>
>> we setup partitioning for a large table but had to back off because the
>> r
Use a view with a DO INSTEAD trigger. That will allow you to return the
tuple properly.
On Tue, Mar 22, 2016 at 7:40 PM, CS DBA wrote:
> Hi All;
>
> we setup partitioning for a large table but had to back off because the
> return status (i.e: "INSERT 0 1") returns "INSERT 0 0" when inserting i
On 3/22/2016 2:20 PM, CS DBA wrote:
I would think the ORM (as yet undefined) would want to think in terms
of the parent table and not know about the physical schema details.
Can the client not be written to check only for errors vs checking
for non-zero inserts?
That was our first suggesti
> So the ORM is parsing the INSERT return value, correct?
>
> Would something like this(borrowing from docs example) freak it out?:
>
> CREATE OR REPLACE FUNCTION measurement_insert_trigger()
> RETURNS TRIGGER AS $$
> DECLARE
>_ct int;
> BEGIN
>INSERT INTO measurement_y2016m03 VALUES (NEW
> So the ORM is parsing the INSERT return value, correct?
>
> Would something like this(borrowing from docs example) freak it out?:
>
> CREATE OR REPLACE FUNCTION measurement_insert_trigger()
> RETURNS TRIGGER AS $$
> DECLARE
>_ct int;
> BEGIN
>INSERT INTO measurement_y2016m03 VALUES (NEW
On 03/22/2016 02:20 PM, CS DBA wrote:
On 03/22/2016 03:18 PM, Rob Sargent wrote:
On 03/22/2016 03:00 PM, Joshua D. Drake wrote:
On 03/22/2016 01:50 PM, CS DBA wrote:
Understood, was just wondering if there is a way to cause the child
table insert results to be returned to the ORM/Applicat
On Tue, Mar 22, 2016 at 5:20 PM, CS DBA wrote:
>
>
> On 03/22/2016 03:18 PM, Rob Sargent wrote:
>
>>
>>
>> On 03/22/2016 03:00 PM, Joshua D. Drake wrote:
>>
>>> On 03/22/2016 01:50 PM, CS DBA wrote:
>>>
>>> Understood, was just wondering if there is a way to cause the child
table insert resu
On 03/22/2016 03:18 PM, Rob Sargent wrote:
On 03/22/2016 03:00 PM, Joshua D. Drake wrote:
On 03/22/2016 01:50 PM, CS DBA wrote:
Understood, was just wondering if there is a way to cause the child
table insert results to be returned to the ORM/Application instead of
the master/base table in
On 03/22/2016 03:00 PM, Joshua D. Drake wrote:
On 03/22/2016 01:50 PM, CS DBA wrote:
Understood, was just wondering if there is a way to cause the child
table insert results to be returned to the ORM/Application instead of
the master/base table insert
Insert into the child table directly ba
On 03/22/2016 01:50 PM, CS DBA wrote:
Understood, was just wondering if there is a way to cause the child
table insert results to be returned to the ORM/Application instead of
the master/base table insert
Insert into the child table directly based on the partition rules.
JD
--
Command Promp
On 03/22/2016 02:43 PM, Joshua D. Drake wrote:
On 03/22/2016 01:35 PM, CS DBA wrote:
On 03/22/2016 02:23 PM, Joshua D. Drake wrote:
On 03/22/2016 11:40 AM, CS DBA wrote:
Hi All;
we setup partitioning for a large table but had to back off because
the
return status (i.e: "INSERT 0 1") ret
On 03/22/2016 01:35 PM, CS DBA wrote:
On 03/22/2016 02:23 PM, Joshua D. Drake wrote:
On 03/22/2016 11:40 AM, CS DBA wrote:
Hi All;
we setup partitioning for a large table but had to back off because the
return status (i.e: "INSERT 0 1") returns "INSERT 0 0" when inserting
into the partitione
On 03/22/2016 02:23 PM, Joshua D. Drake wrote:
On 03/22/2016 11:40 AM, CS DBA wrote:
Hi All;
we setup partitioning for a large table but had to back off because the
return status (i.e: "INSERT 0 1") returns "INSERT 0 0" when inserting
into the partitioned table which causes the ORM tool to as
On Tue, Mar 22, 2016 at 4:23 PM, Joshua D. Drake
wrote:
> On 03/22/2016 11:40 AM, CS DBA wrote:
>
>> Hi All;
>>
>> we setup partitioning for a large table but had to back off because the
>> return status (i.e: "INSERT 0 1") returns "INSERT 0 0" when inserting
>> into the partitioned table which c
On 03/22/2016 11:40 AM, CS DBA wrote:
Hi All;
we setup partitioning for a large table but had to back off because the
return status (i.e: "INSERT 0 1") returns "INSERT 0 0" when inserting
into the partitioned table which causes the ORM tool to assume the
insert inserted 0 rows. Is there a stand
On 03/22/2016 01:10 PM, Rob Sargent wrote:
On 03/22/2016 12:55 PM, Melvin Davidson wrote:
Your problem seems strange as it has never been previously reported
for anyone else that has _successfully_ set up partioning.
Perhaps is you provide just a little bit more detail we might be able
to h
Melvin Davidson wrote:
> Your problem seems strange as it has never been previously reported for
> anyone else that has _successfully_ set up partioning.
At least as of when I asked a very similar question
(http://www.postgresql.org/message-id/flat/547f7e88.7080...@vianet.ca#547f7e88.7080...@viane
On 03/22/2016 12:55 PM, Melvin Davidson wrote:
Your problem seems strange as it has never been previously reported
for anyone else that has _successfully_ set up partioning.
Perhaps is you provide just a little bit more detail we might be able
to help you.
Useful and needed information would
Your problem seems strange as it has never been previously reported for
anyone else that has _successfully_ set up partioning.
Perhaps is you provide just a little bit more detail we might be able to
help you.
Useful and needed information would be:
1. Version of PostgreSQL
2. Operating System
3. T
Hi All;
we setup partitioning for a large table but had to back off because the
return status (i.e: "INSERT 0 1") returns "INSERT 0 0" when inserting
into the partitioned table which causes the ORM tool to assume the
insert inserted 0 rows. Is there a standard / best practices work
around fo
22 matches
Mail list logo