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 1ry2KS-00EBAG-9r for pgsql-general@arkaria.postgresql.org; Sat, 20 Apr 2024 04:27:57 +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 1ry2KQ-007qeH-J6 for pgsql-general@arkaria.postgresql.org; Sat, 20 Apr 2024 04:27:54 +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 1ry2KO-007qe9-OR for pgsql-general@lists.postgresql.org; Sat, 20 Apr 2024 04:27:54 +0000 Received: from fhigh5-smtp.messagingengine.com ([103.168.172.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ry2KJ-001vBt-GA for pgsql-general@lists.postgresql.org; Sat, 20 Apr 2024 04:27:52 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 8C971114010F; Sat, 20 Apr 2024 00:27:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 20 Apr 2024 00:27:43 -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=fm2; t=1713587263; x=1713673663; bh=AMcJjB+LxsUg3JyUw8xoLQ/PTU1ZezCY9AqY5N9sOtM=; b= gKAbPGQD1PsFJ3Gwz/KlxmNqgT7/23gvPLUCYS11SfuFQ47/S4WPPhOGxotFCLZH 5Jbt9xoeBDu7KzZS9Sdw3EkF+hXM/fyqAzxdBtNeiU8107vUAuR7ppqImh/y4/Tj 59vfbT6PvkY/+X6LLtPNjetqpuY44OczBOQg6Ii+tbrFsday9qwF3N3OALgXjgSE WJO4ifP6RktQ4fFlgSdCM7ClafOIgmPi8/mlMgZsEjsdW6sFJ4QDc670aowfvMdB 5uBGPrg+rCpabnR85ZCvL3Axll2hiQwCOYfZmni9tFBZYUMObcWCVadvl6jCayL8 M+YzPYD+SNnSskJc3n+uGw== 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=fm3; t=1713587263; x= 1713673663; bh=AMcJjB+LxsUg3JyUw8xoLQ/PTU1ZezCY9AqY5N9sOtM=; b=d XGyNsfN2MSBculeH5lajHj15T3ncdAsTh0U6Frjd4IZY5SO5XVjoGxF4UdR+mzc0 3bWQ6TOULE/AuQmlMPGoaLhokAE8So6geuVJol1D8n6Yc5FJcZEyvMYh0TgAG8Ei ngX4d2dPsTCOxNcLUZQjr22wvVAcWjfLfnWabx40i56ZtwsqPv3KrLKwaXkDuV39 MwrMi/cDS5VeWMpAni30AKJ+ACUVP6MglbxpqyZLFZO9c6U7DUXDUUX2U2XdnNzq d0OZ8GtRwW86bL6kIEmWlj/w8WilY3TiOhsrzpDF2FqLhCGzjN1ygIQSblAdnRVY MtGetiNj8tUPBFJ2oehGA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudekfedgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtke ertddtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepleegveekke ekueeigfdtveeileeuhfefudefteekjeffkeejueejheegheegkedtnecuffhomhgrihhn pehpohhsthhgrhgvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgt ohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 20 Apr 2024 00:27:42 -0400 (EDT) Message-ID: <66413cff-e249-4e09-85e7-54374116c035@aklaver.com> Date: Fri, 19 Apr 2024 21:27:41 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [help] Error in database import To: Tu Ho , 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: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/19/24 20:58, Tu Ho wrote: > Hi, > > I am currently having a project where I need to combine 2 large > database. I was not however able to import an excel file .csv into the There are Excel files(.xls/.xlsx) and there are *.csv files. > database. The error was ERROR: syntax error at or near "OIDS" LINE 1: > ...ing Site" , "International Name(s)" ) FROM STDIN OIDS DELI... > ^" > > I have no idea how to fix this because I used the "upload file" > option. What should I do? Use a recent version of whatever client you are using as: https://www.postgresql.org/docs/current/sql-copy.html "If 1, OIDs are included in the data; if 0, not. Oid system columns are not supported in PostgreSQL anymore, but the format still contains the indicator." Your client is using old syntax as the last version of Postgres that allowed FROM STDIN OIDS was: https://www.postgresql.org/docs/11/sql-copy.html "where option can be one of: FORMAT format_name OIDS [ boolean ] " And Postgres 11 is ~6 months past EOL. -- Adrian Klaver adrian.klaver@aklaver.com