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: Nathan Bossart <nathandbossart@gmail.com>, Shinya Kato <shinya11.kato@gmail.com>, Álvaro Herrera <alvherre@kurilemu.de>
Date: 2025-10-22T13:20:01Z
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 →
  1. Remove make_temptable_name_n().

  2. Add support for REFRESH MATERIALIZED VIEW CONCURRENTLY.

Attachments

Hi Nathan,

> > +     {
> > +             char       *nsp = get_namespace_name(RelationGetNamespace(tempRel));
> > +             char       *temprelname = RelationGetRelationName(tempRel);
> > +             char       *diffrelname = psprintf("%s_%d", temprelname, 2);
>
> I assume the intent of the extra set of curly brackets is to keep the
> declarations of these variables close to where they are used.  In this
> case, the top of the function is only a few lines up, so IMHO we should
> declare them there and save a level of indentation.
>
> > +             pfree(diffrelname);
> > +             if (nsp)
> > +                     pfree(nsp);
>
> Any reason to be so careful about freeing these?  We ordinarily let the
> memory context take care of freeing, and refresh_by_match_merge() looks no
> different.

These were just a matter of my personal preferences. I have no strong
opinion on this. Here is the updated patch.

-- 
Best regards,
Aleksander Alekseev