PostgreSQL logical decoder output plugin - unchanged toast data

From: Georgy Buranov <gburanov(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: PostgreSQL logical decoder output plugin - unchanged toast data
Date: 2018-08-31 13:36:26
Message-ID: CAGMDm37Dips9FhK0EARAQLdo8ov=0f4cfH-QSN1a64qSfXkn5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi. I have a question about PostgreSQL logical decoder output plugin.

I am not specialist in Postgres at all, so maybe I miss some very
basic point. In the plugin, I want to always get all the values (even
those that are unchanged toast data)

When I try to get the datum that is internal on disk (here is code)

```
struct varlena *s = (struct varlena *)DatumGetPointer(origval);
struct varlena * ret = heap_tuple_untoast_attr(s);
Datum result = PointerGetDatum(PG_DETOAST_DATUM(ret));
```
it fails with no known snapshots error (from heap_tuple_untoast_attr).
My question is why is it that.

So, even theoretically it is not possible to the the varlena on disk
from logical replication plugin?

Mit freundlichen Grüßen,
Georgy Buranov

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-08-31 13:59:40 Re: Hint to set owner for tablespace directory
Previous Message Olivier Leprêtre 2018-08-31 12:52:07 TR: redundant constraint_schema