Thread: Call to build-in operator from new operator

Call to build-in operator from new operator

From
Kim Bille
Date:
Greetings,<br /><br /> I don't really know if this is the correct place to ask this question, if not please direct me
tothe correct mailing list.<br /><br /> I'm trying to develop a new operator for PostGreSQL (actually for TelegraphCQ,
whichis an extension of PSQL). Part of the operator's procedure is the @-operator. So now my question is: How do I call
theon_pb function from inside my own function?.<br /> The on_pb of course takes the argument 'PG_FUNCTION_ARGS' which
isdefined in fmgr.h as 'FunctionCallInfo fcinfo' which is defined as pointer to<br /> 'struct FunctionCallInfoData', so
myquestion boils down to:<br /><br /> What do I put into this struct to call 'on_pb' with two arguments from the call
tomy function?<br /><br /><br /> Further, is there a way to access data in tables in the database other than those
givenas arguments to the function? And how?<br /><br />Sincerely<br /> Kim Bille<br /> Department of Computer
Science<br/> Aalborg University<br /> Denmark<br /><br />-- <br />"Mind are like parachutes --- they only work when
open" 

Re: Call to build-in operator from new operator

From
Sailesh Krishnamurthy
Date:
As others pointed out, DirectFunctionCall2 is your friend. There is a
mailing list for TelegraphCQ. It's a Yahoo group - visit
http://groups.yahoo.com/group/telegraphcq 

About accessing data from a table in another database ... we need to
know more about what exactly you're doing. Please post on the tcq
mailing list.

-- 
Pip-pip
Sailesh
http://www.cs.berkeley.edu/~sailesh




Re: Call to build-in operator from new operator

From
"John Hansen"
Date:
Use the DirecFunctionCall1, DirecFunctionCall2, etc. functions.

... John

> -----Original Message-----
> From: pgsql-hackers-owner@postgresql.org
> [mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of kim@billes.dk
> Sent: Monday, April 18, 2005 10:40 PM
> To: pgsql-hackers@postgresql.org
> Subject: [HACKERS] Call to build-in operator from new operator
>
> Greetings,
>
> I don't really know if this is the correct place to ask this
> question, if not please direct me to the correct mailing list.
>
> I'm trying to develop a new operator for PostGreSQL (actually
> for TelegraphCQ, which is an extension of PSQL). Part of the
> operator's procedure is the @-operator. So now my question
> is: How do I call the on_pb function from inside my own function?.
> The on_pb of course takes the argument 'PG_FUNCTION_ARGS'
> which is defined in fmgr.h as 'FunctionCallInfo fcinfo' which
> is defined as pointer to 'struct FunctionCallInfoData', so my
> question boils down to:
>
> What do I put into this struct to call 'on_pb' with two
> arguments from the call to my function?
>
>
> Further, is there a way to access data in tables in the
> database other than those given as arguments to the function? And how?
>
> Sincerely
> Kim Bille
> Department of Computer Science
> Aalborg University
> Denmark
>
> --
> "Mind are like parachutes --- they only work when open"
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org
>
>