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 1shMN9-00GqgQ-Jo for pgsql-general@arkaria.postgresql.org; Fri, 23 Aug 2024 04:58:03 +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 1shMN7-009THj-L4 for pgsql-general@arkaria.postgresql.org; Fri, 23 Aug 2024 04:58:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1shMN7-009THZ-6O for pgsql-general@lists.postgresql.org; Fri, 23 Aug 2024 04:58:01 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1shMN4-0010cM-PP for pgsql-general@lists.postgresql.org; Fri, 23 Aug 2024 04:58:00 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-53345fe848eso312620e87.2 for ; Thu, 22 Aug 2024 21:57:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724389077; x=1724993877; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PGRF+RUlMCasNlykndsk01W3FuzUvjFyJYURaYHvh8U=; b=djDK1i1NRJ0mm6RRqgOHqCTrwEiAw+EYaMnRXA+cIKnNxoUlvmJm2La+mp64mAws1Z ymWGVB5n1H5t7uSyBuZc35Hx6CadfK8rY4kgtRtQWMOUObHDSG5MhmRg6ctXWaC1fC7I r0iEamoNVOEhxeSOQOyT1sqDPPW9g7B6v1zvv3CaPZc1EhWunmjQydcwx6zyw+bNyFYo D9X+lwI2tlxlK2uQ9H7pa1GJrqgQT7dH9RMEqYcP9sNFWCo0lI1lipVa+WAZ8FzscU9M LY5pv4Ui1x5IbC9JxPBNCv/C57HWJVkNKGagoYpDszHYpnypb9bTr1qe5UxXbNLPo+w9 z62g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724389077; x=1724993877; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PGRF+RUlMCasNlykndsk01W3FuzUvjFyJYURaYHvh8U=; b=Ac2eE2GBiEISxqbut0BX7NtJLKkD/sdnQXLYXttthsAbSUI0KysiyY4m/QPDpXyzUy BT+IRpm+JJn7jJ/3Jy07+A91fj57JOFvU/Lv/enI9iuQzPLQ2nflhQUFu7MD2iBa0VSe sSE6/sEOh3kNI29qGgevmTaEkoUsJ7RcJhxIKTvQvfaPeAninPw0oo0X54bKTPY19IPD ar2SuC/4iiFE1My4vMQ6gbJYF5yn1HDNy4D7MndKf3fqGGKzbxosCLdM8S1JmwsaXcar e/cwp2ojx5agql9jGfDJPz7Oa+c3e748PLFZ+iA1hpgrE4KwIeONoZDW87MIRGD3/Fm0 XmHw== X-Forwarded-Encrypted: i=1; AJvYcCW5w82PPc/tRhOwkCf1x8Fr6ZXqSiVpJqXY7zwAZ6UJouhOe+em9pBu9h5b3VfP453PSjdvbNpmtwgh3FzY@lists.postgresql.org X-Gm-Message-State: AOJu0YwJzLcFqal5gvl2Bpfa9fTtJ71KXE7RCYyornWaYzc0k4c4osHb rEhg/BhmKNAkHocjX3MYoKmeyekHOfFfrRpoic6761Y1Kl8pNT0Wr4z3F+1T4pfEA3E/uZxCebk lJRO/oRUArSfJyl1UW9U5oymP2es= X-Google-Smtp-Source: AGHT+IE0o0wpzZuxAaMGJgHitNqWPT//pIQlY5/Jv+5r42oJtH+P3+ZazetN7TeQImBIX0T+ATs5hdIWZ9u3Ecwg/Zs= X-Received: by 2002:a05:6512:3d09:b0:533:44dc:932f with SMTP id 2adb3069b0e04-534387cc70bmr328146e87.8.1724389076356; Thu, 22 Aug 2024 21:57:56 -0700 (PDT) MIME-Version: 1.0 References: <2115389.1724379712@sss.pgh.pa.us> In-Reply-To: From: Muhammad Ikram Date: Fri, 23 Aug 2024 09:57:39 +0500 Message-ID: Subject: Re: Where is my app installed? To: Adrian Klaver Cc: Tom Lane , Arbol One , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000059d4fb0620529ee8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000059d4fb0620529ee8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Arbol, Try to find any binary e.g. find /usr -name pg_ctl /usr/local/pgsql/bin/pg_ctl /usr/lib/postgresql/16/bin/pg_ctl find /usr -name psql /usr/bin/psql /usr/local/pgsql/bin/psql /usr/lib/postgresql/16/bin/psql Later you may create a symlink or add in PATH. Hope this helps. Regards, Ikram On Fri, Aug 23, 2024 at 7:43=E2=80=AFAM Adrian Klaver wrote: > On 8/22/24 19:21, Tom Lane wrote: > > Adrian Klaver writes: > >> On 8/22/24 17:36, Arbol One wrote: > >>> After installing PostgreSQL on my Debian-12 machine, I typed 'postgre= s > >>> --version' and got this msg: > >>> *bash: postgres: command not found* > >>> 'psql --version', however, does work and gives me this message : > >>> *psql (PostgreSQL) 16.3 (Debian 16.3-1.pgdg120+1)* > >>> Obviously postgres is not in the path, but I don't know where the > >>> 'apt-get' installed it or why it did not add it to the path. > > > >> As to where the postgres command is: > >> ls -al /usr/lib/postgresql/16/bin/ > > > > Theory 1: postgres is packaged in a "postgresql-server" package > > and the OP only installed the base (client-side) package. > > > > Theory 2: postgres is installed into some directory not in the OP's > > PATH, such as /usr/sbin. Since it's primarily used as a daemon, > > this'd be a reasonable thing for a packager to do. > > Yes in: > > ls -al /usr/lib/postgresql/16/bin/ > > > > > I'd bet a nickel on #1, though, because I've not seen too many > > packagers put postgres somewhere other than where they put psql. > > "Separate server package" is extremely common though. > > Correct. The missing part is that in Debian/Ubuntu packaging when you > use psql you are actually doing: > > ls -al /usr/bin/psql > lrwxrwxrwx 1 root root 37 Aug 8 07:37 /usr/bin/psql -> > ../share/postgresql-common/pg_wrapper > > The Debian packaging routes most things through > pg_wrapper/postgresql-common a Perl script that does the magic of > finding the correct binaries for each Postgres version. > > > > > regards, tom lane > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > > > --=20 Muhammad Ikram --00000000000059d4fb0620529ee8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Arbol,

