dbTalk Databases Forums  

Linking question

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss Linking question in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Katsaros Kwn/nos
 
Posts: n/a

Default Linking question - 10-21-2004 , 01:26 AM






Hi,

I want to make use of some contrib/dblink functions inside my user
defined functions, e.g. I would like to be able to call dblink_record()
from my user defined code in this way:

dblink_record("param1","param2");

Is this possible?

I would like to avoid:

1) inserting all the dblink code in my *.c file. This would not be a
very clean way.

2) executing: "select dblink(...)"

Any ideas on how to link my user-defined function with functions in
another file? This is maybe a C question but I'm not good at it at all!


Thanks in advance!!
Ntinos


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
  #2  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: Linking question - 10-23-2004 , 11:39 PM






On Thu, Oct 21, 2004 at 09:26:30AM +0300, Katsaros Kwn/nos wrote:
Quote:
I want to make use of some contrib/dblink functions inside my user
defined functions, e.g. I would like to be able to call dblink_record()
from my user defined code in this way:

dblink_record("param1","param2");

Is this possible?

I would like to avoid:

1) inserting all the dblink code in my *.c file. This would not be a
very clean way.

2) executing: "select dblink(...)"
Why do you want to avoid "select dblink(...)"? It would be easy
to handle such a query with the Server Programming Interface (SPI):

http://www.postgresql.org/docs/7.4/static/spi.html

If you don't use SPI then you're probably going to have to duplicate
some of the magic it performs. This seems needless, especially
since you admit that you're not good at C.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.