You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by GitBox <gi...@apache.org> on 2022/10/01 08:22:41 UTC

[GitHub] [age] Dzordzu opened a new issue, #302: Using postgres variables within cypher function

Dzordzu opened a new issue, #302:
URL: https://github.com/apache/age/issues/302

   As of now, after setting the variable for the session, one can create graph with it, but cannot query cypher
   
   ```sql
   select set_config('my.graph', 'test', false);
   SELECT * FROM create_graph(current_setting('my.graph'))
   
   # Error: A name constant is expected
   SELECT * FROM cypher(current_setting('my.graph'), $$ CREATE (x: Test) RETURN x $$) as (v agtype)
   ```
   
   ![image](https://user-images.githubusercontent.com/17514622/190863962-71ceeb8f-87f3-4fb5-b5d4-62f7eb2bc139.png)
   


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] jrgemignani commented on issue #302: Using postgres variables within cypher function

Posted by GitBox <gi...@apache.org>.
jrgemignani commented on issue #302:
URL: https://github.com/apache/age/issues/302#issuecomment-1262736707

   Updated above comment.


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] jrgemignani commented on issue #302: Using postgres variables within cypher function

Posted by GitBox <gi...@apache.org>.
jrgemignani commented on issue #302:
URL: https://github.com/apache/age/issues/302#issuecomment-1269163122

   Since there isn't a comment explaining why this issue was reopened, and the creator of the issue didn't reopen it, I'm closing this.
   
   Btw, @Dzordzu, the issue here is that when the query -
   
   `SELECT * FROM cypher(current_setting('my.graph'), $$ CREATE (x: Test) RETURN x $$) as (v agtype);`
   
   is run, the cypher function needs the actual graph name for the transform phase. However, by using a function for the graph name, this necessitates a function call node. That node will run in the execution phase. So, it won't know until execution what the graph name is. However, it needs to know the graph name before execution. 
   
   While it is possible to execute the function manually before the execution phase, there is an access operator passed in the function, the `.`  which also requires the execution phase to process. And then there is coercing the passed in value to the correct type.
   
   It does not seem likely, to me, to be able to do this at this time.


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] jrgemignani commented on issue #302: Using postgres variables within cypher function

Posted by GitBox <gi...@apache.org>.
jrgemignani commented on issue #302:
URL: https://github.com/apache/age/issues/302#issuecomment-1262573422

   I will take a look. This "should" be a relatively simple fix. I know, famous last words,...


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] jrgemignani commented on issue #302: Using postgres variables within cypher function

Posted by GitBox <gi...@apache.org>.
jrgemignani commented on issue #302:
URL: https://github.com/apache/age/issues/302#issuecomment-1265701944

   @JoshInnis Was this reopened by mistake? I don't see a comment explaining why it was reopened.


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] jrgemignani commented on issue #302: Using postgres variables within cypher function

Posted by GitBox <gi...@apache.org>.
jrgemignani commented on issue #302:
URL: https://github.com/apache/age/issues/302#issuecomment-1262615126

   Yep, not so simple,... 
   
   The issue here is that current_setting('my.graph') is a function call. That means it won't get evaluated until the execution phase, which is where the query is executed and you get your results. 
   
   However, the cypher function needs to know the graph name in the analyze phase, which is for all intents and purposes, the beginning.
   
   The only way to resolve this would be to execute this function directly and get the results. I will try to see if that is feasible.
   


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] Dzordzu closed issue #302: Using postgres variables within cypher function

Posted by GitBox <gi...@apache.org>.
Dzordzu closed issue #302: Using postgres variables within cypher function
URL: https://github.com/apache/age/issues/302


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] jrgemignani closed issue #302: Using postgres variables within cypher function

Posted by GitBox <gi...@apache.org>.
jrgemignani closed issue #302: Using postgres variables within cypher function
URL: https://github.com/apache/age/issues/302


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org