Try to find = any binary=C2=A0 e.g.

find /usr -name pg_ctl
/u= sr/local/pgsql/bin/pg_ctl
/usr/lib/postgresql/16/bin/pg_ctl

=C2=A0find /usr -name psql
/usr/bin/psql
/usr/local/= pgsql/bin/psql
/usr/lib/postgresql/16/bin/psql

<= div>
Later you may create a symlink or add in PATH.
Hope this helps.


Regards,
Ikram




<= div class=3D"gmail_quote">
On Fri, Aug= 23, 2024 at 7:43=E2=80=AFAM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 8/22/24 19:21, Tom Lane wrote:=
> Adrian Klaver <adrian.klaver@aklaver.com> writes:
>> On 8/22/24 17:36, Arbol One wrote:
>>> After installing PostgreSQL on my Debian-12 machine, I typed &= #39;postgres
>>> --version' and got this msg:
>>> *bash: postgres: command not found*
>>> 'psql --version', however, does work and gives me this= message :
>>> *psql (PostgreSQL) 16.3 (Debian 16.3-1.pgdg120+1)*
>>> Obviously postgres is not in the path, but I don't know wh= ere the
>>> 'apt-get' installed it or why it did not add it to the= path.
>
>> As to where the=C2=A0 postgres command is:
>> ls -al /usr/lib/postgresql/16/bin/
>
> Theory 1: postgres is packaged in a "postgresql-server" pack= age
> and the OP only installed the base (client-side) package.
>
> Theory 2: postgres is installed into some directory not in the OP'= s
> PATH, such as /usr/sbin.=C2=A0 Since it's primarily used as a daem= on,
> this'd be a reasonable thing for a packager to do.

Yes in:

ls -al /usr/lib/postgresql/16/bin/

>
> I'd bet a nickel on #1, though, because I've not seen too many=
> packagers put postgres somewhere other than where they put psql.
> "Separate server package" is extremely common though.

Correct. The missing part is that in Debian/Ubuntu packaging when you
use psql you are actually doing:

ls -al /usr/bin/psql
lrwxrwxrwx 1 root root 37 Aug=C2=A0 8 07:37 /usr/bin/psql ->
../share/postgresql-common/pg_wrapper

The Debian packaging routes most things through
pg_wrapper/postgresql-common a Perl script that does the magic of
finding the correct binaries for each Postgres version.

>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0regards, tom lane

--
Adrian Klaver
adrian.klave= r@aklaver.com





--
Muhammad Ikram

--00000000000059d4fb0620529ee8--