[BUGS] ON COMMIT DROP unstable behaviour - Mailing list pgsql-bugs

From Ian R. Campbell
Subject [BUGS] ON COMMIT DROP unstable behaviour
Date
Msg-id CAOC8YUcD1PRecQv5Jhjx_XH3VN=g_uca=sNEB7MB6oFJLXyHUw@mail.gmail.com
Whole thread Raw
Responses Re: [BUGS] ON COMMIT DROP unstable behaviour  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
Hi

I'm using PG 10, pgAdmin 4, and PGMaestro 17.8.0.1.

I have a function that creates a temp table marked ON COMMIT DROP. The function performs read-only ops on the DB apart from using the temp table.

I observed the temp table sometimes fails to drop when executing the function. I am able to query its contents. Multiple calls to the function simply increases the temp table's contents.

I narrowed it down to the following scenario:

1) Remove the ON COMMIT DROP
2) Compile
3) Execute "SELECT * FROM func(1)"... temp table visible as expected
4) Put back the ON COMMIT DROP
5) Compile
6) Execute... temp table visible and grows with each call to the function

Dropping all connections to the DB, reconnecting, and executing the function (without modification) will result in expected behavior: temp table drops.

It's a bit complex to provide the function and tables, but I will if needed.

Best
Ian

pgsql-bugs by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much
Next
From: "David G. Johnston"
Date:
Subject: Re: [BUGS] ON COMMIT DROP unstable behaviour