On Thu, 18 Oct 2007 10:55:19 -0400
"Billow Gao" <[EMAIL PROTECTED]> wrote:
> Is it possible to write a dynamic loaded C function as an UDP or TCP
> What we want to do it is:
> Add a search function which send a UDP package to remote UDP server
> and then listen to an UDP port, waiting for the result.
> Ideally, we don't close the UDP server after the search query end.
> So we can reuse it for next search.
> Is it possible?

>Short answer: yes.  Slightly longer answer: If you need to ask this
>quetion then you should really talk to someone about network
>programming but this is the wrong list.

Thanks for your reply.

I can write the network program.
But I am not 100% sure whether I can add the c-language function (
to PostgreSQL. The function will be dynamic loaded by PostgreSQL.
I want to know whether there are any limitation on the function I wrote.

for example:
If I want to write a function:


And use it in PostgreSQL like:

SELECT name, c_talktoremoteudp

(emp, 1500) AS overpaid
    FROM emp
    WHERE name = 'Bill' OR name = 'Sam';

The function c_talktoremoteudp will:
1. send udp data to remote udp server
2. monitor an udp port and wait for the reply
3. return the data to the select query.

Anyway, I guess that it can be done. I will write a simple function to test


>If you are asking if PostgreSQL already does UDP then the answer is
>no.  You need to write a server program that talks UDP in one direction
>and TCP to PostgreSQL in the other direction.  Watch out for security

Reply via email to