Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ryY98-00Gpc4-5j for pgsql-general@arkaria.postgresql.org; Sun, 21 Apr 2024 14:26:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ryY87-00EhJO-SR for pgsql-general@arkaria.postgresql.org; Sun, 21 Apr 2024 14:25:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ryY87-00EhJG-FZ for pgsql-general@lists.postgresql.org; Sun, 21 Apr 2024 14:25:19 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ryY85-002AjP-62 for pgsql-general@lists.postgresql.org; Sun, 21 Apr 2024 14:25:18 +0000 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6eb96620559so2351743a34.1 for ; Sun, 21 Apr 2024 07:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713709514; x=1714314314; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/c4qI7pxjwwKtBnpQFCYWIMIuXQ6S9Xk+Wp9dpCAd5w=; b=X5tGVXrLbZQVnUxQGxSOpF5OLSiM7jQJkTs/YKzWiAfAl07gw+JPhonGk2Sq3RFATe GaZdg2fW0m2e4CZ9khITb/I0BQYVt6HMT6kbFfN51OMEGzt/rpD9PoLQ5tEX/9GKnrt6 ws6ILKJcfjenjJ5jmftISIJB7mCTZj0wXRugFjC+Y1lSoVpo+HuWsgiUkrKCp5V11p/0 y0OPQtigaM6i+0lTo3/oKHWVm3xhJFePU/nEXtrmd2vl3QhM/eqWUPv4OZ1gmt1kNXzQ +G2IZje7/eez6KSDxLqL5p4ZFETSZENOhmJr8mHKW2YPzKu6jqX5gzWLeIM1bUg2ZsPI kUyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713709514; x=1714314314; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/c4qI7pxjwwKtBnpQFCYWIMIuXQ6S9Xk+Wp9dpCAd5w=; b=IMxYxH29DM/fOEXp6mxCptAIBZIZ5jY+SlZ+vhGAuHotmqUo3ru7veX9MsM0YXMOn8 1dxwsMEfnrosJ3w2H6rJs1BNki5gl4sFS/YbvpgMY3FoUWx7fGHeC8zJSD/6xJrgac8v eayaeEdIofcj7xVAXDJj9rgqFQpF6sAFt+Cyo2Y5KgvsC4JD4FbvhUr5Jt25vSd9Q2WT lUbJSKUEyQ4+1ptDa3ahFYmi0rWUEXR7bgEn/PJ/VDDIETM5wLcq49eNDOFDBchMmzea SwIO/jCjOCXg4pjv0vg1VMmqMJRBqgt78UYTj4HWgENxHdalmYd1GGamUp5IYEAufRNx FDMQ== X-Gm-Message-State: AOJu0Yy0xhX7JEVTXeEfH2BI/5IBC/MQ6n+Eeu5piLP5qGvo1x+8ybM2 ZUNNh6KgFa8t0HQN6XoWzTDpfsHO0M85pp/mPiR/zTP+Xk1yrlvaAJeMvPMptibqZpgQmbRf27h b4X0aKXQ2rGXYj7mov1Bjt+bINM0= X-Google-Smtp-Source: AGHT+IGtmiNTmCkJp3BVu3Rhxrr/ypItAbBto8MTfu36mNNXUNtEJDU9ZSte4rcIkLmbsi/ihVffl9ZQfXWzuIBORnw= X-Received: by 2002:a05:6830:438c:b0:6ea:1bf3:9854 with SMTP id s12-20020a056830438c00b006ea1bf39854mr10741008otv.12.1713709514639; Sun, 21 Apr 2024 07:25:14 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a8a:d96:0:b0:525:bd21:4d70 with HTTP; Sun, 21 Apr 2024 07:25:14 -0700 (PDT) In-Reply-To: References: From: "David G. Johnston" Date: Sun, 21 Apr 2024 07:25:14 -0700 Message-ID: Subject: Re: error in trigger creation To: yudhi s Cc: pgsql-general Content-Type: multipart/alternative; boundary="000000000000de585d06169c1620" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000de585d06169c1620 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, April 21, 2024, yudhi s wrote: > On Sun, Apr 21, 2024 at 1:55=E2=80=AFPM David G. Johnston < > david.g.johnston@gmail.com> wrote: > >> On Sunday, April 21, 2024, yudhi s wrote: >> >>> so that it will be able to assign the privilege, so we will be able to >>> create the event trigger without need to run the event trigger script f= rom >>> super user itself? >>> >> >> Write a security-definer function owned by superuser and grant app_user >> permission to execute it. >> >> David J. >> >> > > Thank You David. > > Are you saying something like below, in which we first create the > function from super user and then execute the grant? But doesn't that mea= n, > each time we want to create a new event trigger we have to be again > dependent on the "super user" to modify the security definer function? > Dynamic SQL. See =E2=80=9Cexecute=E2=80=9D in plpgsql. David J. --000000000000de585d06169c1620 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, April 21, 2024, yudhi s <learnerdatabase99@gmail.com> wrote:
On Sun, Apr 21, 2024 at 1:5= 5=E2=80=AFPM David G. Johnston <david.g.johnston@gmail.com> wrote:
=
learnerdatabase99@gmail.com> wrote:
so tha= t it will be able to assign the privilege, so we will be able to create the= event trigger without need to run the event trigger script from super user= itself?

Write a security-definer fun= ction owned by superuser and grant app_user permission to execute it.
=

David J.
=C2=A0

Thank You David.

=C2=A0Are you saying somethin= g like below, in which we first create the function from super user and the= n execute the grant? But doesn't that mean, each time we want to create= a new event trigger we have to be again dependent on the "super user&= quot; to modify the security definer function?

Dynamic SQL.=C2=A0 See =E2=80=9Cexecute=E2=80=9D in plpgsql= .

David J.
=C2=A0
--000000000000de585d06169c1620--