Re: Postgres 13 signal 11: Segmentation fault tested on 2 independent machines

From: pinker <pinker(at)onet(dot)eu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Postgres 13 signal 11: Segmentation fault tested on 2 independent machines
Date: 2020-10-18 21:37:27
Message-ID: 1603057047424-0.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

cast to text those 2 columns helped:

sut.schemaname::TEXT, sut.relname::TEXT

so this function doesn't cause segmentation fault

CREATE OR REPLACE FUNCTION vacuum_dead_size(i_now timestamp with time zone,
OUT schemaname TEXT, OUT relname TEXT, OUT total_bytes NUMERIC, OUT
dead_tup_size NUMERIC)
RETURNS SETOF RECORD
AS $$

WITH closest_metric_stat_user_tables AS (
SELECT now FROM stat_user_tables ORDER BY abs(now-$1) LIMIT 1
), closest_metric_table_sizes AS (
SELECT now FROM table_sizes ORDER BY abs(now - $1) LIMIT 1
)
SELECT sut.schemaname::TEXT, sut.relname::TEXT, ts.total_bytes, 1::numeric
FROM stat_user_tables sut
LEFT JOIN table_sizes ts ON ts.table_name = sut.relname AND
ts.table_schema = sut.schemaname
WHERE ts.now = (SELECT now FROM closest_metric_table_sizes) AND sut.now
= (SELECT now FROM closest_metric_stat_user_tables)
ORDER BY 1;
$$ LANGUAGE SQL;

--
Sent from: https://www.postgresql-archive.org/PostgreSQL-bugs-f2117394.html

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2020-10-19 00:00:54 Re: Postgres 13 signal 11: Segmentation fault tested on 2 independent machines
Previous Message pinker 2020-10-18 21:25:44 Re: Postgres 13 signal 11: Segmentation fault tested on 2 independent machines