Accessing a database via AJAX scripts

Поиск
Список
Период
Сортировка
От Glen Eustace
Тема Accessing a database via AJAX scripts
Дата
Msg-id 4C5DE4D2.9040700@godzone.net.nz
обсуждение исходный текст
Ответы Re: Accessing a database via AJAX scripts  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I am not sure where my issue lies - apache, perl or postgresql, but as
they say, one has to start somewhere.

My goal is to have a perl cgi script (that is accessed using AJAX)
perform some operations in a database using DBI.  Some of the actions
are likely to take a while so my intent was to have a table that the
backend process periodically writes status messages into.  The front end
web page then uses another AJAX script to watch this table.

I am coming unstuck, the monitoring script works but the backend
processing doesn't.

My first attempts would not show anything at the front end as the
initial response from the backend was not getting through the system
until the backend completely finished (even having set no buffering on
STDOUT).  After googling abit, it would appear that the way around this
is to fork the back-end to allow apache to complete the initial response
and then carry on the processing in the forked child process.
I have opted to use Proc::Daemon to do this. Now I am getting a Pg error
"could not receive data from server: Bad file descriptor".

I have attempted re-opening STDOUT and STDERR in the forked process but
that didn't make any difference.

I am obviously missing something here.  If anyone has done something
similar and has it working I'd appreciate any help I can get.

Glen
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Glen and Rosanne Eustace,
GodZone Internet Services, a division of AGRE Enterprises Ltd.,
P.O. Box 8020, Palmerston North, New Zealand 4446
Ph: +64 6 357 8168, Fax: +64 6 357 8165, Mob: +64 27 542 4015

"A Ministry specialising in providing low-cost professional Internet
Services to NZ Christian Churches, Ministries and Organisations"

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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: Using AND in query
Следующее
От: Clemens Eisserer
Дата:
Сообщение: Howto only select secific lines from a result?