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 1qkhKr-00FlDA-7V for pgsql-general@arkaria.postgresql.org; Mon, 25 Sep 2023 08:52:57 +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 1qkhKp-00GyIK-Te for pgsql-general@arkaria.postgresql.org; Mon, 25 Sep 2023 08:52:55 +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 1qjeKj-003DU0-Ua for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 11:28:29 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qjeKh-006v2E-3Y for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 11:28:29 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-5041335fb9cso3292256e87.0 for ; Fri, 22 Sep 2023 04:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695382106; x=1695986906; darn=lists.postgresql.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=byqqrhhLqszCdalUvCFBoPCKaRUligT0CKDLD795fQo=; b=UxPMwVbzckEEmMAw3Z7xcZseGwqxqQFbJ3v/tu8dR23aqg221ktyZTQ4R5GYUk7GIh 5LseeorY9/5SlZzW0wC9pPaKvwuEtjFH+0cLuKVdziblouVdUYJdxczXWRIWXAteAPal 7RitXFxsOpV6REuPhcQsMuDXhoyn95lCcuR60or5zjqbZMBzz/PJdu1HdlTaSLeK1FHB 8/oG2sckuSPyPp6uytODO7UGIt+xp3Cbcx3Tylu4MhXVdQ5Wg+ODetIBkSKOMxpBsgbv Stfu/V5hjV9z1GwZAMQQaut+Z461x5A9fCHYy5ji42W3WiCDRo1tc0OGI9B8hnYPDEMs 3IvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695382106; x=1695986906; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=byqqrhhLqszCdalUvCFBoPCKaRUligT0CKDLD795fQo=; b=McUYJYBKJrwaLgcXSSUOtYBNWW5LuZnfXcmyfYTD+fza33ts40FpQFQeTruSepyiWT Q2ld47Ktquo58uJnAXHNOwK1A4n7aJ4AhNVMSEHbzI0bFR/3tEhJTzJjyjTCwt7Re/Hg amjyiPZCcYG1VobMRLSbr1sGprij1EcbcPZueBHYe1CLt9JCcHJgZU6SxSkGzQFdI+oS bXkoM7PzdK39PYSKGFDLVh+qLGBX4vfIDOas1mto3zzQqQRR1r5Dt3dtLUGcVT0HiL1V kol0DhWukE8XYNRpxYRkEZ0tTCZ7RJHI7gieEfPMgt6VfnGh7Ru/gIlvgpkahTvOkvwm 9FGw== X-Gm-Message-State: AOJu0YwxD5Pcdi1Py/jaX5YR+NjRUYw4Lyl4M9WkU/iKM6To2HJJfSDG tcMA25+3q5JOPcrVCe3DOHNHanMvBG8= X-Google-Smtp-Source: AGHT+IEp6gRoddGWIewJgrcLadU3ylDi/ijAx1lW5vclhPsUb20MTyKB/VoGCmT6NXIe9Hf1nsRAWw== X-Received: by 2002:a05:6512:220a:b0:503:1c58:8a46 with SMTP id h10-20020a056512220a00b005031c588a46mr9363182lfu.9.1695382105525; Fri, 22 Sep 2023 04:28:25 -0700 (PDT) Received: from smtpclient.apple ([185.197.33.6]) by smtp.gmail.com with ESMTPSA id b13-20020ac25e8d000000b004f86d3e52c0sm695318lfq.4.2023.09.22.04.28.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Sep 2023 04:28:24 -0700 (PDT) From: Alexander Petrossian Message-Id: <086C5BA0-7B8F-42EE-ABEC-3EF403D1599B@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_6322E27A-04FF-4797-A052-EA630C7F2B4B" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: debugger from superuser only.... why? Date: Fri, 22 Sep 2023 14:28:22 +0300 In-Reply-To: Cc: =?utf-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0LXRgtGA0L7RgdGP0L0=?= , "pgsql-general@lists.postgresql.org" To: Luca Ferrari References: <6006191695187640@mail.yandex.ru> X-Mailer: Apple Mail (2.3731.600.7) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_6322E27A-04FF-4797-A052-EA630C7F2B4B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 22 =D1=81=D0=B5=D0=BD=D1=82. 2023 =D0=B3., =D0=B2 14:20, Luca Ferrari = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0): >> Checked few sources, can not seem to find reasoning behind this = limit: >> You must have superuser privileges to use the debugger. >> What is the reason? > I suspect the debugger will need to open a connection back to pgadmin, > and that probably is the need for privileges. Not sure. I=E2=80=99ve collected log for supseruser debug session under IntelliJ = plugin. Playing this under non-privileged user... some commands pass (below for = history) and this one does not: > SELECT * FROM pldbg_set_global_breakpoint(1, 65695, -1, NULL); > ERROR: must be a superuser to create a breakpoint I am wondering why is this, why not allow debugging for non-privileged = users? PAF P.S. those that pass are > SELECT setting > FROM pg_settings > WHERE name =3D 'shared_preload_libraries'; >=20 > SELECT * FROM (SELECT > t_namespace.nspname, > t_extension.extname, > t_extension.extversion > FROM pg_extension t_extension > JOIN pg_namespace t_namespace ON = t_extension.extnamespace =3D t_namespace.oid)q; >=20 > SELECT * FROM (SELECT pid, > application_name, > usename, > client_addr > FROM pg_stat_activity > WHERE application_name =3D 'idea_debugger' > AND pid <> pg_backend_pid())q; > SELECT * FROM pldbg_create_listener(); --Apple-Mail=_6322E27A-04FF-4797-A052-EA630C7F2B4B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 22 =D1=81=D0=B5=D0= =BD=D1=82. 2023 =D0=B3., =D0=B2 14:20, Luca Ferrari = <fluca1978@gmail.com> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0= =B0):
Checked few sources, can not seem to find reasoning behind = this limit:
You must have superuser privileges to use the = debugger.
What is the = reason?
I suspect the debugger will need to open a = connection back to pgadmin,
and that probably is the need for = privileges.

Not = sure.

I=E2=80=99ve collected log for supseruser = debug session under IntelliJ plugin.

Playing = this under non-privileged user... some commands pass (below for history) = and this one does not:

SELECT * FROM pldbg_set_global_breakpoint(1, = 65695, -1, NULL);
ERROR: must be a superuser to create = a breakpoint

I am wondering why is = this, why not allow debugging for non-privileged = users?

PAF

P.= S. those that pass are

SELECT setting
FROM = pg_settings
WHERE name =3D = 'shared_preload_libraries';

SELECT * FROM = (SELECT
              =      t_namespace.nspname,
      =             =  t_extension.extname,
          =         =  t_extension.extversion
        =        FROM pg_extension = t_extension
              =           JOIN pg_namespace t_namespace ON = t_extension.extnamespace =3D = t_namespace.oid)q;

SELECT * FROM (SELECT = pid,
                =       application_name,
      =                 = usename,
              =         client_addr
      =          FROM pg_stat_activity
  =              WHERE application_name =3D= 'idea_debugger'
            =      AND pid <> = pg_backend_pid())q;
SELECT * FROM = pldbg_create_listener();
= --Apple-Mail=_6322E27A-04FF-4797-A052-EA630C7F2B4B--