Re: BUG #15565: truncate bug with tables which have temp table inherited

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: digoal(at)126(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, PG Bug reporting form <noreply(at)postgresql(dot)org>
Subject: Re: BUG #15565: truncate bug with tables which have temp table inherited
Date: 2018-12-25 00:49:43
Message-ID: 0285c6d1-2d11-2f2c-6fae-d4575cdc3c7b@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On 2018/12/24 18:17, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference: 15565
> Logged by: Zhou Digoal
> Email address: digoal(at)126(dot)com
> PostgreSQL version: 11.1
> Operating system: CentOS 7.x x64
> Description:
>
> ```
> create table public.a (id int);
> ```
>
> sesssion a:
>
> ```
> create temp table a (like public.a) inherits(public.a);
> ```
>
> session b:
> ```
> create temp table a (like public.a) inherits(public.a);
> ```
>
> any session:
>
> ```
> postgres=# truncate public.a;
> ERROR: cannot truncate temporary tables of other sessions
> ```
>
> but delete,select,update is ok;

I'm not sure if the error being shown is a bug, but maybe we could remove
the error by making truncate do the same thing as select/update/delete,
that is, ignore child tables that are temporary of tables of other
sessions. Attached patch to do that.

Thanks,
Amit

Attachment Content-Type Size
truncate-ignore-other-session-temp-children.patch text/plain 816 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Langote 2018-12-25 00:50:32 Re: BUG #15552: Unexpected error in COPY to a foreign table in a transaction
Previous Message Michael Paquier 2018-12-25 00:45:45 Re: BUG #15565: truncate bug with tables which have temp table inherited