Re: cant write to file within call handler interface

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: cant write to file within call handler interface
Дата
Msg-id 17442.1103057411@sss.pgh.pa.us
обсуждение исходный текст
Ответ на cant write to file within call handler interface  (Sibtay Abbas <sibtay_abbas@yahoo.com>)
Список pgsql-hackers
Sibtay Abbas <sibtay_abbas@yahoo.com> writes:
> i am not able to write to file until the pl call
> handler interface. 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);

Perhaps a little bit of checking for error returns would reveal the
problem.  Other theories are (a) you forgot to close the file so no
write occurred; (b) the file was written but not where you think because
the filename is relative to the backend's working directory.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Mark Wong
Дата:
Сообщение: Re: [Testperf-general] BufferSync and bgwriter
Следующее
От: Tom Lane
Дата:
Сообщение: Re: possible wierd boolean bug?