From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Michael Lewis <mlewis@entrata.com>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: Requiring temp tables to have replication identity defined
Date: Thu, 14 Mar 2019 11:35:37 +0900
Message-ID: <dc903f6a-d42c-c06d-827a-adb544ff59db@lab.ntt.co.jp> (raw)
In-Reply-To: <CAHOFxGr=mqPZXbAuoR7Nbq-bU4HxqVWHbTTUy5=PKQut_F0=XA@mail.gmail.com>
References: <CAHOFxGr=mqPZXbAuoR7Nbq-bU4HxqVWHbTTUy5=PKQut_F0=XA@mail.gmail.com>
On 2019/03/14 5:26, Michael Lewis wrote:
> /* select version();
> PostgreSQL 10.6 (Ubuntu 10.6-1.pgdg18.04+1) on x86_64-pc-linux-gnu,
> compiled by gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0, 64-bit */
>
> To reproduce, try the below code. Uncomment the alter table line and the
> error is gone as expected. I would expect the identity should not be need
> to be defined on a temp table since it won't be replicated anyway.
>
> BEGIN;
> CREATE publication test1 FOR ALL TABLES;
> CREATE TEMP TABLE testing123 ON COMMIT DROP AS ( SELECT 1 AS value );
> /* ALTER TABLE pg_temp.testing123 REPLICA IDENTITY FULL; */
> UPDATE testing123 SET value = 2;
>
> /*OUTPUT:
> ERROR: cannot update table "testing123" because it does not have a replica
> identity and publishes updates */
> ROLLBACK;
It's a bug. A patch to fix this has been posted and is being discussed on
the development mailing list:
https://www.postgresql.org/message-id/f3f151f7-c4dd-1646-b998-f60bd6217dd3%402ndquadrant.com
Thanks,
Amit
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: Langote_Amit_f8@lab.ntt.co.jp, mlewis@entrata.com
Subject: Re: Requiring temp tables to have replication identity defined
In-Reply-To: <dc903f6a-d42c-c06d-827a-adb544ff59db@lab.ntt.co.jp>
References: <CAHOFxGr=mqPZXbAuoR7Nbq-bU4HxqVWHbTTUy5=PKQut_F0=XA@mail.gmail.com> <dc903f6a-d42c-c06d-827a-adb544ff59db@lab.ntt.co.jp>
* 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