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 1klpE1-0001DN-GE for pgsql-admin@arkaria.postgresql.org; Sun, 06 Dec 2020 08:16:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1klpE0-0007SU-1K for pgsql-admin@arkaria.postgresql.org; Sun, 06 Dec 2020 08:16:56 +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 1klpDz-0007SM-No for pgsql-admin@lists.postgresql.org; Sun, 06 Dec 2020 08:16:55 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1klpDt-0008Mp-2X for pgsql-admin@lists.postgresql.org; Sun, 06 Dec 2020 08:16:55 +0000 Received: by mail-ot1-x32a.google.com with SMTP id y24so9624273otk.3 for ; Sun, 06 Dec 2020 00:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=gPkqmfudi75FWlIcHHzCjcT+reBBHR/xqwcUA7TGbA4=; b=JccPRYTS4usdaVaQT4L9rGdKedb+nLeJ8y44hnTdPsbNjmdIbMUvkE5oHHaLJ9FLXr 66HY2OCAn4offn3D3MhBxpM9WVTdA/H+S6tbW+L1yRn1hamvA8KravAghLeuHU8Yv3Xp zc+Q7dUr92YRke9EpHBySp/uVGUP7Ba/Ne0X10yHobtMJxDEliSokJSqR1y9RxPbswVC axBf10d1v7TWhv9M5cG09Yo0wzZnRAuSvkIipXSZrMGBbPsWfLM8Pt1lVSKCgVYCDYSA OuiCLEc0UvuyDec4GkKWgXg2noPjP+YcZPnM8U3dfX48hRp+AJf6pzKfX3ugdb2Ej2lu ug3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=gPkqmfudi75FWlIcHHzCjcT+reBBHR/xqwcUA7TGbA4=; b=CjMNkpXsNLepaYiib5PUXk3NtwS9i9+fIqH4tJK6n3FG4JuZFK1kL4Pbp4kr45zG5C Pch1m4+Ji7iRnuKgsAlBf34DPSjG2nhCrIm+9pF/Ap61o2dtJTnMOCVwKhqBOZ5XIMHV 9f0RVnhntIhiTo7OrOJoId+60JGPsaG+2+XWAQxGChTDMTPnK0ljo/z4Pmty0AuK4KY/ zM/8cEU5A2bKSRUBWfVsNTkiz5fXT+lw3/vwI7yvPhqw2QhZtp/3u1MU0iAEmPtcR9lA yk8frRribsQlxBsJygn+A3TEEZY0QmSf5kk+ZxzHJGyJvl08zRHWLm1rsNEsHbfEc947 FASw== X-Gm-Message-State: AOAM531TfG82bO68svW7RQ3mWuuYnUpqfNIbnqI+zGXphRbYXFIU5lPC dj5j0VTr1fCp1ftjaKwdbdGKLwj/AUHoWA== X-Google-Smtp-Source: ABdhPJxoY1j0y5v8R2lnXSCzJRN3FgrUzwiqw2u+Df7f9s7EptDr+cTFbFXjYIJDIGvKGVth7ZzJcg== X-Received: by 2002:a05:6830:1501:: with SMTP id k1mr4018288otp.12.1607242606956; Sun, 06 Dec 2020 00:16:46 -0800 (PST) Received: from [192.168.1.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id e1sm1469716oib.11.2020.12.06.00.16.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Dec 2020 00:16:46 -0800 (PST) Subject: Re: unbale to use pg_ctl in Windows Cmd. To: pgsql-admin@lists.postgresql.org References: <7649CBF6-6384-438A-BA5C-1ADA40A980BD@elevated-dev.com> From: Ron Message-ID: <4421c35e-3859-9a91-94c7-d6f734e58ec6@gmail.com> Date: Sun, 6 Dec 2020 02:16:45 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------515894BE3C11714BF5F3A2E3" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------515894BE3C11714BF5F3A2E3 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit You've got to do it because Postgresql requires you to. Or you could set PGDATA=|C:\Program Files\PostgreSQL\13\data'|and run |pg_ctl status|, just like the error message aid. On 12/6/20 2:02 AM, mark armon wrote: > > Problem resolved. But I just don’t know why. > So I need to add the data directory. like |pg_ctl status -D 'C:\Program > Files\PostgreSQL\13\data'| > > > > On Sat, Dec 5, 2020 at 10:54 PM Scott Ribe > wrote: > > > On Dec 5, 2020, at 10:02 AM, mark armon <1994hejian@gmail.com > > wrote: > > > > I don't know where the pg_data directory. > > You will have to find it to use pg_ctl > > > So I set the C:\Users\Think\Desktop\postgres\data as user variable > and system variable In windows setting. > > Doesn't do any good if that's not where the data directory is. > -- Angular momentum makes the world go 'round. --------------515894BE3C11714BF5F3A2E3 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit You've got to do it because Postgresql requires you to.

Or you could set PGDATA=C:\Program Files\PostgreSQL\13\data'and run pg_ctl status, just like the error message aid.

On 12/6/20 2:02 AM, mark armon wrote:

Problem resolved. But I just don’t know why.
So I need to add the data directory. like pg_ctl status -D 'C:\Program Files\PostgreSQL\13\data'



On Sat, Dec 5, 2020 at 10:54 PM Scott Ribe <scott_ribe@elevated-dev.com> wrote:
> On Dec 5, 2020, at 10:02 AM, mark armon <1994hejian@gmail.com> wrote:
>
> I don't know where the pg_data directory.

You will have to find it to use pg_ctl

> So I set the C:\Users\Think\Desktop\postgres\data as user variable and system variable In windows setting.

Doesn't do any good if that's not where the data directory is.

--
Angular momentum makes the world go 'round.
--------------515894BE3C11714BF5F3A2E3--