Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1if4tU-0005zk-FI for pgsql-general@arkaria.postgresql.org; Wed, 11 Dec 2019 16:31:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1if4tT-0004vz-6z for pgsql-general@arkaria.postgresql.org; Wed, 11 Dec 2019 16:31:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1if4tR-0004vs-SH for pgsql-general@lists.postgresql.org; Wed, 11 Dec 2019 16:31:18 +0000 Received: from [64.147.123.24] (helo=wout1-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1if4tO-0004wA-Cd for pgsql-general@lists.postgresql.org; Wed, 11 Dec 2019 16:31:16 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id BE6099CF; Wed, 11 Dec 2019 11:31:02 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 11 Dec 2019 11:31:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=w 6TaSeUVgT4CG8uJpUSWgoBMJnpL+NDvniN87tTgu4s=; b=bsfpKjKiVBwhURI39 cExzJwg7NDpMjyHhzN+R4d0mDU9FelUdZrJkK/jSoDKB/S3Ai2vCU2sm8/x3g7o/ Y3HDa3LIMySpS6eJJIayzNZaK0p5+Lg6dxRYYgUifH9QNKe+bnGnaLgCtm133V+H Zj3k7tlbq2d9W/1Hdv2059t6SGA8SUWauKVKRbgUr87Ny3qT8meUc+mBj0BzvxRF k/EwGK7DKQfgznpZ/4H2H1MQmE//btX2ivYvvcXC0BABLZ2cTxDJOwjBmiDC2hrn ACxPrb3X8Si81e9tGSbDxtWgG5Dv2aIto3OYQKBw5Awhqbac8lXrDpSp5YSc40ea lwjsw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=w6TaSeUVgT4CG8uJpUSWgoBMJnpL+NDvniN87tTgu 4s=; b=VZMRO6fMftiwUhuDEAnfsCf4bVO/cEbTv9J9xmi3W4+5wSWHX/M7YLrzz nnRILOtB8tepVBej6CkilJXpRwd7bXdKyIX69aZUXPLbbPJg71ESWAZq1T5hgw8D Jub3f730sA3UucXK7lC+qjpn7DwZepzQd9lDgZLJ9NQnGQc/sx/tY5BMXxAVnFDm zOqmhV4PaMAOtWnd+ZXVrSv0YkF0CypfLE/MWI3lRcDgjalspXXZs0KstatfqsFW Wk5X4eAwK69ePpdgu8hP3MfbPvZrpTH2qMdnMf0gU1crqeB+LjE6dmlMITt7jM9l +QKxbxlwpManBJrPY1x7R/97q1NeA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudelhedgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeejuddrvddu vddruddvledrudelfeenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklh grvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.2] (unknown [71.212.129.193]) by mail.messagingengine.com (Postfix) with ESMTPA id 750383060134; Wed, 11 Dec 2019 11:31:01 -0500 (EST) Subject: Re: PGUSER and initdb To: =?UTF-8?B?0J7Qu9C10LMg0KHQsNC80L7QudC70L7Qsg==?= Cc: "pgsql-generallists.postgresql.org" References: <61717e4b-3e69-2bb9-7ef8-1849a8900133@aklaver.com> <4624CAAA-6E67-42D8-9F66-D2EB926443CA@ya.ru> From: Adrian Klaver Message-ID: <8042e8d3-5528-c328-393f-218420aad4f5@aklaver.com> Date: Wed, 11 Dec 2019 08:31:00 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <4624CAAA-6E67-42D8-9F66-D2EB926443CA@ya.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.24 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/11/19 5:18 AM, Олег Самойлов wrote: > >> This utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see Section 33.14). >> " >> >> https://www.postgresql.org/docs/12/libpq-envars.html >> " >> PGUSER behaves the same as the user connection parameter. >> " > > This is don't work with `initdb` and `pg_ctl initdb`. > Hmm, yeah. So -U works but not the env variable. I would file a bug report(https://www.postgresql.org/account/login/?next=/account/submitbug/): aklaver@tito:~> env | grep PGUSER PGUSER=postgres /usr/local/pgsql12/bin/initdb -D pg_test_postgres/ /usr/local/pgsql12/bin/pg_ctl -D pg_test_postgres start aklaver@tito:~> psql -d postgres -U postgres -p 5429 2019-12-11 08:25:22.334 PST [4978] FATAL: role "postgres" does not exist psql: error: could not connect to server: FATAL: role "postgres" does not exist aklaver@tito:~> psql -d postgres -U aklaver -p 5429 Null display is "NULL". psql (12.1) Type "help" for help. postgres=# \du List of roles Role name | Attributes | Member of -----------+------------------------------------------------------------+----------- aklaver | Superuser, Create role, Create DB, Replication, Bypass RLS | {} /usr/local/pgsql12/bin/initdb -U postgres -D pg_test_postgres/ aklaver@tito:~> psql -d postgres -U postgres -p 5429 Null display is "NULL". psql (12.1) Type "help" for help. postgres=# \du List of roles Role name | Attributes | Member of -----------+------------------------------------------------------------+----------- postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {} -- Adrian Klaver adrian.klaver@aklaver.com