@@ -66,26 +66,26 @@ PGMODULEEXPORT Datum create_graph(PG_FUNCTION_ARGS)
6666 char * graph_name_str ;
6767 Oid nsp_id ;
6868
69- // if no argument is passed with the function, graph name cannot be null
69+ /* if no argument is passed with the function, graph name cannot be null */
7070 if (PG_ARGISNULL (0 ))
7171 {
7272 ereport (ERROR , (errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
7373 errmsg ("graph name can not be NULL" )));
7474 }
7575
76- // gets graph name as function argument
76+ /* gets graph name as function argument */
7777 graph_name = PG_GETARG_NAME (0 );
7878
7979 graph_name_str = NameStr (* graph_name );
8080
81- // checking if the name of the graph falls under the pre-decided graph naming conventions(regex)
81+ /* checking if the name of the graph falls under the pre-decided graph naming conventions(regex) */
8282 if (!is_valid_graph_name (graph_name_str ))
8383 {
8484 ereport (ERROR , (errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
8585 errmsg ("graph name is invalid" )));
8686 }
8787
88- // graph name must be unique, a graph with the same name should not exist
88+ /* graph name must be unique, a graph with the same name should not exist */
8989 if (graph_exists (graph_name_str ))
9090 {
9191 ereport (ERROR ,
@@ -95,21 +95,21 @@ PGMODULEEXPORT Datum create_graph(PG_FUNCTION_ARGS)
9595
9696 nsp_id = create_schema_for_graph (graph_name );
9797
98- // inserts the graph info into the relation which has all the other existing graphs info
98+ /* inserts the graph info into the relation which has all the other existing graphs info */
9999 insert_graph (graph_name , nsp_id );
100100
101- // Increment the Command counter before create the generic labels.
101+ /* Increment the Command counter before create the generic labels. */
102102 CommandCounterIncrement ();
103103
104- // Create the default label tables
104+ /* Create the default label tables */
105105 graph = graph_name -> data ;
106106 create_label (graph , AG_DEFAULT_LABEL_VERTEX , LABEL_TYPE_VERTEX , NIL );
107107 create_label (graph , AG_DEFAULT_LABEL_EDGE , LABEL_TYPE_EDGE , NIL );
108108
109109 ereport (NOTICE ,
110110 (errmsg ("graph \"%s\" has been created" , NameStr (* graph_name ))));
111111
112- // according to postgres specification of c-language functions if function returns void this is the syntax
112+ /* according to postgres specification of c-language functions if function returns void this is the syntax */
113113 PG_RETURN_VOID ();
114114}
115115
@@ -158,7 +158,7 @@ static Oid create_schema_for_graph(const Name graph_name)
158158 schema_stmt -> if_not_exists = false;
159159 nsp_id = CreateSchemaCommand (schema_stmt ,
160160 "(generated CREATE SCHEMA command)" , -1 , -1 );
161- // CommandCounterIncrement() is called in CreateSchemaCommand()
161+ /* CommandCounterIncrement() is called in CreateSchemaCommand() */
162162
163163 return nsp_id ;
164164}
@@ -208,7 +208,7 @@ static void drop_schema_for_graph(char *graph_name_str, const bool cascade)
208208 * so the event triggers will not be fired.
209209 */
210210
211- // DROP SEQUENCE `graph_name_str`.`LABEL_ID_SEQ_NAME`
211+ /* DROP SEQUENCE `graph_name_str`.`LABEL_ID_SEQ_NAME` */
212212 drop_stmt = makeNode (DropStmt );
213213 schema_name = makeString (get_graph_namespace_name (graph_name_str ));
214214 label_id_seq_name = list_make2 (schema_name , makeString (LABEL_ID_SEQ_NAME ));
@@ -219,28 +219,28 @@ static void drop_schema_for_graph(char *graph_name_str, const bool cascade)
219219 drop_stmt -> concurrent = false;
220220
221221 RemoveRelations (drop_stmt );
222- // CommandCounterIncrement() is called in RemoveRelations()
222+ /* CommandCounterIncrement() is called in RemoveRelations() */
223223
224- // DROP SCHEMA `graph_name_str` [ CASCADE ]
224+ /* DROP SCHEMA `graph_name_str` [ CASCADE ] */
225225 behavior = cascade ? DROP_CASCADE : DROP_RESTRICT ;
226226 remove_schema ((Node * )schema_name , behavior );
227- // CommandCounterIncrement() is called in performDeletion()
227+ /* CommandCounterIncrement() is called in performDeletion() */
228228}
229229
230- // See RemoveObjects() for more details.
230+ /* See RemoveObjects() for more details. */
231231static void remove_schema (Node * schema_name , DropBehavior behavior )
232232{
233233 ObjectAddress address ;
234234 Relation relation ;
235235
236236 address = get_object_address (OBJECT_SCHEMA , schema_name , & relation ,
237237 AccessExclusiveLock , false);
238- // since the target object is always a schema, relation is NULL
238+ /* since the target object is always a schema, relation is NULL */
239239 Assert (!relation );
240240
241241 if (!OidIsValid (address .objectId ))
242242 {
243- // missing_ok is always false
243+ /* missing_ok is always false */
244244
245245 /*
246246 * before calling this function, this condition is already checked in
@@ -252,7 +252,7 @@ static void remove_schema(Node *schema_name, DropBehavior behavior)
252252 strVal (schema_name ))));
253253 }
254254
255- // removeType is always OBJECT_SCHEMA
255+ /* removeType is always OBJECT_SCHEMA */
256256
257257 /*
258258 * Check permissions. Since the target object is always a schema, the
@@ -261,9 +261,9 @@ static void remove_schema(Node *schema_name, DropBehavior behavior)
261261 check_object_ownership (GetUserId (), OBJECT_SCHEMA , address , schema_name ,
262262 NULL );
263263
264- // the target schema is not temporary
264+ /* the target schema is not temporary */
265265
266- // the target object is always a schema
266+ /* the target object is always a schema */
267267
268268 /*
269269 * set PERFORM_DELETION_INTERNAL flag so that object_access_hook can ignore
@@ -356,7 +356,7 @@ static void rename_graph(const Name graph_name, const Name new_name)
356356 (errmsg ("graph \"%s\" renamed to \"%s\"" , oldname , newname )));
357357}
358358
359- // returns a list containing the name of every graph in the database
359+ /* returns a list containing the name of every graph in the database */
360360List * get_graphnames (void )
361361{
362362 TupleTableSlot * slot ;
@@ -394,7 +394,7 @@ List *get_graphnames(void)
394394 return graphnames ;
395395}
396396
397- // deletes all the graphs in the list.
397+ /* deletes all the graphs in the list. */
398398void drop_graphs (List * graphnames )
399399{
400400 ListCell * lc ;
0 commit comments