Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gTxRc-0001W3-L6 for pgsql-general@arkaria.postgresql.org; Mon, 03 Dec 2018 23:16:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gTxRa-0001F0-VM for pgsql-general@arkaria.postgresql.org; Mon, 03 Dec 2018 23:16:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gTxRY-0001EL-R8 for pgsql-general@lists.postgresql.org; Mon, 03 Dec 2018 23:16:02 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gTxRR-0005G2-3D for pgsql-general@postgresql.org; Mon, 03 Dec 2018 23:15:59 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3E84A226AD; Mon, 3 Dec 2018 18:15:52 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 03 Dec 2018 18:15:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=A Oome7tq8kCcI1E5LJpj/DHVfuX8WZKt7Wo6U3+klRY=; b=03k/I8BuMXJjd3GE0 +dJvsWad3h4/rRLlwElcevr+4Sv8ht20UVOec67xIVoh3TVBaSAIlhE0Y1fzdsPh EhaNGvhebA47pwzZysW9AemJ3DZpnPM+MZuvuQSSiVWrAIHy7fJOjoKnpolgmi+T F4U+ab0V56O5Vf6IqwzJ9fYcJj14Vaw7X6/wBfNEV9e/azgNr8omw0MfqrE27RFJ 6sZGS53IqFJ4vrFpq5MXwdD2uKQqblNa1AOW2REWzy1y0JcIxFBsNN/2blYNCfKJ 8Aii0jenpUepgjb0XCywFeYu96y04QXw7jxKMrA2DZ/+YZCl1e4W+EKVivO9XYr+ QY0eg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=AOome7tq8kCcI1E5LJpj/DHVfuX8WZKt7Wo6U3+kl RY=; b=VYerTbrZDgmaD3R5zn3DXv8tqySk9f85oOaZtLfWVE53Sh2gVtZgFoqII xB+RWZv/IHxRKinZ+3iNdoRLxRunrYc2f9Oe9V5j2e5xxrI8NwlCtfxtndy6d33N wlvQpA6GP9QXbCSNuRYIFjm9v0TalJBcxL1FtTOuMfSxuTaZE26qXgpHhoeenT4D 571LGR2wPsDco/uMsAdhc0VUdBg/pmqxQws2C1v8Zw/RxrnHdCuntECUx7ihmtsY w7ELhZR8vICJXY9pRIBHy9UyqLwY19zyx2nLwXIDV/+T/ccBajhJpcAxdVlyTUXc 8g5iC9XSXoH7L1xfuvKu33VMQ2HkQ== X-ME-Sender: X-ME-Proxy: Received: from [192.168.1.3] (unknown [71.212.134.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 1BFF5E455D; Mon, 3 Dec 2018 18:15:51 -0500 (EST) Subject: Re: How to watch for schema changes To: Igor Korot Cc: pgsql-general References: <53538bab-5f26-247d-15bf-94785fdfb252@aklaver.com> <761d4f03-08f4-e354-9cc0-d3cc5d0319c4@aklaver.com> <4316b506-95d0-59b2-7857-5ae896e07e60@aklaver.com> <0790286e-e1f9-b8cc-7eb5-2fddfa208737@aklaver.com> From: Adrian Klaver Message-ID: <46a41f36-2799-a3ac-867b-d0f6195fd6bd@aklaver.com> Date: Mon, 3 Dec 2018 15:15:50 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/3/18 3:00 PM, Igor Korot wrote: > Hi, Adrian, > > On Mon, Dec 3, 2018 at 4:10 PM Adrian Klaver wrote: >> >> On 12/3/18 1:53 PM, Igor Korot wrote: >>> Hi, Adrian, >> >>>> Why? Just create the trigger once in a script. Event triggers are an >>>> attribute of the database and stay with it until they are dropped. If >>>> you want to turn then on and off use the ALTER EVENT TRIGGER >>>> ENABLE/DISABLE. If you insist on recreating them on each connection then: >>>> >>>> https://www.postgresql.org/docs/10/sql-dropeventtrigger.html >>>> DROP EVENT TRIGGER [ IF EXISTS ] name [ CASCADE | RESTRICT ] >>>> CREATE EVENT TRIGGER ... >>> >>> I was hoping to create a software which will be just "install-and-use". >>> No additional script running or database changes is required. >> >> After I hit reply my subconscious kicked in and pointed out something:) >> >> If there are no database changes why do you need to track schema changes? > > That was a bad word selection. ;-) > > 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? > > 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