Re: [GENERAL] C Function Problem for bytea output

2005-12-28 Thread vishal saberwal
thanks tom, yes it was fopen problem ... the problem was solved when i did chown postgres ... i should have seen that ... thanks, vishOn 12/28/05, Tom Lane <[EMAIL PROTECTED]> wrote: vishal saberwal <[EMAIL PROTECTED]> writes:> I believe its something in the function but i can't spot the error

Re: [GENERAL] C Function Problem for bytea output

2005-12-28 Thread Tom Lane
vishal saberwal <[EMAIL PROTECTED]> writes: > I believe its something in the function but i can't spot the error. Well, that sure looks like a NULL result; have you considered the possibility that the fopen is failing? BTW, that code will happily clobber memory that doesn't belong to it if the pa

[GENERAL] C Function Problem for bytea output

2005-12-28 Thread vishal saberwal
hi all, I am trying to read a file from the File System. The function compiles fine, the function is created fine in postgres but the output is NULL/BLANK. The file does exists and has chmod 777 permission. PG_FUNCTION_INFO_V1(file_export); Datum file_export(PG_FUNCTION_ARGS) {     char *FilePat