skip to Main Content

I was wondering if I could utilize SPI to access the server and perform a query to return an agtype value. I wanted to implement a function that uses an already created one but then perform an ORDER BY and then return the agtype results from there. Would that be possible? If this is not possible, how could call another age_ function inside another and retrieve it’s results and use ODER BY with it?

2

Answers


  1. I don’t know about the SPI (Server Programming Interface), but you could look in fmgr.h for the DirectFunctionCall family of functions, which provide various ways to call other functions inside C.

    Here’s an example that demonstrates the usage:

    Datum result;
    result = DirectFunctionCall2(numeric_add, num1, num2);
    

    In this code snippet, the DirectFunctionCall2 function is used to call another function that adds two numeric values and returns the result.

    Login or Signup to reply.
  2. The SPI mechanism should work fine, but I think transform_cypher_order_by function is responsible for handling the ORDER BY clause. You should experiment with it and see if it works.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search