Re: Creation of temporary tables on a publisher

From: Cory Nemelka <cnemelka(at)gmail(dot)com>
To: Shreeyansh Dba <shreeyansh2014(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Creation of temporary tables on a publisher
Date: 2019-01-25 20:04:16
Message-ID: CAMe5Gn1K3hd2+3y17FgsrGLbpcxR-LmJtUKVA8JpYTnM=QAPGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

That is my understanding also. However, we are getting the previously
mentioned error above when trying to update a temporary table in a
database that has other tables published.

I’m not sure you understand the issue. We don’t want to temporary tables
replicated but they appear to be. As I mentioned, is this expected
behavior? Anyone, Bueller?

On Fri, Jan 25, 2019 at 03:30 Shreeyansh Dba <shreeyansh2014(at)gmail(dot)com>
wrote:

> Temporary tables can't be part of a replication. In logical replication
> perform only DML. As well as same structure must be exists on publication
> and subscribe side.
>
> Thanks & Regards,
> *Shreeyansh DBA Team*
> www.shreeyansh.com
>
>
> On Thu, Jan 24, 2019 at 10:04 PM Cory Nemelka <cnemelka(at)gmail(dot)com> wrote:
>
>> The issue is the apparent replication of* temporary* tables. The
>> workarounds you proposed do work but why do postgresql publications
>> replicate temporary tables? they will not be on the subscriber so the
>> replication will fail.
>>
>> As I mentioned, is this expected behavior?
>>
>> --cnemelka
>>
>>
>> On Wed, Jan 23, 2019 at 6:58 PM Shreeyansh Dba <shreeyansh2014(at)gmail(dot)com>
>> wrote:
>>
>>> In Logical replication all tables have a valid default REPLICA IDENTITY
>>> (i.e. PK). If suppose there isn't one then You could try to set identity to
>>> full, with will use whole row as identifier ALTER TABLE name REPLICA
>>> IDENTITY FULL;
>>>
>>> or if it has unique index ALTER TABLE name USING INDEX index_name;
>>>
>>> Thanks & Regards,
>>> *Shreeyansh DBA Team*
>>> www.shreeyansh.com
>>>
>>>
>>> On Thu, Jan 24, 2019 at 4:16 AM Cory Nemelka <cnemelka(at)gmail(dot)com> wrote:
>>>
>>>> Postgresql v10.6
>>>>
>>>> After defining a publication with "FOR ALL TABLES" clause, temporary
>>>> tables that are created after the definition will produce errors if they
>>>> are updated,etc. The error: "cannot update table <tablename> because it
>>>> does not have a replica identity and publishes updates."
>>>>
>>>> Is this expected behaviour? I had understood that temporary tables
>>>> were not included in publications.
>>>>
>>>>
>>>> --cnemelka
>>>>
>>> --
--cnemelka

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message S. Bob 2019-01-26 15:33:16 Index scan does not return all the data
Previous Message Luis Agustín Solís García-Barbón 2019-01-25 18:12:54 How upgrade version pgadmin 4

Browse pgsql-sql by date

  From Date Subject
Next Message Cory Nemelka 2019-01-28 18:27:49 Re: Creation of temporary tables on a publisher
Previous Message Shreeyansh Dba 2019-01-25 10:30:40 Re: Creation of temporary tables on a publisher