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 1jS0jx-0006Fi-6t for pgsql-general@arkaria.postgresql.org; Fri, 24 Apr 2020 15:59:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jS0jv-0003tm-VK for pgsql-general@arkaria.postgresql.org; Fri, 24 Apr 2020 15:59:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jS0ju-0003pN-9t for pgsql-general@lists.postgresql.org; Fri, 24 Apr 2020 15:59:43 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jS0jp-0008Dr-7g for pgsql-general@postgresql.org; Fri, 24 Apr 2020 15:59:41 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 6356B1519; Fri, 24 Apr 2020 11:59:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 24 Apr 2020 11:59:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=u 8CVkNPTF6chRDN2RE/sCG4zTlVm8YoynwMsfhQKlCU=; b=drkhcKJcak4i64Hqs GMolf7qX+tS9L0Mche4FyloIKV/rGohHuntKHIK2mcmcvDs4IcSfyk9agZ+WCohz ma1DZHu3n73STQ0duI3/e0XcLkWjJoUL+2s5Dl3GKSfTNf+ZKNIJSPaZe063Np4U 1MX/BJh25LlMjDbgTzvGqBhUjkw2JpxqIXHlZterePhhHpNF6MEbYCdnDTztA19h mUcVHgXmNmTMV+3DD6mPOA156qziWDoqtVjCv3xn95MCvBhIcuv8f4rIM4BDIn4/ 7e/e+gHw1H3snUVeHJM3r5n6g2vRpfHPaRv+xoDxLj21bo7PG69hSWRDkppn1/eR NJhew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=u8CVkNPTF6chRDN2RE/sCG4zTlVm8YoynwMsfhQKl CU=; b=FNKeHT+mIkjTkmZKz5Zt+jkQHtIM+9uEoAzNwW0KIwfZL8FLgvfv+9OCJ 0+xfCi2xUixKKs0dY9CIUKpR48w4dI9sMyp2Xqm5UfQxSDfdG4L5RK11PlkC3am0 P+BCld5lt1eWKwwE90b0styjI6owwNPG3SSRSB6rDGUVEsziSEFVSviIEVUmpQEa p/IVsYA2kQoU9ruFwRfLjIDQVXgBlGjjOm8XHzVfVcLH33uiSldV+w4z2FY2rtCS PVwzut2P6Da33fvIgYOgmyu02YSOnkoH2FnbP/g5zCv0Vg3inqgt0evIvQ2UO0Jf vDOTMusl4X7Sgl4POnP+US5VBO1tw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrhedugdeltdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghdpnhgvthifohhlvhgvshdr tghomhenucfkphepleejrdduudefrddvtdejrddufeeknecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghk lhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.10] (97-113-207-138.tukw.qwest.net [97.113.207.138]) by mail.messagingengine.com (Postfix) with ESMTPA id 145223280069; Fri, 24 Apr 2020 11:59:33 -0400 (EDT) Subject: Re: psql \copy To: Steve Clark , pgsql References: From: Adrian Klaver Message-ID: <8ae0540e-7068-f296-eddf-3355f8ee8f29@aklaver.com> Date: Fri, 24 Apr 2020 08:59:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 4/24/20 8:55 AM, Steve Clark wrote: > Hello, > > I am using psql to copy data extracted from an InfluxDB in csv format > into postgresql. > I have a key field on the time field which I have defined as a bigint > since the time I get > from InfluxDB is an epoch time. > > My question is does psql abort the copy if it hits a duplicate key, or > does it keep processing? Aborts. \copy uses COPY so: https://www.postgresql.org/docs/12/sql-copy.html "COPY stops operation at the first error. This should not lead to problems in the event of a COPY TO, but the target table will already have received earlier rows in a COPY FROM. These rows will not be visible or accessible, but they still occupy disk space. This might amount to a considerable amount of wasted disk space if the failure happened well into a large copy operation. You might wish to invoke VACUUM to recover the wasted space." > > > Thanks, > -- > Stephen Clark > *NetWolves Managed Services, LLC.* > Sr. Applications Architect > Phone: 813-579-3200 > Fax: 813-882-0209 > Email: steve.clark@netwolves.com > http://www.netwolves.com > > Email Confidentiality Notice: The information contained in this > transmission may contain privileged and confidential and/or protected > health information (PHI) and may be subject to protection under the law, > including the Health Insurance Portability and Accountability Act of > 1996, as amended (HIPAA). This transmission is intended for the sole use > of the individual or entity to whom it is addressed. If you are not the > intended recipient, you are notified that any use, dissemination, > distribution, printing or copying of this transmission is strictly > prohibited and may subject you to criminal or civil penalties. If you > have received this transmission in error, please contact the sender > immediately and delete this email and any attachments from any computer. > Vaso Corporation and its subsidiary companies are not responsible for > data leaks that result from email messages received that contain > privileged and confidential and/or protected health information (PHI). -- Adrian Klaver adrian.klaver@aklaver.com