Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1okmeu-0006iA-JX for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Oct 2022 13:29:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1okmet-0008F6-03 for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Oct 2022 13:29:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1okmes-0008Ex-OL for pgsql-bugs@lists.postgresql.org; Tue, 18 Oct 2022 13:29:26 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1okmem-0003G0-5q for pgsql-bugs@lists.postgresql.org; Tue, 18 Oct 2022 13:29:25 +0000 Received: by mail-pj1-x102a.google.com with SMTP id x1-20020a17090ab00100b001fda21bbc90so17348848pjq.3 for ; Tue, 18 Oct 2022 06:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=tOksmEjfdwPARcKdyfhFppDP0hLygawRqEpzjyrOB7E=; b=XFRFhrO8eA9lL4k7G749Nywr87fmMn081QAwcforQeNHQ0wPM23XskrgoxpamH6IGQ K6YsMOmF/bNpVQYYuVm8/uFhIdMaBrljJUkTAuBZCyPN4T1Vg38cCt8GIwWs1AMFqI6k 69u/SSXnCs5DzFCk31GhzYc6WPq6HLafmMnEWzM3LesX0jmGFfQAMTGfzwSih/TPoiq7 /oAyw3SP2O0ASUDJdZHeuwGalgYTmc7gnfa2B7aWKXkSTicfAHOYO34hBGmX/2GSsW4b Dn7p8qbiNx7ExjA0xXzxf4eVJ40V1Pvi/QYrUp/LK6JRVlfH/NkDkGqS0uw5/eoRMX6C z5jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tOksmEjfdwPARcKdyfhFppDP0hLygawRqEpzjyrOB7E=; b=BD7nN1xJFC8Xyjwg0KGcFQDRdbkf/TV2ZluyHEa7O/rh7mgyeo9AJMtZed0kTxqcpr joQEMyLsIFiRKdazZYX/ia0fpZkMXBorPuQibKleW03TxxSTErZKWR9dqnxaEw0r+XJG UTPJLl+G3ncY2ExYyRgNoYtTYF3AbwxH+rG5ddzr24iC44lM/kysASjt2tv6hJkry4Pj oDpjL+4OuFBfoMROjXiKyqC6FrlewjQQ/Cr4dC4a+wtf1NfxUe9GjZ+Ker+pzemLy9bd K8p5R3Z76+5JU1AjQtlyun1btQl6XE5hX9d4FT1fdozv09ZL61S1ig8I825nRs8YBA91 dktA== X-Gm-Message-State: ACrzQf39NKiHY3593x09Xw2nAqV9kbyNXTmJXCGAnZYn75S2O1z2kXS9 /Yf1plP9RHaCRcTn5u3IgFA18DZgvIU= X-Google-Smtp-Source: AMsMyM4yiXOZW89g8XtWe9XQlR7bNiXv6KQCxdr/T5KSY6V+yuPhRFVWg+B92t6PJqO6RiiWMX/Zug== X-Received: by 2002:a17:90a:5892:b0:20a:9cf5:c13c with SMTP id j18-20020a17090a589200b0020a9cf5c13cmr38832124pji.63.1666099759104; Tue, 18 Oct 2022 06:29:19 -0700 (PDT) Received: from jrouhaud (2001-b011-1006-1ebe-d832-ef37-671f-0ce2.dynamic-ip6.hinet.net. [2001:b011:1006:1ebe:d832:ef37:671f:ce2]) by smtp.gmail.com with ESMTPSA id f2-20020a170902ce8200b00179f370dbfasm8809601plg.26.2022.10.18.06.29.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 06:29:18 -0700 (PDT) Date: Tue, 18 Oct 2022 21:29:15 +0800 From: Julien Rouhaud To: rvpostgres@metaways.de, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17649: With libpg5 15.0 psql 10.22 uses HOME variable instead of uid and /etc/passwd to select .pgpass file Message-ID: <20221018132915.7ysivxeffde2flgk@jrouhaud> References: <17649-ac7350cba2628cf7@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17649-ac7350cba2628cf7@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Tue, Oct 18, 2022 at 09:17:05AM +0000, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 17649 > Logged by: Reinhard Vicinus > Email address: rvpostgres@metaways.de > PostgreSQL version: 15.0 > Operating system: Ubuntu 18.04 > Description: > > This is probably the same issue that was reported in bug #17647 Indeed! > > The general postgresql version we use is 10.22-1.pgdg18.04+1 > > With the update of libpg5 from 14.5-1.pgdg18.04+1 to 15.0-1.pgdg18.04+1 the > behavior of psql changed and with libpg5 version 15.0 it uses the HOME > environment variable to determine the location of the .pgpass file. With > 14.5 the uid of the running process is used to determine the home directory > location. This causes the issue that "sudo -u postgres psql" no longer finds > the .pgpass file in /var/lib/postgresql/. After downgrading libpg5 to > 14.5-1.pgdg18.04+1 or setting the correct HOME environment variable, it > works again as intended. > As I just answered on the other bug, this is a wanted and documented change, you can refer at https://www.postgresql.org/message-id/flat/1634252654444.90107%40mit.edu for the discussion about it. You can use "sudo -iu" to behave the way you want.