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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bernice Southey <bernice(dot)southey(at)gmail(dot)com>
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 18:04:21
Message-ID: 2664207.1763834661@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bernice Southey <bernice(dot)southey(at)gmail(dot)com> writes:
> Yikes. Can I get in early on the push-back? I think what you're saying
> is you want to stop old-style SQL functions from using temp tables
> that exist outside of them?

No, that's not part of the proposal. The one case in which we'd
complain (at an error level TBD) is if a temp table is used to
define an old-style function's argument or result type, eg

create temp table mytable (id int, data text);

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. That's always been so,
at least since we invented dependencies.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bernice Southey 2025-11-22 18:20:27 Re: Add notification on BEGIN ATOMIC SQL functions using temp relations
Previous Message Sami Imseih 2025-11-22 17:28:10 Re: another autovacuum scheduling thread