From: pinker <pinker@onet.eu>
To: pgsql-bugs@postgresql.org
Subject: Re: Postgres 13 signal 11: Segmentation fault tested on 2 independent machines
Date: Sun, 18 Oct 2020 14:37:27 -0700 (MST)
Message-ID: <1603057047424-0.post@n3.nabble.com> (raw)
In-Reply-To: <236292.1603052323@sss.pgh.pa.us>
References: <1603050466566-0.post@n3.nabble.com>
<1603050580276-0.post@n3.nabble.com>
<235509.1603051243@sss.pgh.pa.us>
<1603051414438-0.post@n3.nabble.com>
<236292.1603052323@sss.pgh.pa.us>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: pinker@onet.eu
Subject: Re: Postgres 13 signal 11: Segmentation fault tested on 2 independent machines
In-Reply-To: <1603057047424-0.post@n3.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox