Drop All - Really means "ALL" - Is this a mistake?

Reading the docs:

GSQL> drop all
Delete the current graph and all its associated jobs and queries

In interpret this as dropping only 1 our of n graphs. I created 3 graphs:

  • GraphOne
  • GraphTwo
  • GraphThree

then ran these commands and got the following result.

GSQL > USE GRAPH GraphOne
Using graph 'GraphOne'
GSQL > drop all
Dropping all, about 1 minute ...
Abort all active loading jobs
Try to abort all loading jobs on graph GraphOne, it may take a while ...
[ABORT_SUCCESS] No active Loading Job to abort.
Try to abort all loading jobs on graph GraphTwo, it may take a while ...
[ABORT_SUCCESS] No active Loading Job to abort.
Try to abort all loading jobs on graph GraphThree, it may take a while ...
[ABORT_SUCCESS] No active Loading Job to abort.

Shutdown restpp gse gpe ...
Graph store /home/tigerghraph/data/tigergraph/gstore/0/ has been cleared!
Everything is dropped.
GSQL >

It dropped all graphs where I was expecting to drop only “GraphOne”.

Is this an error in the docs? Could lead to a really bad day…

Please let me know. Thank you.

Hi this is a document bug, I have reported to our doc team. Thank you.
To drop a graph, try

use global
drop GraphOne

The current “drop all” seems ignore the “use graph xxx” context, and drop the entire catalog.

Hi George,
According to the GSQL cheat sheet, DROP ALL erases all graph and job definitions, and clears graph store. So, all indeed means all.

USER GRAPH sets the context for work (i.e. when you refer to a vertex or query, the GSQL client will know where to look for that object), but it does not restrict the scope of DROP ALL to that graph. See @Mingxi_Wu’s comment above how to drop a single graph. (Note: you will need to drop loading jobs and queries first, before you can drop the schema).

George,
We found the one reference that seems to have an incorrect statement:
https://docs.tigergraph.com/intro/gsql-102/get-set#cheatsheet

All the other references to DROP ALL (https://docs.tigergraph.com/dev/gsql-ref/ddl-and-loading/running-a-loading-job#drop-all, etc.) seem to be correct. Thanks.

One implication: it would be a bad idea to name a graph ALL.

I’m not about to test this and try creating a graph named ALL, but I hope the TG code prevents a user from creating a graph with the name ALL.

@clemwang You are correct! We don’t allow users to use ALL. ALL is a reserved keyword. Meaning you cannot use it.

More info on reserved words:

1 Like

I noticed there was another thread about DROP SECRET but I didn’t see SECRET as a keyword. Would that be a problem?

I have my own graph and the social graph example.

What’s the correct order of DROPing all the components of my graph. (I don’t want to do DROP ALL, because I want to keep the social graph.)

By trial and error, I discovered that I have drop all the edges before dropping vertices. And it seems I need to drop JOB’s before dropping the Graph (and probably queries too.)

Or is there an easy DROP command to drop everything associated with a particular graph but not any other graphs?

It doesn’t seem to be documented anywhere that I could find…

Thanks in advance.