Re: PostgreSQL logical decoder output plugin - unchanged toast data

2018-09-04 Thread Andres Freund
Hi, On 2018-09-04 11:45:10 +0200, Georgy Buranov wrote: > Hi Andres. Thank you very much for your help. > > I tried the following solution and I have some problems. > > * I have 9.6 postgres and I do not have separate field for rd_pkindex > * All I have is rd_replidindex field. Usually (when REP

Re: PostgreSQL logical decoder output plugin - unchanged toast data

2018-09-04 Thread Georgy Buranov
Hi Andres. Thank you very much for your help. I tried the following solution and I have some problems. * I have 9.6 postgres and I do not have separate field for rd_pkindex * All I have is rd_replidindex field. Usually (when REPLICA IDENTITY is NOT FULL), it still contains the primary key * But i

Re: PostgreSQL logical decoder output plugin - unchanged toast data

2018-08-31 Thread Georgy Buranov
Ok, I got false understanding that REPLICA IDENTITY is used for something more than a WAL. This is basically not true. So, what I can do * Set the REPLICA IDENTITY to full, and in this case I can still get the pk from rd_pkindex. In this case the WAL will be bigger, but we will have all the values

Re: PostgreSQL logical decoder output plugin - unchanged toast data

2018-08-31 Thread Andres Freund
On 2018-08-31 17:34:02 +0200, Georgy Buranov wrote: > > Again, you can set REPLICA IDENTITY to FULL and it'll be there. > > > > So, why I think this is complicated > > * We use primary keys for all tables, so we do not need REPLICA > IDENTITY full actually. As far as I understand, it will make >

Re: PostgreSQL logical decoder output plugin - unchanged toast data

2018-08-31 Thread Georgy Buranov
> Again, you can set REPLICA IDENTITY to FULL and it'll be there. > So, why I think this is complicated * We use primary keys for all tables, so we do not need REPLICA IDENTITY full actually. As far as I understand, it will make master/slave replication ineffective as well * I need the informatio

Re: PostgreSQL logical decoder output plugin - unchanged toast data

2018-08-31 Thread Andres Freund
Hi, On 2018-08-31 16:55:37 +0200, Georgy Buranov wrote: > Ok, thank you very much for your explanation, > > maybe I need something else in my case. > > As far as I understand, "On-disk toasted data for tuples from the WAL > are not guaranteed in any way to be retain", but still, the LATEST > val

Re: PostgreSQL logical decoder output plugin - unchanged toast data

2018-08-31 Thread Georgy Buranov
Ok, thank you very much for your explanation, maybe I need something else in my case. As far as I understand, "On-disk toasted data for tuples from the WAL are not guaranteed in any way to be retain", but still, the LATEST value for the same cell should exist in postgres (in on-disk toast if it i

Re: PostgreSQL logical decoder output plugin - unchanged toast data

2018-08-31 Thread Andres Freund
Hi, Hi, On 2018-08-31 15:36:26 +0200, Georgy Buranov wrote: > 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 (

PostgreSQL logical decoder output plugin - unchanged toast data

2018-08-31 Thread Georgy Buranov
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