Initialization of Database
The database cluster is initialized
cd postgresql-11.18/
bin/initdb demo
Kickstarting the server
Make a database named dbyo
bin/pg_ctl -D demo -l logfile start
bin/createdb dbyo
The files and the database can now be seen in your terminal.
Start Querying
AGE has been added to pg. You can connect to the database and start exploring it.
bin/psql dbyo
AGE extension is loaded in order to start using it.
CREATE EXTENSION age;
LOAD 'age';
SET search_path = ag_catalog, "$user", public;
Queries with Cypher commands can be run like creating a graph, adding a node to it, and then displaying the node.
SELECT create_graph('demo_graph');
SELECT * FROM cypher('demo_graph', $$ CREATE (n:Person {name : "james", bornIn : "US"}) $$) AS (a agtype);
SELECT * FROM cypher('demo_graph', $$ MATCH (v) RETURN v $$) as (v agtype);
Top comments (0)