Q
Q
quest20172017-05-30 21:45:35
PostgreSQL
quest2017, 2017-05-30 21:45:35

How to stop postgresql server?

there is a postgresql server, there are a lot of connections to it from applications with insert to one table at some point we tell applications that we don’t need to do insert anymore, but this message may be late and someone can still do insert. it is possible to force applications before insert to pass through some global mutex but it is not an option. I am now doing a lock table after which no insert will work and then you need to either pull some script with iptables that closes the port or stop the server (I'm afraid that when you stop the lock will be released before the possible locked insert and the insert will have time to work) or let's say change the port on the fly or some property in the server. how would you do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
freeExec, 2017-05-31
@quest2017

What for to lock the table when it is possible to take away the rights to an insert simply.

R
romy4, 2017-05-30
@romy4

not to do directly insert, and through ?
to do inserts into a temporary table for each application and merge into the main one? you can insert as many as you want into your own, but from it the merger checks the time stamp and the
lock table flag hangs connections

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question