Re: How to watch for schema changes - Mailing list pgsql-general

From David G. Johnston
Subject Re: How to watch for schema changes
Date
Msg-id CAKFQuwbNzGjpjizwb+2Z_j4n2tKwb4XB7aR_Na2iREJkMmRg+w@mail.gmail.com
Whole thread Raw
In response to Re: How to watch for schema changes  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
On Mon, Dec 3, 2018 at 10:59 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> > As I say - I'm trying to make it work from both ODBC and libpq
> > connection (one at a time)

IIUC what is being proposed is:

Once, on the server, the DBA issues:
CREATE EVENT TRIGGER (the function it runs issues NOTIFY
'channel-name' - even if no one is listening at any given point in
time)

Upon connection your client application executes:
LISTEN 'channel-name'
And then handles notification events from the channel normally.

The client itself never issues CREATE EVENT - nor, frankly, should it.
It shouldn't have sufficient permissions to do something like that.

David J.


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: How to watch for schema changes
Next
From: Andrew Gierth
Date:
Subject: Re: Query never completes with an OR condition