On Tue, Dec 14, 2004 at 10:31:41AM -0800, Sibtay Abbas wrote: > i am not able to write to file until the pl call > handler interface.
What are you expecting to happen and what actually does happen? Saying only "it doesn't work" doesn't give us much to go on. > this is the template which i am following > > PG_FUNCTION_INFO_V1(my_call_handler); > > Datum > my_call_handler(PG_FUNCTION_ARGS) > { > ...my code... > > int fd = open("filename",O_WRONLY); > write(fd,buffer,strlen(buffer) + 1); > > //fsync(fd).......i tried this as well but > did'nt work > > } A simple but complete example would be helpful so we can see everything you're doing; the parts of the code that you don't show could be relevant to the problem. Reducing the problem to the smallest possible example can also help you find where the mistake is by eliminating where it isn't. You show no error checking. Check the return value of all functions that can fail and use ereport() or elog() to report any failures. You also don't show where buffer comes from, so we don't know if its contents are a problem or not. And is "filename" the actual name in your code? Where are you expecting that file to be? Some programming mistakes can be spotted by the compiler. Turn on as many compiler warnings as you can. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org