Re: Simulation output using libpq

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Simulation output using libpq
Дата
Msg-id 20040109041637.GC31586@wolff.to
обсуждение исходный текст
Ответ на Simulation output using libpq  ("Daryl Shanley" <Daryl.Shanley@newcastle.ac.uk>)
Список pgsql-general
On Tue, Jan 06, 2004 at 10:50:57 -0000,
  Daryl Shanley <Daryl.Shanley@newcastle.ac.uk> wrote:
> I have some c code that writes results directly to a file as they're
> produced during a simulation. I want to modify the code to write
> directly to a postgres database using libpq. I think I could open a
> connection and insert into the database with a transaction, commiting at
> the end of the simulation. One problem with this approach is that if I
> have a lot of simultaneous simulations running I may run into problems
> with exceeding the maximum number of connections allowed. I would
> welcome any advice

I think it would be more normal to write the information to files and
then have a cleanup process insert those files into the database and
delete the files. This will keep you from having long running transactions
help open for the duration of a simulation. If you don't want a separate
cleanup process, you could have the simulation process take care of
importing the data after the calculations have been completed.

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: cross-table unique constraint
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Natural upgrade path for RedHat 9?