Let's assume we had PostgreSQL version X.Y and decided to give a test-try to version Z.W. Probably, there are some changes between X.Y and Z.W that could cause a little bit of trouble :-)

It would be preferable to run Z.W in parallel with X.Y, checking whether it goes well and using only X.Y's replies for a while. Later on, having Z.W's DB "ok" we could use it as primary, discarding X.Y optionally.

Question: Is there any PostgreSQL proxy that can run queries on several servers at once?


Have you checked pgpool already? It has query replication as a feature (look for 'parallel query').

  • I think it wouldn't do, since In parallel mode, replication_mode and load_balance_mode are set to true in pgpool.conf, and I don't want select queries to be replied by server with version being tested. – poige Jun 4 '14 at 16:58

first, you should check this post about common problems in version changes http://blog.endpoint.com/2010/01/postgres-upgrades-ten-problems-and.html

there is a tool named DBLink in postgreSQL, it is possible to create triggers and link them to Z.W version using dbLink and check if everything is ok.

another option you can run paralel queries on both servers and watch logs. but this can be possible on application side.

and also there is 3rd. party tool named pl/proxy http://wiki.postgresql.org/wiki/PL/Proxy

  • The 3rd is kinda off-topic. I knew there's PL/Proxy. I don't know however how could it answer my question. Do you? I need no just function calls. I wanna all queries to be transparently being processed on secondary server (as well as on primary). The only thing app would need is usual host/port. The rest would be a black box for it. – poige Feb 16 '12 at 10:46
  • The 2nd is too obvious, don't you think so? – poige Feb 16 '12 at 10:47
  • find any solutions? – sftsz Apr 9 '12 at 10:39
  • Nope, not found yet. I doubt there's something like that. – poige May 13 '12 at 10:53

I dont know of any such proxy, but if the intent is to check that all statements processed by server1 are valid on server2 also, then you should consider the tools like pgreplay, etc.

See http://wiki.postgresql.org/wiki/Statement_Playback

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.