-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_age_db.sql
More file actions
38 lines (27 loc) · 1.33 KB
/
Copy pathsetup_age_db.sql
File metadata and controls
38 lines (27 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-- Drop the extension if it exists
DROP EXTENSION IF EXISTS age CASCADE;
-- Create the extension
CREATE EXTENSION age;
-- Set the search path for the current session
SET search_path = ag_catalog, "$user", public;
-- Drop the graph if it exists
SELECT * FROM ag_catalog.drop_graph('test_graph', true);
-- Create the graph
SELECT * FROM ag_catalog.create_graph('test_graph');
-- Set the search path for the age user
ALTER USER age SET search_path = ag_catalog, "$user", public;
-- Grant all privileges on the ag_catalog schema to the age user
GRANT ALL PRIVILEGES ON SCHEMA ag_catalog TO age;
-- Grant all privileges on all tables in the ag_catalog schema to the age user
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA ag_catalog TO age;
-- Grant all privileges on all sequences in the ag_catalog schema to the age user
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA ag_catalog TO age;
-- Grant all privileges on all functions in the ag_catalog schema to the age user
GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA ag_catalog TO age;
-- Grant all privileges on all procedures in the ag_catalog schema to the age user
GRANT ALL PRIVILEGES ON ALL PROCEDURES IN SCHEMA ag_catalog TO age;
-- Create a simple test vertex
SELECT * FROM ag_catalog.cypher('test_graph', $$
CREATE (n:Person {name: 'Test Person', age: 30})
RETURN n
$$) as (v ag_catalog.agtype);