Add more tab=completion rules for DROP PROPERTY GRAPH

Started by Peter Smith20 days ago6 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

This thread has been committed, so CI has stopped here. Anything below is the last result it produced.

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t253303
psql -h localhost -U postgres

Built from patchset v1 (message #1), August 05, 2026 at 05:24 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t253303_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t253303_1 && git checkout t253303_1

Patchset v1 (message #1) is on t253303_1

Jump to latest
#1Peter Smith
smithpb2250@gmail.com

Here's a patch to add another tab-completion rule for DROP PROPERTY GRAPH [1]https://www.postgresql.org/docs/19/sql-drop-property-graph.html

The logic is the same as DROP MATERIALIZED VIEW [2]https://www.postgresql.org/docs/19/sql-dropmaterializedview.html which has a very
similar syntax.

PSA v1.

======
[1]: https://www.postgresql.org/docs/19/sql-drop-property-graph.html
[2]: https://www.postgresql.org/docs/19/sql-dropmaterializedview.html

Kind Regards,
Peter Smith.
Fujitsu Australia

Attachments:

t253303_1
v1-0001-tab-complete-for-DROP-PROPERTY-GRAPH.patchapplication/octet-stream; name=v1-0001-tab-complete-for-DROP-PROPERTY-GRAPH.patchDownload+2-1
#2Chao Li
li.evan.chao@gmail.com
In reply to: Peter Smith (#1)
Re: Add more tab=completion rules for DROP PROPERTY GRAPH

On Aug 4, 2026, at 13:11, Peter Smith <smithpb2250@gmail.com> wrote:

Here's a patch to add another tab-completion rule for DROP PROPERTY GRAPH [1]

The logic is the same as DROP MATERIALIZED VIEW [2] which has a very
similar syntax.

PSA v1.

======
[1] https://www.postgresql.org/docs/19/sql-drop-property-graph.html
[2] https://www.postgresql.org/docs/19/sql-dropmaterializedview.html

Kind Regards,
Peter Smith.
Fujitsu Australia
<v1-0001-tab-complete-for-DROP-PROPERTY-GRAPH.patch>

I think you also need to handle “IF EXISTS”. With v1, MatchAny considers “IF” as a relation name, thus it suggests "CASCADE RESTRICT”, and when “IF EXISTS” is given, it doesn’t suggest anything:
```
evantest=# drop property graph if
CASCADE RESTRICT
evantest=# drop property graph if exists a

```

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

#3Peter Smith
smithpb2250@gmail.com
In reply to: Chao Li (#2)
Re: Add more tab=completion rules for DROP PROPERTY GRAPH

On Tue, Aug 4, 2026 at 6:26 PM Chao Li <li.evan.chao@gmail.com> wrote:

On Aug 4, 2026, at 13:11, Peter Smith <smithpb2250@gmail.com> wrote:

Here's a patch to add another tab-completion rule for DROP PROPERTY GRAPH [1]

The logic is the same as DROP MATERIALIZED VIEW [2] which has a very
similar syntax.

PSA v1.

======
[1] https://www.postgresql.org/docs/19/sql-drop-property-graph.html
[2] https://www.postgresql.org/docs/19/sql-dropmaterializedview.html

Kind Regards,
Peter Smith.
Fujitsu Australia
<v1-0001-tab-complete-for-DROP-PROPERTY-GRAPH.patch>

I think you also need to handle “IF EXISTS”. With v1, MatchAny considers “IF” as a relation name, thus it suggests "CASCADE RESTRICT”, and when “IF EXISTS” is given, it doesn’t suggest anything:
```
evantest=# drop property graph if
CASCADE RESTRICT
evantest=# drop property graph if exists a

Yeah, this patch only added CASECADE|RESTRICT in a way that's
compatible with many of the other DROPS...

(As mentioned in the original post, I copied the same rules as seen in
DROP MATERIALIZED VIEW)

So, what you reported is definitely a problem, but IMO it's a separate
problem beyond the scope for this little patch.

There's a lot of existing code which won't behave correctly for your
IF EXISTS...

e.g. Try any of these:
- DROP MATERIALIZED VIEW IF <tab>
- DROP INDEX IF <tab>
- DROP ACCESS METHOD IF <tab>
- DROP EVENT TRIGGER IF <tab>
etc...

======
Kind Regards,
Peter Smith.
Fujitsu Australia

#4Chao Li
li.evan.chao@gmail.com
In reply to: Peter Smith (#3)
Re: Add more tab=completion rules for DROP PROPERTY GRAPH

On Aug 4, 2026, at 17:10, Peter Smith <smithpb2250@gmail.com> wrote:

On Tue, Aug 4, 2026 at 6:26 PM Chao Li <li.evan.chao@gmail.com> wrote:

On Aug 4, 2026, at 13:11, Peter Smith <smithpb2250@gmail.com> wrote:

Here's a patch to add another tab-completion rule for DROP PROPERTY GRAPH [1]

The logic is the same as DROP MATERIALIZED VIEW [2] which has a very
similar syntax.

PSA v1.

======
[1] https://www.postgresql.org/docs/19/sql-drop-property-graph.html
[2] https://www.postgresql.org/docs/19/sql-dropmaterializedview.html

Kind Regards,
Peter Smith.
Fujitsu Australia
<v1-0001-tab-complete-for-DROP-PROPERTY-GRAPH.patch>

I think you also need to handle “IF EXISTS”. With v1, MatchAny considers “IF” as a relation name, thus it suggests "CASCADE RESTRICT”, and when “IF EXISTS” is given, it doesn’t suggest anything:
```
evantest=# drop property graph if
CASCADE RESTRICT
evantest=# drop property graph if exists a

Yeah, this patch only added CASECADE|RESTRICT in a way that's
compatible with many of the other DROPS...

(As mentioned in the original post, I copied the same rules as seen in
DROP MATERIALIZED VIEW)

So, what you reported is definitely a problem, but IMO it's a separate
problem beyond the scope for this little patch.

There's a lot of existing code which won't behave correctly for your
IF EXISTS...

e.g. Try any of these:
- DROP MATERIALIZED VIEW IF <tab>
- DROP INDEX IF <tab>
- DROP ACCESS METHOD IF <tab>
- DROP EVENT TRIGGER IF <tab>
etc...

Ah, I’m not aware of that. Looks like CREATE has the same problem. So, I won’t expect this patch to do anything especially.

V1 looks good to me.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

#5Peter Eisentraut
peter_e@gmx.net
In reply to: Peter Smith (#1)
Re: Add more tab=completion rules for DROP PROPERTY GRAPH

On 04.08.26 07:11, Peter Smith wrote:

Here's a patch to add another tab-completion rule for DROP PROPERTY GRAPH [1]

The logic is the same as DROP MATERIALIZED VIEW [2] which has a very
similar syntax.

committed

#6Peter Smith
smithpb2250@gmail.com
In reply to: Peter Eisentraut (#5)
Re: Add more tab=completion rules for DROP PROPERTY GRAPH

On Wed, Aug 5, 2026 at 4:47 PM Peter Eisentraut <peter@eisentraut.org> wrote:

On 04.08.26 07:11, Peter Smith wrote:

Here's a patch to add another tab-completion rule for DROP PROPERTY GRAPH [1]

The logic is the same as DROP MATERIALIZED VIEW [2] which has a very
similar syntax.

committed

Thanks for pushing!

======
Kind Regards,
Peter Smith.
Fujitsu Australia