Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creation of TEMPORARY TABLE in Slave Database

Tags:

postgresql

I have two PostgreSQL database servers. One is the master and another is a slave server which is in read only mode. I have written a few functions that CREATE TEMPORARY TABLE within the function. Now my question: is it possible to run all of those functions in slave server? If it is possible, then how?

like image 353
smn_onrocks Avatar asked Oct 21 '22 00:10

smn_onrocks


1 Answers

See the manuals.

All such connections are strictly read-only; not even temporary tables may be written

You will want something like slony or bucardo doing trigger-based replication if you want the replica to support write operations.


Edit: or, nowadays you can use logical replication.

like image 186
Richard Huxton Avatar answered Nov 03 '22 00:11

Richard Huxton