• Re: Where was my app installed?

    From Mike@21:1/5 to Arbol One on Fri Aug 23 07:40:01 2024
    Arbol One wrote:
    After installing PostgreSQL on my Debian-12 machine

    Is there a way I can locate the installation directory?

    Assuming that you installed the `postgresql` package. Try:

    dpkg -L postgresql

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From debian-user@howorth.org.uk@21:1/5 to Arbol One on Fri Aug 23 12:10:02 2024
    Arbol One <ArbolOne@hotmail.ca> wrote:
    After installing PostgreSQL on my Debian-12 machine, I typed
    '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 where the
    'apt-get' installed it or why it did not add it to the path.

    Is there a way I can locate the installation directory?

    Thank in advance.

    It sounds like you may have installed the client but not the server. So
    as already requested, please detail exactly what you did, unless you
    can work out the solution yourself now.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Wanderer@21:1/5 to Arbol One on Fri Aug 23 13:30:01 2024
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
    On 2024-08-22 at 20:38, Arbol One wrote:

    After installing PostgreSQL on my Debian-12 machine, I typed
    'postgres --version' and got this msg: *bash: postgres: command not
    found*

    $ dlocate postgres | grep postgres$
    postgresql-13: /usr/lib/postgresql/13/bin/postgres
    postgresql-13: /usr/lib/postgresql/13/lib/bitcode/postgres
    python3-jedi: /usr/lib/python3/dist-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres
    postgresql-14: /usr/lib/postgresql/14/bin/postgres
    postgresql-14: /usr/lib/postgresql/14/lib/bitcode/postgres
    fpc-source-3.2.2: /usr/share/fpcsrc/3.2.2/packages/fcl-db/src/sqldb/postgres fpc-source-3.2.2: /usr/share/fpcsrc/3.2.2/packages/postgres
    postgresql-15: /usr/lib/postgresql/15/bin/postgres
    postgresql-15: /usr/lib/postgresql/15/lib/bitcode/postgres
    postgresql-16: /usr/lib/postgresql/16/bin/postgres
    postgresql-16: /usr/lib/postgresql/16/lib/bitcode/postgres

    That command won't work for you unless you have 'dlocate' installed and 'update-dlocatedb' has run since you installed the package with the file
    you're looking for.

    The paths above may give you a hint of where to look, however.

    '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.

    The directories for the above binaries aren't in $PATH for me, either -
    not as my normal user, nor as root.

    But I also don't *need* them to be. Those binaries appear to be for the
    server; the server is started automatically, in my case apparently from /etc/init.d/postgresql, in your case most likely by a systemd service of
    some type. I've been running postgresql for years, and I don't think
    I've ever actually *looked* for the server binaries before (although I
    *have* manually run some of the other binaries from the same directory,
    back when I was initially migrating from MariaDB).

    If you do need to be able to manually launch the server for some reason,
    you can just add the relevant directory (found as above) to your PATH environment variable - or, of course, run it with full path.


    My guess as to why the server binaries are not installed into the PATH location(s) is that it's about coinstallability. As you can see above, I
    have multiple postgresql versions installed (although in my case I think
    that's due to inertia, not to any actual need for the older versions);
    the only way to do that without embedding the version number into the
    name of every file involved is to have the versions installed into
    different directories, and of course those multiple directories won't
    all be in $PATH.

    That said, the same is true of the client, and the client does add a
    symlink which eventually gets resolved to the correct version. There's
    no reason the same couldn't be done for the server; my guess as to the
    reason why it *isn't* done is that it's a combination of "there's little
    reason for the user to need to run these binaries manually" with a
    desire to keep the install relatively self-contained, so that it's easy
    to tell each version's binaries where to find the libraries for that
    version, et cetera.

    Is there a way I can locate the installation directory?

    I hope this was helpful.

    --
    The Wanderer

    The reasonable man adapts himself to the world; the unreasonable one
    persists in trying to adapt the world to himself. Therefore all
    progress depends on the unreasonable man. -- George Bernard Shaw


    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCgAdFiEEJCOqsZEc2qVC44pUBKk1jTQoMmsFAmbIcEwACgkQBKk1jTQo MmsVHRAAi33b7O155SHNfHtA00IW/HkfAoE4DyMy7LocDtQpGqJHdCZOxovIoG9T u+5pLDG0jINUMPj3s4Ax2aYdyI+kGkjOnhadpSnYwCadbJRab4ZwJcX9Kjmw/j7j /Fl19/wZ3rlXrYx+LuZyTbhpMkNHHaY9cIPpuqQg+CulQg3by91sTABMjod9TP30 nIvJPCaVqPf3zGw7ohU250nalJImviKFotORI+dCWojia5Tj2utb0/FGbKJbZgKY tDYzcWx5DQReSSy2mYovYZfnk8DoXWs8sCanPPDKFtsbSsuqLaxlPu6fa/QieyAY 6p0dDGHrbjE/pbaZePG2dyPHI8MMX7WooJPupIgLzdkqfTZXqcdXi7cUKdm5m+pG jrk6i9iU5QgmmKWXfMJk2cTgVuK4Rk1vVkePyN+xip2dez1DO8Js7LRJYIsCWbUM 1huTiGqQYzdb9SSz9uEhPnS5NYWBjHZxhtUPlmQVxPGAe3LVYsyKBD4jZDGeCOB7 ECJOYJ1lG4LVyWATSKRvwX/qNSeG6sQGeI+GI4OfRhKm3muA6B+gnh3T+Fa6LVG1 r7p90Jcj9cD/QfU3bGOG7raiR1FYTKKXu+YzzcXxrsWKRpxk9T03Cs9hHcYGPIpq Vso+W9W5zeNcfpBtlHsSw25N/fgb
  • From tomas@tuxteam.de@21:1/5 to Arbol One on Fri Aug 23 22:50:01 2024
    On Thu, Aug 22, 2024 at 08:38:03PM -0400, Arbol One wrote:
    After installing PostgreSQL on my Debian-12 machine, I typed 'postgres --version' and got this msg:
    *bash: postgres: command not found*

    There is *no* command named postgres in the Postgresql installation. Not
    in the client, not in the server parts.

    There /is/ a postgres command in the postgresql-autodoc package:

    tomas@caliban:~$ apt-file search /usr/bin/postgres
    postgresql-autodoc: /usr/bin/postgresql_autodoc

    but this one quite possibly doesn't do what you think it does.

    What would you expect the command "postgres" to do?

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZsjz7QAKCRAFyCz1etHa RvqLAJ9q5SDrVRJiqWBgW++vavyJ02A5swCfT/NAgF53nH5AK8NBBaZlZqMrg1c=
    =Xep3
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Wanderer@21:1/5 to tomas@tuxteam.de on Fri Aug 23 23:00:01 2024
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
    On 2024-08-23 at 16:41, tomas@tuxteam.de wrote:

    On Thu, Aug 22, 2024 at 08:38:03PM -0400, Arbol One wrote:

    After installing PostgreSQL on my Debian-12 machine, I typed 'postgres
    --version' and got this msg:
    *bash: postgres: command not found*

    There is *no* command named postgres in the Postgresql installation. Not
    in the client, not in the server parts.

    Then... what is /usr/lib/postgresql/$VERSION/bin/postgres ?

    On my machine, that exists (for values of $VERSION of 13, 14, 15, and
    16), and 'file' reports it as being an ELF executable binary.

    It's not in $PATH, but I don't think I'd use that as the deciding factor
    for whether or not something qualifies as a command.

    What would you expect the command "postgres" to do?

    The one I see appears, from what I can determine based on examining the
    init.d script and the file it sources, to be the server binary itself.

    --
    The Wanderer

    The reasonable man adapts himself to the world; the unreasonable one
    persists in trying to adapt the world to himself. Therefore all
    progress depends on the unreasonable man. -- George Bernard Shaw


    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCgAdFiEEJCOqsZEc2qVC44pUBKk1jTQoMmsFAmbI9ncACgkQBKk1jTQo Mmtr0xAAk8UPPpjuZ4yT3pXYWbqsK9K7+U+1ElchY0tKTnPGefIbK6j9+NZBPqK/ w08t+w4FRtoHxOpM8TZ/6FwRf0f63NaiF9tDVH4+IWlYj1wyTyAbVBM5vfi57sor qYAVieiGRwkac7nlWk577Q6KEgqR2rSycymExxE2GghrCmxGxTTBFbFT1FALVaBD Wwgg7izCUXViEN3AiErzAnBRa17+un8rP5WUZ5HpM9ZqD18bf/f1Afx+/Bs8wiCO kXTkWk8jMi/CalVTkpQvEb6Mw0YQ9F+VgW2blpSmfn/6q2CIcLgv1Bsd79x75EP6 tX9GR0u/NJgk22M09s0zdQ8Ewn7Lm1EgMWSAZNZhVLPgE9Y/nd7oD4G6F0fnqlql 9AjYcueQx7jmb7hfYNGR/WK7K8+ei+DlLacQftGRnj4tfMCr86vQt8gKx0L9DvJE swJ/Ftxzhc6CL2eU+6aP+oBhtZnG8jRcB4ysjk6kMrwQhNWxVay8IDWfUl2Rrqve wRcJ8vtqYCArcme8yw9tvfloocAuC4HBMlaNOVkeZ3pzQm0WRP6BtY/0pBeyVPx4 9dpoYSb9kshPa21LjevEXxgHFWyx8StQtL2VhuyIezKUUOAY2rrt7AysbPcThjzL hhTv347tYJGfyZ3VCySecvTe+zqf
  • From tomas@tuxteam.de@21:1/5 to The Wanderer on Fri Aug 23 23:10:02 2024
    On Fri, Aug 23, 2024 at 04:52:07PM -0400, The Wanderer wrote:
    On 2024-08-23 at 16:41, tomas@tuxteam.de wrote:

    On Thu, Aug 22, 2024 at 08:38:03PM -0400, Arbol One wrote:

    After installing PostgreSQL on my Debian-12 machine, I typed 'postgres
    --version' and got this msg:
    *bash: postgres: command not found*

    There is *no* command named postgres in the Postgresql installation. Not
    in the client, not in the server parts.

    Then... what is /usr/lib/postgresql/$VERSION/bin/postgres ?

    It's a binary, but I wouldn't call it a "command" in the usual
    sense (it would live in some of the customary $PATH places, then).

    IIRC (but I might be wrong) postgres is instantiated to handle a
    session and should be started by postmaster. I don't think it expects
    to be called directly.

    [...]

    It's not in $PATH, but I don't think I'd use that as the deciding factor
    for whether or not something qualifies as a command.

    Hm. That's exactly what I just did,

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZsj48gAKCRAFyCz1etHa RiHVAJ4rzu3O3Zmr6cDCKpIFJm2aTurwowCeOGroo1Tv0GDMKLkWUrSDjQLk7xg=
    =Zdpr
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Wanderer@21:1/5 to tomas@tuxteam.de on Fri Aug 23 23:40:02 2024
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
    On 2024-08-23 at 17:03, tomas@tuxteam.de wrote:

    On Fri, Aug 23, 2024 at 04:52:07PM -0400, The Wanderer wrote:

    On 2024-08-23 at 16:41, tomas@tuxteam.de wrote:

    There is *no* command named postgres in the Postgresql
    installation. Not in the client, not in the server parts.

    Then... what is /usr/lib/postgresql/$VERSION/bin/postgres ?

    It's a binary, but I wouldn't call it a "command" in the usual sense
    (it would live in some of the customary $PATH places, then).

    It's not in $PATH, but I don't think I'd use that as the deciding
    factor for whether or not something qualifies as a command.

    Hm. That's exactly what I just did,

    That would be the difference between us on the subject, then. I was
    surprised by the statement, because of that difference in definitions.

    IIRC (but I might be wrong) postgres is instantiated to handle a
    session and should be started by postmaster. I don't think it
    expects to be called directly.

    It probably won't be called directly, indeed, unless you're specifically launching the server manually for some reason (e.g. testing-related).

    --
    The Wanderer

    The reasonable man adapts himself to the world; the unreasonable one
    persists in trying to adapt the world to himself. Therefore all
    progress depends on the unreasonable man. -- George Bernard Shaw


    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCgAdFiEEJCOqsZEc2qVC44pUBKk1jTQoMmsFAmbJAB0ACgkQBKk1jTQo MmtWSQ/+ItyEUHbPmqeBr5dzsmMtmBi6efULS+JJ55kOLAVUj9/nGzUYY4jHNr0N VPP4ud6HmBTVrPSmaQGbWsmHtUxU1AuNM4u71WOGPz9u4Ka9DTJsMnfA2rbVfyMj LtXD1v0D4KLPbq/h1hAf0d/dFe5fUCRiBSv9q6sutjCkyOxhFLTDCvq2C71vGojX BBo77yYKbiS8Kl27ylW9hPlXmo+nTKCUAIaPtBOdP1Ri/CZviNDf6rdeuDxX2DfD PZNGrknSo+d3auwafbg2Phc4SjCVVXa3eQuTIp0w6LZ6pQfp0PVZxq7tjKnA2a/y gRkFokPVwvAKGwx5/YtazzpG/stFpXdpaFbdBVTyU8yNGvWaQVqdHl6kiXaWWxer 4lhsbx0v/w6gR9m0/R7tafm+7v1zaqtin8ZNvAF+F1lily5qcqYgqpK8jzyM88e2 P6BysNmb2yNCHt+ys8DP7ldOIL0x60KSYmCMr0+QUPN2CbBNd/TMQLeYNfv6EGl4 cEZf/XogYc8/ZoFNxEoOtLTg1q/Xld3d+EjOgU6jAf3PbUNqsSDbMBy0pAghZrFd Sjc9miiEcdJduhDEPUcx0ob903qZARFGAZMdwmTAZOkyp5R6Ub2+BU7fQhEytV8i 3CEGSo3yOolbM1XkPb1BSQKzh1mS