Re: [PATCH] Remove make_temptable_name_n() - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: [PATCH] Remove make_temptable_name_n()
Date
Msg-id CAJ7c6TOfv+iAvD1o-TF_zL7mmETM=4v_65hOktqizM3LnF4hUQ@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Remove make_temptable_name_n()  (Álvaro Herrera <alvherre@kurilemu.de>)
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: [PATCH] pg_get_domain_ddl: DDL reconstruction function for CREATE DOMAIN statement
Next
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Logical Replication of sequences