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 1sGSsi-00DPzE-8G for pgsql-admin@arkaria.postgresql.org; Mon, 10 Jun 2024 00:27:29 +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 1sGSsg-006gul-Kt for pgsql-admin@arkaria.postgresql.org; Mon, 10 Jun 2024 00:27:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sGSsg-006gud-6i for pgsql-admin@lists.postgresql.org; Mon, 10 Jun 2024 00:27:27 +0000 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sGSsZ-000qXw-Mb for pgsql-admin@lists.postgresql.org; Mon, 10 Jun 2024 00:27:25 +0000 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6f9774a556cso919922a34.0 for ; Sun, 09 Jun 2024 17:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717979237; x=1718584037; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=khVL61u6tyKuBlbRAaFAbge84RS+ok8CliwBcIklYWk=; b=NfzFxNcAKzEAvMgk0rYQOp7ijl4t1LZFFCzO+8hh2Ti7cQGt50ilLjU8U0FULRwRBY CVgS1lRT9i96muZGhaHE1co0ichAm6Lw1ug+aDhU0SgEQioQEiXLEUflquTYjzpjLKds hZjwy7sJ15NBXntWf+UfdwdmK9caLwOH+iHMGs3F7N6V0zk5GmWVc2Cr0iPK7POn8gSl klMIkPmNnyxk1t80Cl1jq3T03nXKBZg02SS/GE56Oh+mCYIfuzwoh2UrNaxzxszt00zn hu8NyRiQY1aIDaDByTyOeShzAG4EDpiC0qH5TMeiA/H4qOt2wqL0K5NVEaaf5OSASJP7 Bcow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717979237; x=1718584037; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=khVL61u6tyKuBlbRAaFAbge84RS+ok8CliwBcIklYWk=; b=M2c+FOlap0tTX66irvv+yybBOhfyLVkJtutGhrm0dNGHRxaBXQwSLbdM2tlgOEbSPW UfIdHDv4s56hJnT3reRU/9qX1f7p9a8Xgq5BWu2EqhNpLVJUX4chSsKl1PVL536o9Znl d5T131ydcDT6Z31RcOLlNAxTBaAOqRcupt29PwEqeesR/+ubaH80NMF/A79PVR49DB2r O1iuBrDrKwrrplYVMVa5ELEFHasJaHRAV5x5SgnBjIFrK5UP3BX709/OphK2Xf5p0RiL kwoikkMLeS1XqyBNobxOo8OBfJ9oJXdXrtdKXm06AYpWkAEQn0uROjQ4TkUJaTrwuv63 wWoQ== X-Gm-Message-State: AOJu0YzU+AQntDc8EGnb62MaRd3AQbIkG75a2gXOgg6rNMmT+f5qvCdp WfOCdNuvA+AV0UlEfFMNH2R37sEuI4OAav/GKKvetPecWTZefqAqUdaT7CAV6ubDmjTwLStjSE/ i0wYCSaoWWY+PNevRUtBiFzxL1js= X-Google-Smtp-Source: AGHT+IGnvYZ62nvOPqKj0fgcwR0QDttYDscEduJELpAgmVK6hr7Kq+4Dux5a8I5CMs4mojgschdzxyX126j6ARwdwqU= X-Received: by 2002:a05:6830:1204:b0:6f9:7919:a33a with SMTP id 46e09a7af769-6f97919a519mr4379868a34.19.1717979237403; Sun, 09 Jun 2024 17:27:17 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6802:387:b0:530:392d:d678 with HTTP; Sun, 9 Jun 2024 17:27:16 -0700 (PDT) In-Reply-To: References: From: "David G. Johnston" Date: Sun, 9 Jun 2024 17:27:16 -0700 Message-ID: Subject: Re: GRANT CONNECT ON DATABASE To: Edwin UY Cc: "pgsql-admin@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000002d5697061a7e3626" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000002d5697061a7e3626 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, June 9, 2024, Edwin UY wrote: > > > A role was created as below: > CREATE ROLE [blah] WITH NOLOGIN > > As already noted this means =E2=80=9Cdo not allow to login=E2=80=9D. ALTER ROLE [blah] WITH ENCRYPTED PASSWORD 'blahpassword' ; > If you want them to use a password this is also required in addition to the ability to login. > GRANT CONNECT ON DATABASE [blahdb] TO [blahuser] ; > Redundant with the default connect grant given to the public pseudo-role. David J. --0000000000002d5697061a7e3626 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, June 9, 2024, Edwin UY <edwin.uy@gmail.com> wrote:

A role was created as below:
CREATE ROLE [blah] WITH NOLOGIN


As already noted thi= s means =E2=80=9Cdo not allow to login=E2=80=9D.

ALTER ROLE [blah] WITH ENCRY= PTED PASSWORD 'blahpassword' ;
If you want them to use a password this is also required in add= ition to the ability to login.
=C2=A0
GRANT CONNECT ON DATABASE [blahdb] TO [blahuser] ;
=

Redundant with the default connect grant given to the p= ublic pseudo-role.

David J.

--0000000000002d5697061a7e3626--