Re: Add notification on BEGIN ATOMIC SQL functions using temp relations

From: Bernice Southey <bernice(dot)southey(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add notification on BEGIN ATOMIC SQL functions using temp relations
Date: 2025-11-22 19:44:19
Message-ID: CAEDh4nxXYxbPQQiHBUY6pg3cFxbUKQFdERQ_i6EqDhUm=-Ksyg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>if a temp table is used to
> define an old-style function's argument or result type, eg
> create function get_mytable() returns setof mytable as ...
> This is problematic because the function will go away when mytable
> does, no matter how its body is expressed.
I briefly did try using my temp table as the result type and was
delighted I could, but my client library wasn't. I had no idea I'd
accidentally made my functions weirdly temporary, so your notice would
have been very useful.

Thanks, Bernice

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-11-22 20:03:54 Re: another autovacuum scheduling thread
Previous Message Nathan Bossart 2025-11-22 19:41:21 Re: pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent