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 1sqDvI-007xtI-TR for pgsql-general@arkaria.postgresql.org; Mon, 16 Sep 2024 15:45:58 +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 1sqDvI-00G6U3-Jw for pgsql-general@arkaria.postgresql.org; Mon, 16 Sep 2024 15:45:56 +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 1sqDvH-00G6Tq-9X for pgsql-general@lists.postgresql.org; Mon, 16 Sep 2024 15:45:56 +0000 Received: from fout8-smtp.messagingengine.com ([103.168.172.151]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sqDvC-001VKw-FB for pgsql-general@lists.postgresql.org; Mon, 16 Sep 2024 15:45:54 +0000 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.phl.internal (Postfix) with ESMTP id 5043E138030C; Mon, 16 Sep 2024 11:45:49 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Mon, 16 Sep 2024 11:45:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= 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=1726501549; x=1726587949; bh=Wbv68Sm1PSpxfVgMLCus9hgfKummdBpqgKWuDdDdbRw=; b= rnsUINjW/3nuCv6a64mrB1bru10eD+gc9RzNdMHt2IQ/Qa/FHB4NzKKRKYXbRpHj HH3QpmYm0j+WcUU9ejCpomodTX7+qhcDlnogJUh7/ORKa7N8OtNm5A1LFr5TvzIu R5wybld2DZWd6KOj6IZ7/XW6CyRs+HN9d/LDjMx0gjDKtCR8uD3di0TJwYLSqR/1 QNELwwP17yQh3S9C47tZDsMEd9h6vxi05ukstfWpYIdlZHGLAJQWzVVdU9GBwKEV D+Fjw2ZwygOUd5RBBs/bKbvVwthe8P38Hk8Bs/+FSdG9Q5KHqXxvS41RE3IIgY72 8soHz0i5045tbZfoNzf/7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=1726501549; x= 1726587949; bh=Wbv68Sm1PSpxfVgMLCus9hgfKummdBpqgKWuDdDdbRw=; b=F ssFIWKH0ioO+7ie9cRikYBEPVH53VJLQCWnKQv9n/ZVUqn9/vBss+JmrWQ3iPrsZ 7HvA6toPCLit7lrW3Z3gxbCNI1R8PKckHkLINmbRgK38i4LLr56loS3JFe0DXYRT pzowCRHhOfVFU6n5C4Bvr3Ct6TnodwYEyKzB9R2f7TTM+ag60IIaeMoPwDtFnJ0l JY/bCb3gGNNyRYDMZvMfjVWbm4uOChNlCntKWLekFKrrUtF4LPi55CL2Gx/ANYF0 ND2TD8gPbhFUL+wMaVMoSsP3EXdkjAGZZ/RxBgfayXWjv+spN6sfIRyXk/bo9I86 ON9Dz9EQRSDWDuOErD2tw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudekhedgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeen ucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeeivdfhieehheegueeileej ieettdejhedugeefleekvdelkeehtdfgiefffeekudenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhl rghvvghrrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprh gtphhtthhopehhrghrthhmrghniedthhhomhgvsehgmhgrihhlrdgtohhmpdhrtghpthht ohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorh hg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Sep 2024 11:45:48 -0400 (EDT) Message-ID: <86496379-3656-476e-9503-4611fd93a491@aklaver.com> Date: Mon, 16 Sep 2024 08:45:46 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: load fom csv To: Andy Hartman , pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/16/24 08:35, Andy Hartman wrote: > I'm trying to run this piece of code from Powershell and it just sits > there and never comes back. There are only 131 records in the csv. > > $connectionString = > "Host=$pgServer;Database=$pgDatabase;Username=$pgUser;Password=$pgPassword" > $copyCommand = "\COPY $pgTable FROM '$csvPath' DELIMITER ',' CSV HEADER;" > > psql -h $pgServer -d $pgDatabase -U $pgUser -c $copyCommand > > > how can I debug this? 1) Look at the Postgres log. 2) Run the psql command outside PowerShell with hard coded connection values and -c command. > > Table layout > > image.png -- Adrian Klaver adrian.klaver@aklaver.com