Re: [PATCH] Remove make_temptable_name_n()
Aleksander Alekseev <aleksander@tigerdata.com>
From: Aleksander Alekseev <aleksander@tigerdata.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Álvaro Herrera <alvherre@kurilemu.de>, Nathan Bossart <nathandbossart@gmail.com>
Date: 2025-10-16T11:10:45Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Remove make_temptable_name_n().
- 4c5e1d0785ce 19 (unreleased) landed
-
Add support for REFRESH MATERIALIZED VIEW CONCURRENTLY.
- cc1965a99bf8 9.4.0 cited
Attachments
- v3-0001-Remove-make_temptable_name_n.patch (text/x-patch) patch v3-0001
Hi Álvaro,
Thanks for your feedback.
> Hmm, but instead of keeping the comment about why this is bogus, why not
> just fix it and remove the comment? You could do something like
>
> nsp = get_namespace_name( .. );
> diffname = psprintf("%s_%s_%d", nsp, RelationGetRelationName( .. ), 2);
> tempname = quote_qualified_identifier(nsp, RelationGetRelationName( ... ));
>
> and then that should be fairly okay, I think, keeping in mind that both
> the names involved are internally-generated short strings -- something
> like pg_temp_19.pg_temp_28356_2.
Sounds good to me. Here is the updated patch v3.
> I think it would be better to rewrite this code not to rely on SPI.
I will investigate this and start a new thread for better visibility.
This is an invasive change which requires broader discussion.
--
Best regards,
Aleksander Alekseev