pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Igor Korot <ikorot01@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: How to watch for schema changes
Date: Mon, 3 Dec 2018 17:37:08 -0800
Message-ID: <f513883c-dce5-0f3f-56b5-85f8bb969047@aklaver.com> (raw)
In-Reply-To: <CA+FnnTzk57Ka5miBBD+vZNMTfqCuvJ=HxQFwf2x5sbtfaUaQ+A@mail.gmail.com>
References: <CA+FnnTxqScf6mDw_7HLMfu7YTagPrsYUw-bc=OKsBQ0TqprvEA@mail.gmail.com>
	<d17c5c84-2988-8536-21c4-17ce9a9ef18c@aklaver.com>
	<CA+FnnTwWkSixK66ZiLzrdod7hfHkpp0okKFJAnFE8bfBhtaAQQ@mail.gmail.com>
	<53538bab-5f26-247d-15bf-94785fdfb252@aklaver.com>
	<CA+FnnTzwLRxVU-2iGXGnDyqTcyybYwc1vFFcsfrE=PapaqgN+Q@mail.gmail.com>
	<761d4f03-08f4-e354-9cc0-d3cc5d0319c4@aklaver.com>
	<CA+FnnTyx15GbSKvF8NP_eyn2BTepk6x6fRubwgnwRy283=dw6g@mail.gmail.com>
	<4316b506-95d0-59b2-7857-5ae896e07e60@aklaver.com>
	<CA+FnnTwB6vbo+7nTtboi5Ffs9o07bZQ-U9U8yQ4yLrc8iEF5Eg@mail.gmail.com>
	<0790286e-e1f9-b8cc-7eb5-2fddfa208737@aklaver.com>
	<CA+FnnTyV9CBFxGSg3ad_+zXO5_AtpMX6DQ5Kca-3rHWQF8ix=Q@mail.gmail.com>
	<46a41f36-2799-a3ac-867b-d0f6195fd6bd@aklaver.com>
	<CA+FnnTzk57Ka5miBBD+vZNMTfqCuvJ=HxQFwf2x5sbtfaUaQ+A@mail.gmail.com>

On 12/3/18 5:29 AM, Igor Korot wrote:
> Hi, Adrian,
> 
> On Mon, Dec 3, 2018 at 5:15 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>>
>> On 12/3/18 3:00 PM, Igor Korot wrote:
>>> Hi, Adrian,
>>>

>>>
>>> What I mean to say was "no schema changes/server changes that comes
>>> independently
>>> of the program install". Or something to that extent.
>>
>> Which circles back around to the same question:
>>
>> If there are to be no schema changes after the install why track them on
>> subsequent connections?
>>
>> Or maybe an explanation of what you are trying to achieve would make
>> things clearer?
> 
> Ok, it probably will make things clearer.
> So I install my program perform some queries and exit.
> At the same time if the user will create or delete a table the program should
> pick up those changes and act accordingly.

So do you want the user to change the schema?

Or could you use permissions to stop that?

I am just seeing a difficult problem trying to divine user intent from 
schema changes.

> 
> I was hoping to do the watching initialization dynamically, but it looks as it
> is more pain and I can probably try to execute the script during the
> installation.
> 
> So basically I will create the function in C, compile it and then
> during the program installation
> create a trigger with that function.
> Then in my program I will execute "LISTEN" command and act accordingly.
> 
> Am I right?

Not sure I have never tried LISTEN on event trigger output.

> 
> And executing LISTEN will also work for ODBC connection, right?

Again not something I am familiar with. Someone else on this list may be 
able to answer that. Or there is:

https://www.postgresql.org/list/pgsql-odbc/

> 
> Thank you.
> 
>>
>>
>>
>>>
>>> Sorry, ESL person here.
>>>
>>> Thank you.
>>>
>>>>
>>>>>
>>>>> But I will probably create it on every connection and delete on the
>>>>> disconnect (see above).
>>>>>
>>>>
>>>> --
>>>> Adrian Klaver
>>>> adrian.klaver@aklaver.com
>>>
>>
>>
>> --
>> Adrian Klaver
>> adrian.klaver@aklaver.com
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (52+ messages)  latest in thread

Message-ID: <f513883c-dce5-0f3f-56b5-85f8bb969047@aklaver.com>
Permalink:  ../f513883c-dce5-0f3f-56b5-85f8bb969047@aklaver.com/
Also on:    postgresql.org/message-id/f513883c-dce5-0f3f-56b5-85f8bb969047@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, ikorot01@gmail.com
  Subject: Re: How to watch for schema changes
  In-Reply-To: <f513883c-dce5-0f3f-56b5-85f8bb969047@aklaver.com>
  References: <CA+FnnTxqScf6mDw_7HLMfu7YTagPrsYUw-bc=OKsBQ0TqprvEA@mail.gmail.com> <d17c5c84-2988-8536-21c4-17ce9a9ef18c@aklaver.com> <CA+FnnTwWkSixK66ZiLzrdod7hfHkpp0okKFJAnFE8bfBhtaAQQ@mail.gmail.com> <53538bab-5f26-247d-15bf-94785fdfb252@aklaver.com> <CA+FnnTzwLRxVU-2iGXGnDyqTcyybYwc1vFFcsfrE=PapaqgN+Q@mail.gmail.com> <761d4f03-08f4-e354-9cc0-d3cc5d0319c4@aklaver.com> <CA+FnnTyx15GbSKvF8NP_eyn2BTepk6x6fRubwgnwRy283=dw6g@mail.gmail.com> <4316b506-95d0-59b2-7857-5ae896e07e60@aklaver.com> <CA+FnnTwB6vbo+7nTtboi5Ffs9o07bZQ-U9U8yQ4yLrc8iEF5Eg@mail.gmail.com> <0790286e-e1f9-b8cc-7eb5-2fddfa208737@aklaver.com> <CA+FnnTyV9CBFxGSg3ad_+zXO5_AtpMX6DQ5Kca-3rHWQF8ix=Q@mail.gmail.com> <46a41f36-2799-a3ac-867b-d0f6195fd6bd@aklaver.com> <CA+FnnTzk57Ka5miBBD+vZNMTfqCuvJ=HxQFwf2x5sbtfaUaQ+A@mail.gmail.com> <f513883c-dce5-0f3f-56b5-85f8bb969047@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox