apache / cloudberry

One advanced and mature open-source MPP (Massively Parallel Processing) database. Open source alternative to Greenplum Database.
https://cloudberry.apache.org
Apache License 2.0
417 stars 104 forks source link

Enhace tab completion for partition cmds #692

Closed reshke closed 2 weeks ago

reshke commented 3 weeks ago

I suggest to enhance CBDB psql tab-completion support for EXCHANGE PARTITION feature and also ALTER TABLE ... DROP PARTITION / DROP DEDAULT PARTITION

fix #ISSUE_Number


Change logs

Describe your change clearly, including what problem is being solved or what feature is being added.

If it has some breaking backward or forward compatibility, please clary.

Why are the changes needed?

Describe why the changes are necessary.

Does this PR introduce any user-facing change?

If yes, please clarify the previous behavior and the change this PR proposes.

How was this patch tested?

Please detail how the changes were tested, including manual tests and any relevant unit or integration tests.

Contributor's Checklist

Here are some reminders and checklists before/when submitting your pull request, please check them:

avamingli commented 2 weeks ago

https://www.postgresql.org/message-id/CACiT8iazbUmeB0HBftcqzdVLWndm7o%2Bg8BtOYYqOK08SG-QK2w%40mail.gmail.com

Your patch to Postgres could give us the answer too. Let's wait for it. Also, I agree with the codes comments:

  Also it does not always give you all the syntactically legal
* completions, only those that are the most common or the ones that
* the programmer felt most like implementing.
reshke commented 2 weeks ago

Your patch to Postgres could give us the answer too. Let's wait for it.

Not really. This is tab-completion patterns that are applicable only for Greenplum/Cloudberry partitioning. So, it is CBDB community to decide if there patterns are needed in psql. I was very supersized when i discovered, that there are no tab-complete for these partition commands patterns, giving that partitions are widely used in Greenplum/Cloudberry.

avamingli commented 2 weeks ago

I was very supersized when i discovered, that there are no tab-complete for these partition commands patterns, giving that partitions are widely used in Greenplum/Cloudberry.

OK, make sense.

avamingli commented 2 weeks ago

HI, @reshke As I know Postgres doesn't have test on tab-completion, do we have a manual test on this?

reshke commented 2 weeks ago

HI, @reshke As I know Postgres doesn't have test on tab-completion, do we have a manual test on this?

Yes, I did manual test this. You only need to compile psql, not the whole server. (cd src/bin/psql && make )

avamingli commented 2 weeks ago

HI, @reshke As I know Postgres doesn't have test on tab-completion, do we have a manual test on this?

Yes, I did manual test this. You only need to compile psql, not the whole server. (cd src/bin/psql && make )

LGTM.