Re: Out of memory error

2021-11-24 Thread aditya desai
Thanks Thomas! Sorry to say this but ,this was migrated from Oracle to PG :) and the app team just wants to keep the data type as it is :( On Wed, Nov 24, 2021 at 5:40 PM Thomas Kellerer wrote: > aditya desai schrieb am 24.11.2021 um 08:35: > > Hi Thomas, > > v_message is of composite data typ

Re: Out of memory error

2021-11-24 Thread Thomas Kellerer
aditya desai schrieb am 24.11.2021 um 08:31: > H Michael, > Please see insert_info function below. Also r_log_message is composite data > type and it's definition is also given below. > > CREATE OR REPLACE FUNCTION insert_info( >     info_array  r_log_message[] > ) RETURNS varchar AS $$ >     DECL

Re: Out of memory error

2021-11-24 Thread Thomas Kellerer
aditya desai schrieb am 24.11.2021 um 08:35: > Hi Thomas, > v_message is of composite data type r_log_message and it's definition is as > shown below. > > postgres=# \d r_log_message; >                  Composite type "public.r_log_message" >    Column    |          Type           | Collation | Nu

Re: Out of memory error

2021-11-23 Thread aditya desai
Hi Thomas, v_message is of composite data type r_log_message and it's definition is as shown below. postgres=# \d r_log_message; Composite type "public.r_log_message" Column| Type | Collation | Nullable | Default -+-+--

Re: Out of memory error

2021-11-23 Thread aditya desai
H Michael, Please see insert_info function below. Also r_log_message is composite data type and it's definition is also given below. CREATE OR REPLACE FUNCTION insert_info( info_array r_log_message[] ) RETURNS varchar AS $$ DECLARE info_element r_log_message; BEGIN FO

Re: Out of memory error

2021-11-23 Thread Michael Lewis
It seems like that function has some syntax errors, and also doesn't do what you want since I presume the "from employee" bit would mean you get many rows inserted into that temp table for all the existing data and not the one row you are operating on at the moment the trigger fires. It is worth n

Re: Out of memory error

2021-11-23 Thread aditya desai
Ok. Let me try this. Thanks!! On Wed, Nov 24, 2021 at 12:01 PM Thomas Kellerer wrote: > aditya desai schrieb am 24.11.2021 um 07:25: > > Thanks Tom. However I could not find any solution to achieve the given > requirement. I have to take all values in the temp table and assign it to > an array v

Re: Out of memory error

2021-11-23 Thread Thomas Kellerer
aditya desai schrieb am 24.11.2021 um 07:25: > Thanks Tom. However I could not find any solution to achieve the given > requirement. I have to take all values in the temp table and assign it to an > array variable to pass it to the audit procedure as shown below. Can you > please advise ?  > > C

Re: Out of memory error

2021-11-23 Thread aditya desai
Thanks Tom. However I could not find any solution to achieve the given requirement. I have to take all values in the temp table and assign it to an array variable to pass it to the audit procedure as shown below. Can you please advise ? CREATE OR REPLACE FUNCTION call_insert_info( ) RETURNS void

Re: Out of memory error

2021-11-23 Thread Tom Lane
aditya desai writes: > In a trigger function I am creating a temp table . When an update on a > table is executed for say 10k rows. I get the below error. > ERROR: out of shared memory > HINT:You might need to increase max_locks_per_transaction > CONTEXT: SQL Statement "created temp table changed

Re: Out of memory error on automatic vacuum

2019-11-18 Thread Tomas Vondra
On Mon, Nov 18, 2019 at 03:46:03PM +0100, Ekaterina Amez wrote: El 18/11/19 a las 15:16, Tomas Vondra escribió: Not sure I understand. Whenever PostgreSQL process needs memory it requests it from the kernel by calling malloc(), and the amount of availabe RAM is limited.  So when kernel can't p

Re: Out of memory error on automatic vacuum

2019-11-18 Thread Ekaterina Amez
El 18/11/19 a las 15:16, Tomas Vondra escribió: Not sure I understand. Whenever PostgreSQL process needs memory it requests it from the kernel by calling malloc(), and the amount of availabe RAM is limited.  So when kernel can't provide more memory, it returns NULL. Understood. If it fini

Re: Out of memory error on automatic vacuum

2019-11-18 Thread Tomas Vondra
On Mon, Nov 18, 2019 at 03:02:16PM +0100, Ekaterina Amez wrote: El 18/11/19 a las 13:25, Tomas Vondra escribió: On Mon, Nov 18, 2019 at 12:41:27PM +0100, Ekaterina Amez wrote: Hi all, This morning I was checking postgres servers logs, looking for errors (we've recently upgraded them and chan

Re: Out of memory error on automatic vacuum

2019-11-18 Thread Ekaterina Amez
El 18/11/19 a las 13:25, Tomas Vondra escribió: On Mon, Nov 18, 2019 at 12:41:27PM +0100, Ekaterina Amez wrote: Hi all, This morning I was checking postgres servers logs, looking for errors (we've recently upgraded them and changed default config) and long running queries when I found one of

Re: Out of memory error on automatic vacuum

2019-11-18 Thread Tomas Vondra
On Mon, Nov 18, 2019 at 12:41:27PM +0100, Ekaterina Amez wrote: Hi all, This morning I was checking postgres servers logs, looking for errors (we've recently upgraded them and changed default config) and long running queries when I found one of the servers had really big logs since yesterday.