Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WFP9a-0006vu-An for pgsql-sql@arkaria.postgresql.org; Mon, 17 Feb 2014 14:26:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WFP9Z-0005hy-Ls for pgsql-sql@arkaria.postgresql.org; Mon, 17 Feb 2014 14:26:37 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WFP9Y-0005hn-GU for pgsql-sql@postgresql.org; Mon, 17 Feb 2014 14:26:36 +0000 Received: from mail-pd0-x229.google.com ([2607:f8b0:400e:c02::229]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WFP9V-0004eI-C4 for pgsql-sql@postgresql.org; Mon, 17 Feb 2014 14:26:35 +0000 Received: by mail-pd0-f169.google.com with SMTP id v10so15000941pde.28 for ; Mon, 17 Feb 2014 06:26:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=uU71fRe6wZEFGfno++q8fDDDu6MLpg8gd61+3lW0Txo=; b=Z+vpdPsCA8bgcWZ2NdsN2DTJ5zbC9DuB5W5cGXqFkU2MvBKpFiaN7vofm//2GdWEHo quSZhKL9FFh2lb1ie44fXEMi2oOVfG91TuH3XlL5uSXBBE3FqWV5/h+xN0bMS0X2Z16P j8Ifv+HhjN6xdSXFWtXfN9IKryoGlKt8c+KFUTzMiQe85gXCqRf0axAFcmqhBdkaZhQu YY207tS1/KKWVIyEOtXy+awl5ZH2luyGydPnR89941VF9zjyU5K/SvmmyanZEN863Ied OLLHR4/2+uzLosHlADq8DgeRmSVU1Xhqqaro02UnaRY00hM49XdOf5rZv4RjyJ7LyXR7 1S6w== X-Received: by 10.68.197.133 with SMTP id iu5mr26935182pbc.132.1392647192012; Mon, 17 Feb 2014 06:26:32 -0800 (PST) Received: from panda.site (65-102-185-39.tukw.qwest.net. [65.102.185.39]) by mx.google.com with ESMTPSA id qf7sm118870279pac.14.2014.02.17.06.26.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 06:26:31 -0800 (PST) Message-ID: <53021C12.1080001@gmail.com> Date: Mon, 17 Feb 2014 06:26:26 -0800 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: amul sul , "pgsql-sql@postgresql.org" Subject: Re: Trigger SQL script execution after DROP EXTENSION References: <1392616368.60045.YahooMailNeo@web193501.mail.sg3.yahoo.com> In-Reply-To: <1392616368.60045.YahooMailNeo@web193501.mail.sg3.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 02/16/2014 09:52 PM, amul sul wrote: > Hello ALL, > > I need little help regarding DROP EXTENSION. > > Can it will be possible to execute some SQL command automatically after > DROP EXTENSION ? > > In my EXTENSION, I am changing some pg_catalog tuples, I want to restore > it when my EXTENSION is dropped. > > Thanks in advance, any help or suggestion is appreciated. Not sure what version you are on, but in 9.3+ there are EVENT TRIGGERS: http://www.postgresql.org/docs/9.3/interactive/event-triggers.html > Regards, > > Amul Sul -- Adrian Klaver adrian.klaver@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql