Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sgk70-006zNf-EW for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Aug 2024 12:06:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sgk6x-00AFro-Qb for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Aug 2024 12:06:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sgk6x-00AFre-D2 for pgsql-hackers@lists.postgresql.org; Wed, 21 Aug 2024 12:06:48 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sgk6v-000j4G-CW for pgsql-hackers@lists.postgresql.org; Wed, 21 Aug 2024 12:06:46 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a83562f9be9so602855966b.0 for ; Wed, 21 Aug 2024 05:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724242003; x=1724846803; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wua4a5UG5yRyuUKGYkL8lsNYJi1uSZbes9x0+j6xXGQ=; b=jxecscv5+SjpgVqPl43QD7t1CW6N8khJD4miPLEED5Kt9qgZQiK+i/Vwh05flGffBq YnJVw+33TAAIYqFwUl3MmQ6dXlXcJWOhbm39IrT2secGeYqui9SGWlQOXhaj20JofZ2e +RuhVDWscEVVZrD5Z5a0Z2XXqRZUDdPrvNV0kUhImrGda/Eo9vUAPmhnysDQ/UfYSX80 FSj+KB0eIoJLZV9R7w/+JehWrf1UTYsdm+rp8fMAZadVawy9SnglXUpT4sTW1UZl0ARF gBoLq1D5CUck2fHtAxOdHyuGShBuKNVQVZmkKjAJVg19rGexeQNy1BuDHWbJD8J1/pub LdZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724242003; x=1724846803; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wua4a5UG5yRyuUKGYkL8lsNYJi1uSZbes9x0+j6xXGQ=; b=eZI6yEFSDdHtRfwpq4mUhc/KAUczktKRo9qVn/dX2Zlr9M8FMsgoqiYSJ3YajINlRp k1V3qEtMFDxI3IoX8y19nm0xFdng4JpUjwSTNGga2c4LLq1jmP49WY6a5T39ZO9sKohH LR6ZOO2b3etuRRakFqQeO42abMv0pHyKpPWBU/3N0+YeLFLYqMVobnPovl0NDqmMPTzE ujwTp/DpqxiamZaG9q+/zF1nuJyh1U5K0n7vwtcS92b6WUA/sn+k5sisZ6Ucp1z+ia+I EU9kT0sufFZmry8Mr+yoqG7MqG/6j9A1LfSn3ri03myRBWIX/uEXVZDK6feYPlsiOQrA af8g== X-Forwarded-Encrypted: i=1; AJvYcCV9wHfYZyKxM3OzXevcl/S56xZwnBBdFx3dV+10KyEFvAiY3BRddhrpgUpr0PmNDlYEhHnw0MwC8qtRCwmx@lists.postgresql.org X-Gm-Message-State: AOJu0Yyc6O9A4tqrLQ9WB4jmExfJYXXnWXxBOOQ4xq3MivdogzmPmnGG sSnFPseyez+KID1kTMQzakAZndKtqBn1/r2owGtC/xcN4ENdiWX6uf5cq8XPfpRhQDLVE2hjHna 4BTqxDEb/DpTOY8OJW3vXdJicyak= X-Google-Smtp-Source: AGHT+IEdTD5aZwJoP/e0TJc1bGqEB5ZdaAHJvA6yHBojgD348y9RUSxR788hJ8O5MQsoIxR6HwGZMNKS5IHH0yIIyMc= X-Received: by 2002:a17:907:987:b0:a86:6858:8a8f with SMTP id a640c23a62f3a-a866f35a22emr165213966b.26.1724242002776; Wed, 21 Aug 2024 05:06:42 -0700 (PDT) MIME-Version: 1.0 References: <171085360143.2046436.7217841141682511557.pgcf@coridan.postgresql.org> <171085858750.2046434.12246066729700037354.pgcf@coridan.postgresql.org> <909e16b4-9eda-435c-b033-8294ae4adc05@postgrespro.ru> <3a4b9c1c-3edf-4e29-9629-b4113aefb0f3@postgrespro.ru> <20240808171351.a9.nmisch@google.com> <19c1e04c-2012-4475-8460-821dd633a6ce@postgrespro.ru> <768cbb42-d3f8-45de-89ad-72861f078dc2@postgrespro.ru> In-Reply-To: From: Pavel Borisov Date: Wed, 21 Aug 2024 16:06:31 +0400 Message-ID: Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: Alexander Korotkov Cc: Dmitry Koval , Noah Misch , pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000151b6f06203060e1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000151b6f06203060e1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Alexander! On Wed, 21 Aug 2024 at 15:55, Alexander Korotkov wrote: > Hi, Pavel! > > On Wed, Aug 21, 2024 at 1:48=E2=80=AFPM Pavel Borisov > wrote: > > On Mon, 19 Aug 2024 at 02:24, Alexander Korotkov > wrote: > >> > >> On Sat, Aug 10, 2024 at 6:57=E2=80=AFPM Dmitry Koval > wrote: > >> > > Probably > >> > > QueryCompletion struct fits this purpose best from the existing > >> > > parameters. Attached draft patch implements returning oid of newl= y > >> > > created relation as part of QueryCompletion. Thoughts? > >> > > >> > I agree, returning the oid of the newly created relation is the best > way > >> > to solve the problem. > >> > (Excuse me, I won't have access to a laptop for the next week - and > >> > won't be able to look at the source code). > >> > >> Thank you for your feedback. Although, I decided QueryCompletion is > >> not a good place for this new field. It looks more appropriate to > >> place it to TableLikeClause, which already contains one relation oid > >> inside. The revised patch is attached. > > > > > > I've looked at the patch v2. Remembering the OID of a relation newly > created with LIKE in TableLikeClause seems good to me. > > Check-world passes sucessfully. > > Thank you. > > > Shouldn't we also modify the TableLikeClause node in gram.y accordingly= ? > > On the one hand, makeNode() uses palloc0() and initializes all fields > with zero anyway. On the other hand, there is already assignment of > relationOid. So, yes I'll add assignment of newRelationOid for the > sake of uniformity. > > > For the comments: > > Put the Oid -> Store the OID > so caller might use it -> for the caller to use it. > > Accepted. > > > (Maybe also caller -> table create function) > > I'll prefer to leave it "caller" as more generic term, which could > also fit potential future usages. > > The revised patch is attached. I'm going to push it if no objections. > Looked at v3 All good except the patch has "Oid" and "OID" in two comments. I suppose "OID" is preferred elsewhere in the PG comments. Regards, Pavel. --000000000000151b6f06203060e1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, Alexander!

