public inbox for [email protected]
help / color / mirror / Atom feedFrom: [email protected] <[email protected]>
To: Fujii Masao <[email protected]>
To: [email protected] <[email protected]>
Subject: RE: [PATCH]Add tab completion for foreigh table
Date: Thu, 13 Jan 2022 06:57:42 +0000
Message-ID: <OS0PR01MB61138327FAE097FE71804660FB539@OS0PR01MB6113.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <[email protected]>
References: <OS0PR01MB61137E96E0551278782D11CDFB519@OS0PR01MB6113.jpnprd01.prod.outlook.com>
<[email protected]>
On Thursday, January 13, 2022 12:38 PM, Fujii Masao <[email protected]> wrote:
> Isn't it better to tab-complete not only "PARTITION OF" but also "(" for CREATE
> FOREIGN TABLE?
Thanks for your review. Left bracket completion added.
> IMO it's better to make the docs changes in separate patch because they are not
> directly related to the improvement of tab-completion.
Agreed. The former one patch was divided into two.
0001 patch, added tab completion for foreign table.
0002 patch, modified some doc description.
Regards,
Tang
Attachments:
[application/octet-stream] v-0001-add-tab-completion-for-PARTITION-OF-when-creating.patch (2.3K, ../OS0PR01MB61138327FAE097FE71804660FB539@OS0PR01MB6113.jpnprd01.prod.outlook.com/2-v-0001-add-tab-completion-for-PARTITION-OF-when-creating.patch)
download | inline diff:
From 0bf7f83272c7bd3cb2e0e940cd572318aa5741b5 Mon Sep 17 00:00:00 2001
From: tanghy <[email protected]>
Date: Tue, 11 Jan 2022 17:28:15 +0900
Subject: [PATCH v2] add tab completion for PARTITION OF when creating foreign
table
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index a76e2e7322..93031968c8 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -723,7 +723,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
separately with additional <literal>SET TABLESPACE</literal> commands.
When applied to a partitioned table, nothing is moved, but any
partitions created afterwards with
- <command>CREATE TABLE PARTITION OF</command> will use that tablespace,
+ <command>CREATE TABLE ... PARTITION OF</command> will use that tablespace,
unless overridden by a <literal>TABLESPACE</literal> clause.
</para>
@@ -956,7 +956,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
For each index in the target table, a corresponding
one will be created in the attached table; or, if an equivalent
index already exists, it will be attached to the target table's index,
- as if <command>ALTER INDEX ATTACH PARTITION</command> had been executed.
+ as if <command>ALTER INDEX ... ATTACH PARTITION</command> had been executed.
Note that if the existing table is a foreign table, it is currently not
allowed to attach the table as a partition of the target table if there
are <literal>UNIQUE</literal> indexes on the target table. (See also
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 39be6f556a..dab89ad46c 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -2636,6 +2636,10 @@ psql_completion(const char *text, int start, int end)
else if (Matches("CREATE", "FOREIGN", "DATA", "WRAPPER", MatchAny))
COMPLETE_WITH("HANDLER", "VALIDATOR", "OPTIONS");
+ /* CREATE FOREIGN TABLE*/
+ else if (Matches("CREATE", "FOREIGN", "TABLE", MatchAny))
+ COMPLETE_WITH("(", "PARTITION OF");
+
/* CREATE INDEX --- is allowed inside CREATE SCHEMA, so use TailMatches */
/* First off we complete CREATE UNIQUE with "INDEX" */
else if (TailMatches("CREATE", "UNIQUE"))
--
2.33.0.windows.2
[application/octet-stream] v2-0002-Modify-doc-description-for-ALTER-TABLE-in-accordi.patch (1.7K, ../OS0PR01MB61138327FAE097FE71804660FB539@OS0PR01MB6113.jpnprd01.prod.outlook.com/3-v2-0002-Modify-doc-description-for-ALTER-TABLE-in-accordi.patch)
download | inline diff:
From b3bdaa71963dd0df332fa2dc82a034a2a904cb61 Mon Sep 17 00:00:00 2001
From: tanghy <[email protected]>
Date: Thu, 13 Jan 2022 14:54:59 +0900
Subject: [PATCH v2 2/2] Modify doc description for ALTER TABLE in according
with CREATE INDEX
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index a76e2e7322..93031968c8 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -723,7 +723,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
separately with additional <literal>SET TABLESPACE</literal> commands.
When applied to a partitioned table, nothing is moved, but any
partitions created afterwards with
- <command>CREATE TABLE PARTITION OF</command> will use that tablespace,
+ <command>CREATE TABLE ... PARTITION OF</command> will use that tablespace,
unless overridden by a <literal>TABLESPACE</literal> clause.
</para>
@@ -956,7 +956,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
For each index in the target table, a corresponding
one will be created in the attached table; or, if an equivalent
index already exists, it will be attached to the target table's index,
- as if <command>ALTER INDEX ATTACH PARTITION</command> had been executed.
+ as if <command>ALTER INDEX ... ATTACH PARTITION</command> had been executed.
Note that if the existing table is a foreign table, it is currently not
allowed to attach the table as a partition of the target table if there
are <literal>UNIQUE</literal> indexes on the target table. (See also
--
2.33.0.windows.2
view thread (4+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: RE: [PATCH]Add tab completion for foreigh table
In-Reply-To: <OS0PR01MB61138327FAE097FE71804660FB539@OS0PR01MB6113.jpnprd01.prod.outlook.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox