P
P
papazashvili2014-09-18 12:28:48
PostgreSQL
papazashvili, 2014-09-18 12:28:48

How to keep track of adding records to a database using code (C++, QT4)?

There is a database (PostgreSQL) with a table that is accessed by two applications. One adds records, the other should fetch new records when it knows that the last one has been added. The question is: how to implement this kind of trigger in the application and is it worth using such an approach at all?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey, 2014-09-18
@papazashvili

postgresql has a notify command for feedback to the application. I saw a note on the net how to use it from Qt 5. I didn’t try it myself, I just saved it in my bookmarks just in case. See if it can help.

D
DancingOnWater, 2014-09-18
@DancingOnWater

In general, the database should not report a change in its status, so the reading application should itself check with some frequency. That's all parsley

M
Michael, 2014-09-19
@mtyurin

build some kind of chat.
your application needs a separate thread for polling and/or pooling.
well, or what kind of architecture does qt have, maybe it’s possible through a common event loop

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question