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 1sqw0q-00EAKj-Vi for pgsql-general@arkaria.postgresql.org; Wed, 18 Sep 2024 14:50:37 +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 1sqw0p-00BGsd-NT for pgsql-general@arkaria.postgresql.org; Wed, 18 Sep 2024 14:50:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sqw0o-00BGr5-FO for pgsql-general@lists.postgresql.org; Wed, 18 Sep 2024 14:50:35 +0000 Received: from fhigh1-smtp.messagingengine.com ([103.168.172.152]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sqw0k-001pC0-QX for pgsql-general@lists.postgresql.org; Wed, 18 Sep 2024 14:50:33 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id AD60611400C0; Wed, 18 Sep 2024 10:50:28 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Wed, 18 Sep 2024 10:50:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1726671028; x=1726757428; bh=5zbNJy8hEMEKbMbrFwuonxMzIODO8R03b58U5TfjN+g=; b= DwtIO5TcEq9L4UguJuqUIPmfAv/R6Hxtdj9l+FqWWD0u/U5bcNT4oP+9dTl1va+L l0P27jzPtr4wCrt3DIzNGpKkB7ubrbPx+iTeIzyeFvwxCL3whzoGf1hlGrG4fRdI ssoqE9mmUITkYlkfxTYnmxjaY85oNne2GKQFT3Z4/Wv3h39PPlgDUqpTY4k5F7xP ww2DCr1tHc/0BBy3ffw5DHTqO68nKyB9avXRG2xEnsvgQLqXx1XJip3Ojw/MF1wR 9alIOxw0SDOTmDoSu0NzZAUH8HycgS4lKNqCcc3s5uUSh5WilTUlhCUqyMbcyBIG bQp3dORQnZErOeR/oLLP+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1726671028; x= 1726757428; bh=5zbNJy8hEMEKbMbrFwuonxMzIODO8R03b58U5TfjN+g=; b=A XEHD03mDTnzLI/+8UbfpkipXMhV+ZZTu7CQSOkjk/QYBLOU6Ie5qTx+uDEu0wrcM nLnpEpxBMz5vR5bnCohI/9xeiPs3tGyfSKvgCaYbcIRLqBFLzrr1uWBPOTQ+tOdw Qt6yJpuSet4yqhaRqkLaqMjL9Xl4KpBbramIpaSOqmaQ6/INxATCjxhYGUcfT6NM 8+P9MHvHqThZJHu+Hiuoz2bHR+Ov1i9L3Mzsk+3pOun9tgbV48m8CTC2OpJycgMS P1h8Kt9m3589Q1Mxsa/x72zXWwGzLyBwPx+orFZPWuS1Q3CayEI9fulDawlDWVGS pD5cWGFIywstTelgvuZLA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudekledgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdej necuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrh esrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepgfdufeekhfevfeelveei ueevhedvuddukeduvddvlefhueeuieejtdeuvdevvdeunecuffhomhgrihhnpehpohhsth hgrhgvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsg gprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehrohgsjhhs rghrghgvnhhtsehgmhgrihhlrdgtohhmpdhrtghpthhtohephhgrrhhtmhgrnheitdhhoh hmvgesghhmrghilhdrtghomhdprhgtphhtthhopehushhmrghnrdhksegsihhtnhhinhgv rdhnvghtpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhosh htghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Sep 2024 10:50:27 -0400 (EDT) Message-ID: <1659e97b-0b0f-401b-9dda-8d63241d8769@aklaver.com> Date: Wed, 18 Sep 2024 07:50:26 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: load fom csv To: Rob Sargent , Andy Hartman Cc: Muhammad Usman Khan , pgsql-general@lists.postgresql.org References: <75301205-13E6-4C65-9D70-78F196937F69@gmail.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: <75301205-13E6-4C65-9D70-78F196937F69@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/18/24 06:29, Rob Sargent wrote: > > >> On Sep 18, 2024, at 6:39 AM, Andy Hartman wrote: >> >>  >> psql -h $pgServer -d $pgDatabase -U $pgUser -c $copyCommand >> >> I'm wondering if it's waiting on P/w ? In a previous post I suggested: " To work through this you need to try what I call the crawl/walk/run process. In this case that is: 1) Crawl. Connect using psql and run the \copy in it with hard coded values. 2) Walk. Use psql with the -c argument and supply the command again with hard coded values 3) Run. Then use PowerShell and do the variable substitution. " Did you do this with the same command at each stage? If so at either 1) or 2) where you asked for a password? In a later posted I asked: "1) Are you logging connections/disconnection per?: https://www.postgresql.org/docs/current/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT If not do so as it will show you if a connection is being attempted. " Did you enable connection logging? Did you look at the Postgres log? If both the answers are yes you should see something like the below in case of password authentication: 2024-09-18 07:47:38.692 PDT [8090] [unknown]@[unknown] LOG: connection received: host=127.0.0.1 port=44840 2024-09-18 07:47:42.410 PDT [8095] [unknown]@[unknown] LOG: connection received: host=127.0.0.1 port=44848 2024-09-18 07:47:42.414 PDT [8095] aklaver@test LOG: connection authenticated: identity="aklaver" method=md5 (/etc/postgresql/16/main/pg_hba.conf:125) 2024-09-18 07:47:42.414 PDT [8095] aklaver@test LOG: connection authorized: user=aklaver database=test application_name=psql SSL enabled (protocol=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384, bits=256) >> >> Thanks. > > Very likely.  Can you show the authentication > mechanisms used (pg_hba)? >> >> On Tue, Sep 17, 2024 at 7:10 PM Andy Hartman > > wrote: >> >> I'll echo vars and see if something looks strange. >> >> THanks. >> >> On Tue, Sep 17, 2024 at 3:46 PM Rob Sargent > > wrote: >> >> >> >> > On Sep 17, 2024, at 12:25 PM, Adrian Klaver >> > >> wrote: >> > >> > On 9/17/24 09:21, Andy Hartman wrote: >> >> The command work outside of powershell  yes >> > >> > Then you are going to need to use whatever debugging tools >> PowerShell has available to step through the script to figure >> out where the problem is. >> > >> > >> >> Visual Studio can run/debug PS 1 files. I am not at my desk >> but have done ps1 oneliner queries against mssql >> >> Suggest echoing ALL vars used in psql command >> >> > >> > >> -- Adrian Klaver adrian.klaver@aklaver.com