Hi,
I've mailed this previously to the novice list, but got no response, so 
hopefully this is more the appropriate place.

I'm trying to invoke the DirectFunctionCall1function as follows:

 
                        BOX* __tmp;
                        Datum d = DirectFunctionCall1(box_in, 
BoxPGetDatum(ret_bbox));
                        __tmp = DatumGetBoxP(d); 

(where ret_bbox is a string representation of a box)

from some client side code, but get linker errors stating that:

-> undefined reference to `DirectFunctionCall1(unsigned long 
(*)(FunctionCallInfoData*), unsigned long)'

-->  undefined reference to `box_in(FunctionCallInfoData*)

Is this because I'm calling the function incorrectly, or because I'm 
missing the library in which these functions reside?

Many thanks,


Tony


Wed, 19 Jun 2002 10:37:20 +0100
"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk>
Missing library files??
"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk> writes:
> I'm trying to invoke the DirectFunctionCall1function as follows:
> ...
> from some client side code, but get linker errors stating that:

> -> undefined reference to `DirectFunctionCall1(unsigned long 
> (*)(FunctionCallInfoData*), unsigned long)'

> Is this because I'm calling the function incorrectly, or because I'm 
> missing the library in which these functions reside?

There *is* no "library in which those functions reside".  They are
internal to the server and are not designed to be included in
client-side code.

			regards, tom lane

Wed, 19 Jun 2002 09:13:48 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Missing library files?? 
Tom Lane wrote:

>"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk> writes:
>
>>I'm trying to invoke the DirectFunctionCall1function as follows:
>>...
>>from some client side code, but get linker errors stating that:
>>
>
>>-> undefined reference to `DirectFunctionCall1(unsigned long 
>>(*)(FunctionCallInfoData*), unsigned long)'
>>
>
>>Is this because I'm calling the function incorrectly, or because I'm 
>>missing the library in which these functions reside?
>>
>
>There *is* no "library in which those functions reside".  They are
>internal to the server and are not designed to be included in
>client-side code.
>
Fair enough - that's what I half expected. I'm wanting to write some 
embedded sql that selects a box attribute from a relation - is there any 
direct way of retrieving a BOX typed value from the select without 
having to go through decoding the retrieved string. I know I can do this 
using a binary cursor, but this means moving from embedded sql.

Thanks,

Tony



>
>
>			regards, tom lane
>








Tom Lane wrote:

"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk> writes:

I'm trying to invoke the DirectFunctionCall1function as follows:...from some client side code, but get linker errors stating that:



-> undefined reference to `DirectFunctionCall1(unsigned long (*)(FunctionCallInfoData*), unsigned long)'



Is this because I'm calling the function incorrectly, or because I'm missing the library in which these functions reside?

There *is* no "library in which those functions reside".  They areinternal to the server and are not designed to be included inclient-side code.

Fair enough - that's what I half expected. I'm wanting to write some embedded
sql that selects a box attribute from a relation - is there any direct way
of retrieving a BOX typed value from the select without having to go through
decoding the retrieved string. I know I can do this using a binary cursor,
but this means moving from embedded sql.

Thanks,

Tony




			regards, tom lane
Wed, 19 Jun 2002 14:31:36 +0100
"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk>
Re: Missing library files??
Gavin Sherry wrote:

>On Wed, 19 Jun 2002, Tom Lane wrote:
>
>>"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk> writes:
>>
>>>I'm trying to invoke the DirectFunctionCall1function as follows:
>>>...
>>>from some client side code, but get linker errors stating that:
>>>
>>>-> undefined reference to `DirectFunctionCall1(unsigned long 
>>>(*)(FunctionCallInfoData*), unsigned long)'
>>>
>>>Is this because I'm calling the function incorrectly, or because I'm 
>>>missing the library in which these functions reside?
>>>
>>There *is* no "library in which those functions reside".  They are
>>internal to the server and are not designed to be included in
>>client-side code.
>>
>
>You can access this function using the Fast Path Interface. See the libpq
>documentation. However, I am unsure why you would want to get access to
>this function on the client side.
>

I'm retrieving a box value via embedded sql, and wanted to use the 
box_in method to decode the retrieved string - unless there's a direct 
way of retrieving into a variable of the C type BOX??

