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 1poR47-0003E9-8R for pgsql-novice@arkaria.postgresql.org; Mon, 17 Apr 2023 15:46:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1poR45-0001GS-Ro for pgsql-novice@arkaria.postgresql.org; Mon, 17 Apr 2023 15:46:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1poR45-0001GJ-Il for pgsql-novice@lists.postgresql.org; Mon, 17 Apr 2023 15:46:49 +0000 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1poR43-003SFZ-Ff for pgsql-novice@lists.postgresql.org; Mon, 17 Apr 2023 15:46:48 +0000 Received: by mail-oi1-x233.google.com with SMTP id ca8so3062250oib.11 for ; Mon, 17 Apr 2023 08:46:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681746406; x=1684338406; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Musyr9CH9QjC2jC1shOUdVtgKOMcq9zC2j43lj+KTq4=; b=gfjnyWgm6t+8V4e29kiNr4EA0PKtWGiFpBxXMzr+YeHwrPQZMDW4xmTKVi2FZr6A7j LExIPoSVax/qeYJRaTVPXDqMvicR/o0nl64OFvtYRIULC2VSt66NB7Zd/c6PwjvA7NaL 1NdjCZpfSdqVKF/EHljVImv7pgsQvza2Zd87U97JXXTyeVIfPF4tpjt58j/RrMacSorh V9pb/nMVm+NssMW/grMIIbJEqYR/Wka6Xmwis+dG59smqWf/Atj6YO1PEEI0shRP9EzL +McrfrrhBiAmZ6qBh59WOqY9Ykz/iC+FfHa9wIyjw72q1Bjftqk+G7HIryKm6FjZjtYD i6sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681746406; x=1684338406; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Musyr9CH9QjC2jC1shOUdVtgKOMcq9zC2j43lj+KTq4=; b=F8iA3xpMptM0cgq38HQDlhuEPjuYiSilk+Z+mWhnK0iW4EtHjGs9X96iTNc3cB0oRF bx60AxqdH37HBN046vbIfYuAxN6r7DbwEyeeKL4/LjpgDWY0fjIAkgkYEdNYr7JExb/K d3tpuVOipjSl3dXL+wnGyjBSccETKREbC7WcKpHmUMI2zVndzzO46qUMo8OVBCBFiTlr wkmOYBnFxQbxT8oRxbsVhk16JMYQ3KCxB02qDJFVYBkwDo5BQdQkxJ8eM8t4V0ozxX7Q 0ZdBKLGGivdcIf9YxBHLGg27xW887ou+RArLb0TAFOpDKRCLPlGJUTIYIbCDttlQxU9j 60xA== X-Gm-Message-State: AAQBX9eqaqaOPHMUPaHk0yX7TUdGhJIAZXB/G1q3fieRwHOGqEwQjUxc E+ndFO5qHoJzNvzElJIbYddsXZGB4AX7GvRQoFI= X-Google-Smtp-Source: AKy350YONjvCktrzTfBbUWmR3uS/9vMmPjPTGt8/dz9RfppN2Q/umdWhl7VINZkZ0LnSseJX81Ql7Cai77NkqdCYQPI= X-Received: by 2002:aca:ea8b:0:b0:38e:2135:6981 with SMTP id i133-20020acaea8b000000b0038e21356981mr404279oih.3.1681746405543; Mon, 17 Apr 2023 08:46:45 -0700 (PDT) MIME-Version: 1.0 References: <2416657.1681739651@sss.pgh.pa.us> In-Reply-To: <2416657.1681739651@sss.pgh.pa.us> From: Josh Innis Date: Tue, 18 Apr 2023 00:46:34 +0900 Message-ID: Subject: Re: To: Tom Lane Cc: Johan Antonissen , pgsql-novice@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000001ad36f05f98a1965" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001ad36f05f98a1965 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable +1 On Mon, Apr 17, 2023 at 10:54=E2=80=AFPM Tom Lane wrote= : > Johan Antonissen writes: > > However when I try to deploy django and connect to my postgres server > > postgres gives me a permission error: > > > python manage.py sqlcreate | sudo -u postgres psql -U postgres > > > results to: > > > Could not change directory ... permission deniedCREATE ROLECREATE > DATABASEGRANT > > The "Could not change directory ... permission denied" part is mostly > cosmetic. It happens when psql is invoked in a current working > directory that the postgres user can't read. The fact that you're > getting "CREATE ROLE", "CREATE DATABASE", etc command completion > acknowledgements indicates that the SQL script is executing > successfully anyway. So what you've showed us doesn't really > indicate that anything is wrong; although you could try it from > a publicly-readable starting directory if you want to be sure. > > regards, tom lane > > > --0000000000001ad36f05f98a1965 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
+1

On Mon, Apr 17, 2023 at 10:54=E2=80=AFPM Tom Lane &l= t;tgl@sss.pgh.pa.us> wrote:
=
Johan Antonissen &l= t;windhoos@gmail.co= m> writes:
> However when I try to deploy django and connect to my postgres server<= br> > postgres gives me a permission error:

> python manage.py sqlcreate | sudo -u postgres psql -U postgres

> results to:

> Could not change directory ... permission deniedCREATE ROLECREATE DATA= BASEGRANT

The "Could not change directory ... permission denied" part is mo= stly
cosmetic.=C2=A0 It happens when psql is invoked in a current working
directory that the postgres user can't read.=C2=A0 The fact that you= 9;re
getting "CREATE ROLE", "CREATE DATABASE", etc command c= ompletion
acknowledgements indicates that the SQL script is executing
successfully anyway.=C2=A0 So what you've showed us doesn't really<= br> indicate that anything is wrong; although you could try it from
a publicly-readable starting directory if you want to be sure.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 regards, tom lane


--0000000000001ad36f05f98a1965--