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 1qOQEw-007nKi-BT for pgsql-general@arkaria.postgresql.org; Tue, 25 Jul 2023 22:10:46 +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 1qOQEt-000ixG-M8 for pgsql-general@arkaria.postgresql.org; Tue, 25 Jul 2023 22:10:43 +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 1qOQEt-000iwy-9O for pgsql-general@lists.postgresql.org; Tue, 25 Jul 2023 22:10:43 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qOQEl-001Z6d-RJ for pgsql-general@lists.postgresql.org; Tue, 25 Jul 2023 22:10:42 +0000 Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-40648d758f1so21660151cf.0 for ; Tue, 25 Jul 2023 15:10:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690323034; x=1690927834; h=in-reply-to:cc:content-language:references:to:subject:user-agent :mime-version:date:message-id:from:from:to:cc:subject:date :message-id:reply-to; bh=BuRm0VM8sF2PGsdn2q9Fec4sBZ44deUbPoyBHAS12dY=; b=pcyFDlfAQfePNRnCqLMtzyhgxB01ehLPve4XeMLUfJtRFdPHleMhbwbOVNL1R78+Mg QHPfNDZCxbOfzRZQUJTW9saeFjbhhWr5d71Vs/cw/4MSQSRL1C+uDF5kEHR9Gq5svCzi ymhnKjN7ILuBg7qtAF/TpJCLWz48ASs4VxQM4QJiW0t09RtmGvhe14J2Qion+Ybh0BLx t3fRb38RDJEUKd6mpapRbROgmmTUPUW5w9zx3s2rE0jNrFB0+c1pgRxk5a1wWUxAk2ZA 9uES16TyIebQDHcqXzOPrTbnsB87U6rK6KE8P5weC+yjHfhFWhV+PPOkcyWtrClCQGzW bgDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690323034; x=1690927834; h=in-reply-to:cc:content-language:references:to:subject:user-agent :mime-version:date:message-id:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BuRm0VM8sF2PGsdn2q9Fec4sBZ44deUbPoyBHAS12dY=; b=GoylAaZmTlmhoEsiUeOkVWRxdLIGJ7TUKiK8Lbc/ak5IrxHKOybv+mZyooDNtBDgna nb0R2Vuh1PNQ6ZjqNLFCtv4ZDIcX3s7Bhoef6yRJguJTrL2lyr2xzxUEv5G65Vka7GUL t9jrN1HMNzIFHv9FVrtmBcyTnyMLQMhFPeUpaacOHZdcMQTC2cq26ZKLJs1fxLcbhqXp WKud7qyElxIuFHuQmDfDQfQhLbyD3ZpqJcp3lW+OyCYE3RwwzHFWWG4p9qhIVqdcghud sePENK2Q1thNFbdYZvrKoiowBbabL/y1TLLubL7qHjEgb2TwCi9LVH3ilak05+qWJEp9 JwbA== X-Gm-Message-State: ABy/qLaPu0gyfhIp5bxQZEeccUBbIvS3mjeFe8xIvkLo9S+tayjn01El N+R47MTrHyGIloYb1toimST7ACOHxpi2HQ== X-Google-Smtp-Source: APBJJlGTfT7N3MMhafeZ8MJePqJg/zdT6LkiCuS/Oe/e6g+deAr0tsoLUY68Fem97cdVBB6Iw3rMZA== X-Received: by 2002:ac8:5e47:0:b0:403:b236:9efa with SMTP id i7-20020ac85e47000000b00403b2369efamr370461qtx.31.1690323034303; Tue, 25 Jul 2023 15:10:34 -0700 (PDT) Received: from [192.168.2.170] ([67.70.150.114]) by smtp.gmail.com with ESMTPSA id b5-20020ac86bc5000000b004053bfaf358sm4334515qtt.79.2023.07.25.15.10.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Jul 2023 15:10:33 -0700 (PDT) From: Amn Ojee Uw X-Google-Original-From: Amn Ojee Uw Content-Type: multipart/alternative; boundary="------------pkwG8s9t002bGdARoBUHT8Fr" Message-ID: <32575904-99e1-bd87-4bda-c55fb7eea9b6@gmail.com> Date: Tue, 25 Jul 2023 18:10:24 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: Nu-B here To: pgsql-general@lists.postgresql.org References: <28bc9ae9-869d-a2ee-3ebb-b4bb7bdcbb14@gmail.com> <975DAA29-FD15-4B1D-B19C-297725A59D74@gmail.com> Content-Language: en-US Cc: haramrae@gmail.com In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------pkwG8s9t002bGdARoBUHT8Fr Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Please note the following : /psql (12.15 (Debian 12.15-1.pgdg120+1 /Thanks in advance // On 7/20/23 10:41 a.m., Adrian Klaver wrote: > On 7/19/23 23:32, Alban Hertroys wrote: >> >>> On 20 Jul 2023, at 02:36, Amn Ojee Uw wrote: >>> >>> After this command 'sudo -u postgres psql' >>> I get this message : >>> could not change directory to "/home/my_account": Permission denied >> >> What’s the reason that you’re using the OS user postgres? > > Because the Debian/Ubuntu packaging sets up pg_hba.conf to use peer > auth for local connections and the only database user created is > postgres. > > See: > > https://ubuntu.com/server/docs/databases-postgresql > > for more information. > >> >> If you’re simply trying to connect to the database named postgres as >> database user postgres, you can instead use the command 'psql -U >> postgres postgres’. > > >> >> Alban Hertroys >> -- >> If you can't see the forest for the trees, >> cut the trees and you'll find there is no forest. >> >> >> > --------------pkwG8s9t002bGdARoBUHT8Fr Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Please note the following :
psql (12.15 (Debian 12.15-1.pgdg120+1
Thanks in advance

On 7/20/23 10:41 a.m., Adrian Klaver wrote:
On 7/19/23 23:32, Alban Hertroys wrote:

On 20 Jul 2023, at 02:36, Amn Ojee Uw <amnojeeuw@gmail.com> wrote:

After this command 'sudo -u postgres psql'
I get this message :
could not change directory to "/home/my_account": Permission denied

What’s the reason that you’re using the OS user postgres?

Because the Debian/Ubuntu packaging sets up pg_hba.conf to use peer auth for local connections and the only database user created is postgres.

See:

https://ubuntu.com/server/docs/databases-postgresql

for more information.


If you’re simply trying to connect to the database named postgres as database user postgres, you can instead use the command 'psql -U postgres postgres’.



Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.




--------------pkwG8s9t002bGdARoBUHT8Fr--