1

How do I replicate a single schema in postgresql?

I want to replicate only one schema when there are multiple schemas in the database.

Too many tables to use as "for table" for postgresql logical replication..

  • 1
    "Too many tables to use as "for table" for postgresql logical replication" How many is that? – jjanes Apr 07 '20 at 01:58
  • @jjanes about 2000..! – FeelSoGOOOD Apr 07 '20 at 04:11
  • You could write some dynamic SQL in PL/pgSQL that iterates through all tables of a schema and registers them for logical replication. –  Apr 07 '20 at 06:41
  • [pglogical](https://github.com/2ndQuadrant/pglogical) seems to make this easy using replication sets (I have never used that extension though) –  Apr 07 '20 at 06:47
  • @a_horse_with_no_name oh, thx.. !! but can't just include a single schema table for create publication? – FeelSoGOOOD Apr 07 '20 at 06:48
  • i check the pglogical. thank you ! – FeelSoGOOOD Apr 07 '20 at 06:51
  • 2000 should not be a problem. If that is too much typing, then script it! If there were a way to include by schema, I think it would just be scripting it internally anyway. – jjanes Apr 07 '20 at 14:07

0 Answers0