Re: CREATE TABLE .. LIKE copies comments to an unrelated table

From: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
To: Junwang Zhao <zhjwpku(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE TABLE .. LIKE copies comments to an unrelated table
Date: 2026-10-01 16:02:22
Message-ID: 3e9503eb-76e0-428d-81ac-19a1e6494e90@uni-muenster.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Junwang

On 01/10/2026 17:31, Junwang Zhao wrote:
> The preceding RangeVarGetAndCheckCreationNamespace has already
> initialized the temporary namespace and returned its OID, so simplified it
> to:
>
> if (stmt->relation->schemaname == NULL)
> stmt->relation->schemaname = get_namespace_name(namespaceid);
>
> should work, I did a quick test to verify this.

+1

Thanks! I will write some tests and prepare a patch.

Best, Jim

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Soumen 2026-10-01 16:31:27 Request to expedite cool-off
Previous Message Junwang Zhao 2026-10-01 15:31:57 Re: CREATE TABLE .. LIKE copies comments to an unrelated table