jrgemignani commented on issue #41: URL: https://github.com/apache/incubator-age/issues/41#issuecomment-794493972
Okay, so I was incorrect - sort of - when I said that the load command didn't need to be used after the first time (with the create extension),... The first time you execute a command against the library for the extension, it forces a load of that library. But, the command still fails. Subsequent commands referencing it don't, however. So, you can either do the load initially or just expect the first one to fail and account for it. However, if you want to use *load *for this library (not as a superuser) you need to put a link to the extension's library into the $libdir/plugins directory and then restart the server. You may need to create this directory if it doesn't already exist. [jgemignani@cent7nuc7i5bnk plugins]$ ls -al ~jgemignani/POSTGRESQL/postgresql-11.5/psql-11.5-5432-psql/lib/plugins total 4 drwxr-xr-x. 2 jgemignani jgemignani 20 Mar 9 13:20 . drwxrwxr-x. 5 jgemignani jgemignani 4096 Mar 9 13:18 .. lrwxrwxrwx. 1 jgemignani jgemignani 9 Mar 9 13:20 age.so -> ../age.so [jgemignani@cent7nuc7i5bnk plugins]$ Then you can do *load '$libdir/plugins/age.so'* only (as a non super user) - psql-11.5-5432-psql=> load 'age'; ERROR: access to library "age" is not allowed psql-11.5-5432-psql=> load 'age.so'; ERROR: access to library "age.so" is not allowed psql-11.5-5432-psql=> *load '$libdir/plugins/age.so';* LOAD psql-11.5-5432-psql=> *set search_path = ag_catalog;* SET psql-11.5-5432-psql=> *SELECT * FROM cypher('testgraph', $$MATCH (p) return p$$) as (a agtype);* a ----------------------------------------------------------------------------------- {"id": 844424930131969, "label": "Person", "properties": {"name": "Tom"}}::vertex (1 row) psql-11.5-5432-psql=> John On Tue, Mar 9, 2021 at 12:41 PM John Gemignani <jrgemign...@gmail.com> wrote: > Interesting. And, ty, I can reproduce it. > > I will look into it. > > john > > On Tue, Mar 9, 2021 at 12:27 PM Pieterjan De Potter < > notificati...@github.com> wrote: > >> After creating a new database connection, the first cypher query results >> in a ERROR: unhandled cypher(cstring) function call error. This error >> does not occur on subsequent cypher queries, or if a create_graph query has >> been executed prior to the cypher query. >> >> How to reproduce: >> >> - Set up database >> >> vagrant@local:~$ sudo -u postgres createdb testdb >> vagrant@local:~$ sudo -u postgres psql -d testdb -c "CREATE EXTENSION age;" >> CREATE EXTENSION >> vagrant@local:~$ sudo -u postgres psql -d testdb -c "LOAD 'age';" >> LOAD >> >> >> - First connection to create a graph and add some data. Here, the >> cypher query succeeds. >> >> vagrant@local:~$ sudo -u postgres psql -d testdb >> psql (11.7 (Debian 11.7-0+deb10u1), server 11.10 (Debian 11.10-0+deb10u1)) >> Type "help" for help. >> >> testdb=# SET search_path = ag_catalog, "$user", public; >> SET >> testdb=# SELECT create_graph('testgraph'); >> NOTICE: graph "testgraph" has been created >> create_graph >> -------------- >> >> (1 row) >> >> testdb=# SELECT * from cypher('testgraph', $$ CREATE (a:Person {name: 'Tom'}) $$) as (a agtype); >> a >> --- >> (0 rows) >> >> testdb=# \q >> >> >> - Second connection to query the graph. The first cypher query fails, >> the second query succeeds. >> >> vagrant@local:~$ sudo -u postgres psql -d testdb >> psql (11.7 (Debian 11.7-0+deb10u1), server 11.10 (Debian 11.10-0+deb10u1)) >> Type "help" for help. >> >> testdb=# SET search_path = ag_catalog, "$user", public; >> SET >> testdb=# SELECT * FROM cypher('testgraph', $$MATCH (p) return p$$) as (a agtype); >> ERROR: unhandled cypher(cstring) function call >> DETAIL: testgraph >> testdb=# SELECT * FROM cypher('testgraph', $$MATCH (p) return p$$) as (a agtype); >> >> a >> ----------------------------------------------------------------------------------- >> {"id": 844424930131969, "label": "Person", "properties": {"name": "Tom"}}::vertex >> (1 row) >> >> (END) >> >> testdb=# \q >> >> >> - Third connection to add more data. The first cypher query again >> fails, the second query again succeeds. >> >> vagrant@local:~$ sudo -u postgres psql -d testdb >> psql (11.7 (Debian 11.7-0+deb10u1), server 11.10 (Debian 11.10-0+deb10u1)) >> Type "help" for help. >> >> testdb=# SET search_path = ag_catalog, "$user", public; >> SET >> testdb=# SELECT * from cypher('testgraph', $$ CREATE (a:Person {name: 'Ann'}) $$) as (a agtype); >> ERROR: unhandled cypher(cstring) function call >> DETAIL: testgraph >> testdb=# SELECT * from cypher('testgraph', $$ CREATE (a:Person {name: 'Ann'}) $$) as (a agtype); >> a >> --- >> (0 rows) >> >> testdb=# \q >> >> — >> You are receiving this because you are subscribed to this thread. >> Reply to this email directly, view it on GitHub >> <https://github.com/apache/incubator-age/issues/41>, or unsubscribe >> <https://github.com/notifications/unsubscribe-auth/AALPO4CMQG4HXWNQCTBRA5DTC2ABZANCNFSM4Y4NEVJA> >> . >> > ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org