[HACKERS] Why my C function is called twice?

2007-12-11 Thread Billow Gao
A very simple C function which I copied from the manual. And I found that it's called twice. Even in the function: if (SRF_IS_FIRSTCALL()) { ereport(INFO, (errcode(ERRCODE_IO_ERROR), errmsg("1"))); } An example output. You will find two INFO: 1 there.. Why a function is called twice and how

[HACKERS] How to write a c-function to return multiple bytea rows

2007-11-28 Thread Billow Gao
I can return multiple strings w/o problem. But if I tried to return multiple bytea rows. It only return 10 rows with empty data. Please see the code below. Also, when I compile it, I had warning: test.c:121: warning: assignment makes pointer from integer without a cast The line is: tuple = heap_f

Re: [HACKERS] Can a C function(server program) be a UDP or TCP server?

2007-10-18 Thread Billow Gao
Cain <[EMAIL PROTECTED]> wrote: > > On Thu, 18 Oct 2007 11:24:24 -0400 > "Billow Gao" <[EMAIL PROTECTED]> wrote: > > I can write the network program. > > But I am not 100% sure whether I can add the c-language function ( > > http://www.postgresql.

Re: [HACKERS] Can a C function(server program) be a UDP or TCP server?

2007-10-18 Thread Billow Gao
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 server? > > What we want to do it is: > Add a search function which send a UDP package to remote UDP server > and then

[HACKERS] Can a C function(server program) be a UDP or TCP server?

2007-10-18 Thread Billow Gao
Hi there, Is it possible to write a dynamic loaded C function as an UDP or TCP server? 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 quer