Re: Postgres 13 signal 11: Segmentation fault tested on 2 independent machines - Mailing list pgsql-bugs

From pinker
Subject Re: Postgres 13 signal 11: Segmentation fault tested on 2 independent machines
Date
Msg-id 1603057047424-0.post@n3.nabble.com
Whole thread Raw
In response to Re: Postgres 13 signal 11: Segmentation fault tested on 2 independent machines  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Postgres 13 signal 11: Segmentation fault tested on 2 independent machines  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-bugs by date:

Previous
From: pinker
Date:
Subject: Re: Postgres 13 signal 11: Segmentation fault tested on 2 independent machines
Next
From: Tom Lane
Date:
Subject: Re: Postgres 13 signal 11: Segmentation fault tested on 2 independent machines