Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pUlmo-0008SO-T6 for pgsql-general@arkaria.postgresql.org; Wed, 22 Feb 2023 09:51:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pUlmn-0003pF-Oo for pgsql-general@arkaria.postgresql.org; Wed, 22 Feb 2023 09:51:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pUlmn-0003p6-8c for pgsql-general@lists.postgresql.org; Wed, 22 Feb 2023 09:51:41 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pUlmi-0000v6-DT for pgsql-general@postgresql.org; Wed, 22 Feb 2023 09:51:40 +0000 Received: by mail-wm1-x330.google.com with SMTP id m25-20020a7bcb99000000b003e7842b75f2so3157518wmi.3 for ; Wed, 22 Feb 2023 01:51:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=cXM2Z9M/njlfnX1IP09pSEpxDYXvrguz2mfJp0Dd//M=; b=G9LSng9yl/QojJXcyDh5l2uPVGuhL5i0dGpE63KBMRRrYTob8rrrfLUss+0vAuGKsG JGH87HA0rYSUXrWtYHZf7qjmReXHZFtisoIW1xx9A/E4ZdsJjOXzYxJyOctNEsSambRc IfgZlg4mZdoCTCLjB5oFmYCyvU2Ntr8aLjvn9QD9ukn4cZDFCfPfAafOib8h/Ojs4Hwo pGCaBHhhweyrPXK4Q43S7wBb43/FxV+pi2BJUsiG58EcU70hB+L8AesAmJyp6l3QS32E CqsYor6+ZcBoQ+Q4CRtf12DuXRnhZCyxWZVqNcxqqiiqznQB90O3qLXGhpGUQvMkGXrF z0Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cXM2Z9M/njlfnX1IP09pSEpxDYXvrguz2mfJp0Dd//M=; b=XBaFtJJJjLutwgZ2XwwyEDhpNMkuBCMyYz+uAcyyfJlAhPGbGHxSkZLlC1sPvD/Jfr U5hoZLyp3r3S83xWf7iWg6psYWNJEJp/51T/bcfOu0WP1ZUt/323vUs/EHck8HUyN4fb 6rz/tXJUYVcy1NJG/boe5WB4SMe6WPd25jZVNG5CuwBfKOqSnDki0J8aW02XNJY9R5KE X5LF7Lso3ER97KXjjd6uvEfWw9tQcHqsZccJOA7mMFfVmGo91jrRKEi+/o22tOtvD920 t1uG7Ns/ESfrz1Ub9NOJxBEeAol8H5PBmkmoT1k5Ap7QdubSUE00TRGT6PA0d4XnPUSd w4Yw== X-Gm-Message-State: AO0yUKUYiIrIZWoQWVYaUzDKpwmHxepc5N0FNFCANxSvqgMGz0va7bgC qfCzHSHd06LRNb9iP1e2cboAeA== X-Google-Smtp-Source: AK7set9IcoWM5tVnD7KDIbaER2IlGeekfE9hf1O5aYmtYy1mXEoc0DMyR4bIM8UWzP1b4wvZcI9Z+g== X-Received: by 2002:a05:600c:1652:b0:3e1:12d1:fde0 with SMTP id o18-20020a05600c165200b003e112d1fde0mr6015434wmn.6.1677059494070; Wed, 22 Feb 2023 01:51:34 -0800 (PST) Received: from localhost.localdomain ([88.116.133.170]) by smtp.gmail.com with ESMTPSA id o2-20020a5d4742000000b002c59c6abc10sm7444033wrs.115.2023.02.22.01.51.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 01:51:33 -0800 (PST) Message-ID: <714b89f449005ed4348e2114f6ce5f8aff18ea8a.camel@cybertec.at> Subject: Re: Event Triggers unable to capture the DDL script executed From: Laurenz Albe To: Neethu P , pgsql-general Date: Wed, 22 Feb 2023 10:51:33 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2023-02-22 at 07:57 +0000, Neethu P wrote: > We are using event triggers to capture the DDL changes in a postgres data= base. > However, we are unable to get the column information & the actual DDL scr= ipt > executed, while a table is altered.=C2=A0 > Also, in the postgres documentation for pg_event_trigger_ddl_commands ()-= it is mentioned as below. > pg_ddl_command A complete representation of the command, in internal > format. Thiscannot be output directly, but it can be passed to other func= tions > to obtain different pieces of information about the command. >=20 > Is it possible to access pg_ddl_command in postgresql? Or is there any sc= ripts > which can help to get theactual Alter DDL statement that was executed by = the user?=C2=A0 That is simple if you write the event trigger in C. I would say that that = is the only way to get at the actual statement. Yours, Laurenz Albe