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?
-
Slony ... can cope with having nodes running different versions of PostgreSQL.Jack Douglas– Jack Douglas2012年05月02日 21:45:17 +00:00Commented May 2, 2012 at 21:45
3 Answers 3
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– poige2014年06月04日 16:58:22 +00:00Commented Jun 4, 2014 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– poige2012年02月16日 10:46:39 +00:00Commented Feb 16, 2012 at 10:46
-
The 2nd is too obvious, don't you think so?poige– poige2012年02月16日 10:47:26 +00:00Commented Feb 16, 2012 at 10:47
-
-
Nope, not found yet. I doubt there's something like that.poige– poige2012年05月13日 10:53:20 +00:00Commented May 13, 2012 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.