Re: Database trigger (one server to another)

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Database trigger (one server to another)
Дата
Msg-id 0de4339e-b80e-8c32-8a07-7b8f2295f9b0@aklaver.com
обсуждение исходный текст
Ответ на Database trigger (one server to another)  (Muhammad Bilal Jamil <mbjamil92@gmail.com>)
Список pgsql-general
On 5/31/22 11:59 AM, Muhammad Bilal Jamil wrote:
> Hi fellow database engineers,
> 
> I am currently on a project where i have read only access to a 
> production system (replicated) from where i want to copy data into 
> another schema. Ideally what i want to do is that if for an event 
> happens in the replicated schema (server#1) like something updates, then 
> my database trigger runs and copies data from server#1 to my 2nd schema 
> (server#2) for which i have read/write rights.
> 
> Is this something possible? I would create the trigger in the 2nd server 
> obviously since for first one i cant write anything.

You might try postgres_fdw:

https://www.postgresql.org/docs/current/postgres-fdw.html

Set up a table in the second server that links to the other server. Then 
you have access to the data on the second server.

> 
> Best
> Bilal


-- 
Adrian Klaver
adrian.klaver@aklaver.com



В списке pgsql-general по дате отправления:

Предыдущее
От: Muhammad Bilal Jamil
Дата:
Сообщение: Database trigger (one server to another)
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: Order of rows in statement triggers NEW/OLD tables