Re: Partitioning existing table issue - Help needed!

From: dbatoCloud Solution <dbatocloud17(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Partitioning existing table issue - Help needed!
Date: 2021-02-05 13:55:17
Message-ID: CAEz7P_temwcCJKceKf5CMMbygyjFqar4TdWh5kvNrk7PUo92iw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

My Apologies!

The below trigger which I created for after partitioning for each
partitions

CREATE trigger insert_contact_transaction_history_P_PART_BKP_Y2017_AM
BEFORE INSERT ON core.contact_transaction_history_P_PART_BKP_Y2017_AM
FOR EACH ROW EXECUTE PROCEDURE
core.contact_transaction_history_Parent_PART_BKP_AM_();

--

---
---
---

CREATE trigger insert_contact_transaction_history_P_PART_BKP_Y2025_AM
BEFORE INSERT ON core.contact_transaction_history_P_PART_BKP_Y2025_AM
FOR EACH ROW EXECUTE PROCEDURE
core.contact_transaction_history_Parent_PART_BKP_AM_();

Thanks & Best Wishes,

Ashok

---------------------------------------------------------------------------------------------------------------------

Ashokkumar Mani *(OCP12c/11g/10g/9i, AWS SAA, M103)*

*Dubai** , UAE* *| BLR , INDIA*

M: *+971 54 723 0075 *| *+91 90086 70302 | *WApp :* +91 81975 99922*

W: https://dbatocloudsolution.blogspot.in/
<http://dbatocloudsolution.blogspot.in/> | E: dbatocloud17(at)gmail(dot)com

On Fri, Feb 5, 2021 at 6:52 PM Magnus Hagander <magnus(at)hagander(dot)net> wrote:

> (please avoid top-posting, it makes the thread really hard to read)
>
>
> On Fri, Feb 5, 2021 at 1:04 PM dbatoCloud Solution
> <dbatocloud17(at)gmail(dot)com> wrote:
> >
> > Thanks Magnus,
> >
> > I was able to create trigger for each partition now successfully.
> >
> > Now I tried to insert records from the old tableto newly created
> partition table but I am receiving the below error.
> > Comand # insert into
> core.contact_transaction_history_Parent_PART_BKP_AM select * from
> core.contact_transaction_history;
> >
> > SQL Error [54001]: ERROR: stack depth limit exceeded
> > Hint: Increase the configuration parameter "max_stack_depth"
> (currently 6144kB), after ensuring the platform's stack depth limit is
> adequate.
> > Where: SQL statement "INSERT INTO
> core.contact_transaction_history_P_PART_BKP_Y2020_AM VALUES (NEW.*)"
> > PL/pgSQL function core.contact_transaction_history_parent_part_bkp_am_()
> line 14 at SQL statement
> > SQL statement "INSERT INTO
> core.contact_transaction_history_P_PART_BKP_Y2020_AM VALUES (NEW.*)"
> > PL/pgSQL function core.contact_transaction_history_parent_part_bkp_am_()
> line 14 at SQL statement
> > SQL statement "INSERT INTO
> core.contact_transaction_history_P_PART_BKP_Y2020_AM VALUES (NEW.*)"
> > PL/pgSQL function core.contact_transaction_history_parent_part_bkp_am_()
> line 14 at SQL statement
> > SQL statement "INSERT INTO
> core.contact_transaction_history_P_PART_BKP_Y2020_AM VALUES (NEW.*)"
> > PL/pgSQL function core.contact_transaction_history_parent_part_bkp_am_()
> line 14 at SQL statement
> > SQL statement "INSERT INTO
> core.contact_transaction_history_P_PART_BKP_Y2020_AM VALUES (NEW.*)"
> > PL/pgSQL function core.contact_transaction_history_parent_part_bkp_am_()
> line 14 at SQL statement
> > SQL statement "INSERT INTO
> core.contact_transaction_history_P_PART_BKP_Y2020_AM VALUES (NEW.*)"
> > PL/pgSQL function core.contact_transaction_history_parent_part_bkp_am_()
> line 14 at SQL statement
>
> This looks a lot like you may have created a trigger that actually
> fires recursively. What does your trigger actually do that would
> require that much stack? Can you post the code of the trigger?
>
> --
> Magnus Hagander
> Me: https://www.hagander.net/
> Work: https://www.redpill-linpro.com/
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message dbatoCloud Solution 2021-02-05 14:01:56 Re: Partitioning existing table issue - Help needed!
Previous Message Magnus Hagander 2021-02-05 13:21:55 Re: Partitioning existing table issue - Help needed!