Re: ERROR: invalid memory alloc in Pg 9.6.6

From: Jaime Soler <jaime(dot)soler(at)gmail(dot)com>
To: Don Seiler <don(at)seiler(dot)us>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: ERROR: invalid memory alloc in Pg 9.6.6
Date: 2018-04-13 08:51:20
Message-ID: CAKVUGgQMqbef16XvRXfaiB5K-w3T1VTze1i3TQdEqRdG=UcJWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I think you are getting the error while pg_dump is collecting acl's of
table '16445700'::pg_catalog.oid
https://github.com/postgres/postgres/blob/REL9_6_6/src/bin/pg_dump/pg_dump.c#L15182-L15222
but I am not sure why you are running out of memory

2018-04-11 21:47 GMT+02:00 Don Seiler <don(at)seiler(dot)us>:

> On Wed, Apr 11, 2018 at 2:44 PM, Don Seiler <don(at)seiler(dot)us> wrote:
>
>>
>> I can take a statement that hit the error from the log and run it myself
>> in psql and it will return fine.
>>
>
> This includes the statement that hits the error on pg_dump. It errors
> every time on pg_dump but not when I run it manually from psql as the
> postgres user:
>
> # SELECT at.attname, (SELECT pg_catalog.array_agg(acl ORDER BY row_n) FROM
> (SELECT acl, row_n FROM pg_catalog.unnest(coalesce(at.
> attacl,pg_catalog.acldefault('c',c.relowner))) WITH ORDINALITY AS
> perm(acl,row_n) WHERE NOT EXISTS ( SELECT 1 FROM pg_catalog.unnest(coalesce(
> pip.initprivs,pg_catalog.acldefault('c',c.relowner))) AS init(init_acl)
> WHERE acl = init_acl)) as foo) AS attacl, (SELECT pg_catalog.array_agg(acl
> ORDER BY row_n) FROM (SELECT acl, row_n FROM pg_catalog.unnest(coalesce(
> pip.initprivs,pg_catalog.acldefault('c',c.relowner))) WITH ORDINALITY AS
> initp(acl,row_n) WHERE NOT EXISTS ( SELECT 1 FROM
> pg_catalog.unnest(coalesce(at.attacl,pg_catalog.acldefault('c',c.relowner)))
> AS permp(orig_acl) WHERE acl = orig_acl)) as foo) AS rattacl, NULL AS
> initattacl, NULL AS initrattacl FROM pg_catalog.pg_attribute at JOIN
> pg_catalog.pg_class c ON (at.attrelid = c.oid) LEFT JOIN
> pg_catalog.pg_init_privs pip ON (at.attrelid = pip.objoid AND pip.classoid
> = 'pg_catalog.pg_class'::pg_catalog.regclass AND at.attnum =
> pip.objsubid) WHERE at.attrelid = '16445700'::pg_catalog.oid AND NOT
> at.attisdropped AND ((SELECT pg_catalog.array_agg(acl ORDER BY row_n) FROM
> (SELECT acl, row_n FROM pg_catalog.unnest(coalesce(at.
> attacl,pg_catalog.acldefault('c',c.relowner))) WITH ORDINALITY AS
> perm(acl,row_n) WHERE NOT EXISTS ( SELECT 1 FROM pg_catalog.unnest(coalesce(
> pip.initprivs,pg_catalog.acldefault('c',c.relowner))) AS init(init_acl)
> WHERE acl = init_acl)) as foo) IS NOT NULL OR (SELECT
> pg_catalog.array_agg(acl ORDER BY row_n) FROM (SELECT acl, row_n FROM
> pg_catalog.unnest(coalesce(pip.initprivs,pg_catalog.acldefault('c',c.relowner)))
> WITH ORDINALITY AS initp(acl,row_n) WHERE NOT EXISTS ( SELECT 1 FROM
> pg_catalog.unnest(coalesce(at.attacl,pg_catalog.acldefault('c',c.relowner)))
> AS permp(orig_acl) WHERE acl = orig_acl)) as foo) IS NOT NULL OR NULL IS
> NOT NULL OR NULL IS NOT NULL)ORDER BY at.attnum;
> attname | attacl | rattacl | initattacl | initrattacl
> ---------+--------+---------+------------+-------------
> (0 rows)
>
> Time: 3.099 ms
>
>
>
> --
> Don Seiler
> www.seiler.us
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Stephen Frost 2018-04-13 16:09:22 Re: ERROR: invalid memory alloc in Pg 9.6.6
Previous Message Williams, Alex 2018-04-12 23:30:30 pgadmin4 - centos7 - "The application server could not be contacted"