On Wed, 21 Aug 2024 at 15:5= 5, Alexander Korotkov <aekorotko= v@gmail.com> wrote:
Hi, Pavel!

On Wed, Aug 21, 2024 at 1:48=E2=80=AFPM Pavel Borisov <pashkin.elfe@gmail.com> w= rote:
> On Mon, 19 Aug 2024 at 02:24, Alexander Korotkov <aekorotkov@gmail.com> wrote= :
>>
>> On Sat, Aug 10, 2024 at 6:57=E2=80=AFPM Dmitry Koval <d.koval@postgrespro.ru= > wrote:
>> > > Probably
>> > > QueryCompletion struct fits this purpose best from the e= xisting
>> > > parameters.=C2=A0 Attached draft patch implements return= ing oid of newly
>> > > created relation as part of QueryCompletion.=C2=A0 Thoug= hts?
>> >
>> > I agree, returning the oid of the newly created relation is t= he best way
>> > to solve the problem.
>> > (Excuse me, I won't have access to a laptop for the next = week - and
>> > won't be able to look at the source code).
>>
>> Thank you for your feedback.=C2=A0 Although, I decided QueryComple= tion is
>> not a good place for this new field.=C2=A0 It looks more appropria= te to
>> place it to TableLikeClause, which already contains one relation o= id
>> inside.=C2=A0 The revised patch is attached.
>
>
> I've looked at the patch v2. Remembering the OID of a relation new= ly created with LIKE in TableLikeClause seems good to me.
> Check-world passes sucessfully.

Thank you.

> Shouldn't we also modify the TableLikeClause node in gram.y accord= ingly?

On the one hand, makeNode() uses palloc0() and initializes all fields
with zero anyway.=C2=A0 On the other hand, there is already assignment of relationOid.=C2=A0 So, yes I'll add assignment of newRelationOid for th= e
sake of uniformity.

> For the comments:
> Put the Oid=C2=A0 -> Store the OID=C2=A0
> so caller might use it -> for the caller to use it.

Accepted.

> (Maybe also caller -> table create function)

I'll prefer to leave it "caller" as more generic term, which = could
also fit potential future usages.

The revised patch is attached.=C2=A0 I'm going to push it if no objecti= ons.
Looked=C2=A0at v3
All good except the p= atch has=C2=A0"Oid" and "OID" in two comments. I suppos= e "OID" is preferred elsewhere in the PG comments.

=
Regards,
Pavel.
--000000000000151b6f06203060e1--