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