Using Sockets in postgres

Поиск
Список
Период
Сортировка
От J S B
Тема Using Sockets in postgres
Дата
Msg-id a47902760610162349v1854ca6bm320b72af00732f56@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Hi,

I've made a client and a server program in C using socket library.

The client is in the postgres database server and Server is on some other machine.

My goal is to compile the client as a shared object, load it dynamically in postgres (in a function), execute that postgres function in which this shared library (client) is dynamically loaded and connect to the server (hosted on some other machine outside the domain of postgres database server).
In otherwords, connecting to another server through postgres database using the client code dynamically loaded in postgres.

Now, here starts the problem. In my client code when i use functions like gethostbyname as follows,

server = gethostbyname("www.yahoo.com");
serv_addr.sin_addr.s_addr = inet_addr("server");

It closes my postgres server and gives the follwowing error message:-

server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.

After commenting my code at various lines, I figured out that gethostbyname() function is the cause of this error message.

Can anyone please throw light on this problem.

Thanks,
~Jas

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

Предыдущее
От: "Carlos H. Reimer"
Дата:
Сообщение: RES: RES: RES: RES: Dates rejected
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: Using Sockets in postgres