Page MenuHomeSoftware Heritage
Paste P1111

some replication commands
ActivePublic

Authored by ardumont on Aug 2 2021, 9:53 AM.
* Replication
** main db: publication
connect to main db softwareheritage:
#+BEGIN_SRC sql
select * from pg_publication_tables;
alter publication softwareheritage add table <new-table>;
-- alter publication softwareheritage drop table metadata_fetcher;
-- alter publication softwareheritage drop table metadata_authority;
-- alter publication softwareheritage drop table origin_metadata;
#+END_SRC
** replica: subscription
#+BEGIN_SRC sh
-- subscription
select * from pg_subscription;
-- update schema with new table (or renamed target tables)
-- refresh publication out of the main mirror
alter subscription softwareheritage_replica refresh publication;
--
select relname from pg_subscription_rel left join pg_class on srrelid=oid;
#+END_SRC