>
>
>Gavin
>
>








Gavin Sherry wrote:

On Wed, 19 Jun 2002, Tom Lane wrote:

"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk> writes:

I'm trying to invoke the DirectFunctionCall1function as follows:...from some client side code, but get linker errors stating that:


-> undefined reference to `DirectFunctionCall1(unsigned long (*)(FunctionCallInfoData*), unsigned long)'


Is this because I'm calling the function incorrectly, or because I'm missing the library in which these functions reside?

There *is* no "library in which those functions reside".  They areinternal to the server and are not designed to be included inclient-side code.

You can access this function using the Fast Path Interface. See the libpqdocumentation. However, I am unsure why you would want to get access tothis function on the client side.


I'm retrieving a box value via embedded sql, and wanted to use the box_in
method to decode the retrieved string - unless there's a direct way of retrieving
into a variable of the C type BOX??


Gavin
Wed, 19 Jun 2002 14:43:34 +0100
"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk>
Re: Missing library files??
On Wed, 19 Jun 2002, Tom Lane wrote:

> "Tony Griffiths(RA)" <griffitt@cs.man.ac.uk> writes:
> > I'm trying to invoke the DirectFunctionCall1function as follows:
> > ...
> > from some client side code, but get linker errors stating that:
> 
> > -> undefined reference to `DirectFunctionCall1(unsigned long 
> > (*)(FunctionCallInfoData*), unsigned long)'
> 
> > Is this because I'm calling the function incorrectly, or because I'm 
> > missing the library in which these functions reside?
> 
> There *is* no "library in which those functions reside".  They are
> internal to the server and are not designed to be included in
> client-side code.

You can access this function using the Fast Path Interface. See the libpq
documentation. However, I am unsure why you would want to get access to
this function on the client side.

Gavin



Wed, 19 Jun 2002 23:44:21 +1000 (EST)
Gavin Sherry <swm@linuxworld.com.au>
Re: Missing library files?? 
"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk> writes:
> Fair enough - that's what I half expected. I'm wanting to write some 
> embedded sql that selects a box attribute from a relation - is there any 
> direct way of retrieving a BOX typed value from the select without 
> having to go through decoding the retrieved string. I know I can do this 
> using a binary cursor, but this means moving from embedded sql.

The binary representation of BOX wouldn't necessarily be the same on
client and server machines anyway (surely you don't want to wire in
an assumption that client and server are on the same kind of hardware).

I'd say bite the bullet and parse the ASCII string; it's hardly
difficult.

			regards, tom lane

Wed, 19 Jun 2002 10:06:04 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Missing library files?? 
Tom Lane wrote:

>"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk> writes:
>
>>Fair enough - that's what I half expected. I'm wanting to write some 
>>embedded sql that selects a box attribute from a relation - is there any 
>>direct way of retrieving a BOX typed value from the select without 
>>having to go through decoding the retrieved string. I know I can do this 
>>using a binary cursor, but this means moving from embedded sql.
>>
>
>The binary representation of BOX wouldn't necessarily be the same on
>client and server machines anyway (surely you don't want to wire in
>an assumption that client and server are on the same kind of hardware).
>
>I'd say bite the bullet and parse the ASCII string; it's hardly
>difficult.
>

True, but if you guys decide to change the structure of a box string 
down the line then not too good for backwards compatibility. sscanf here 
I come....

>
>
>			regards, tom lane
>








Tom Lane wrote:

"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk> writes:

Fair enough - that's what I half expected. I'm wanting to write some embedded sql that selects a box attribute from a relation - is there any direct way of retrieving a BOX typed value from the select without having to go through decoding the retrieved string. I know I can do this using a binary cursor, but this means moving from embedded sql.

The binary representation of BOX wouldn't necessarily be the same onclient and server machines anyway (surely you don't want to wire inan assumption that client and server are on the same kind of hardware).I'd say bite the bullet and parse the ASCII string; it's hardlydifficult.


True, but if you guys decide to change the structure of a box string down
the line then not too good for backwards compatibility. sscanf here I come....


			regards, tom lane
Wed, 19 Jun 2002 15:18:57 +0100
"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk>
Re: Missing library files??