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 1oOKe9-0006XC-0l for pgsql-general@arkaria.postgresql.org; Wed, 17 Aug 2022 15:07:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oOKe7-0006tr-Ko for pgsql-general@arkaria.postgresql.org; Wed, 17 Aug 2022 15:07:51 +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 1oOKe5-0006ti-KV for pgsql-general@lists.postgresql.org; Wed, 17 Aug 2022 15:07:51 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oOKe2-0005Fv-Mo for pgsql-general@postgresql.org; Wed, 17 Aug 2022 15:07:48 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4E6D75C00D9; Wed, 17 Aug 2022 11:07:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 17 Aug 2022 11:07:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1660748865; x= 1660835265; bh=ZNNpMK1wa7+6NoLbQmcL10ektlfzTRzcH8NYKMJXJDQ=; b=n Bzt/YFOpzaRQzy4RIT3SAb0TleClCd9acRjToIzqIMGKSn0S+C71/ZTEj+LcO2g+ 6Jt9CTxr4ZutfxBpsYQeqo5urWHecxMWkbRY0AHX4VFG6jt9K8KPaBIozJivQs9o fMMMUvToNQwDoIrfxBGxrDtgR/dbOX0OJQHS0gRhv2IaJ9zMMQLJjCTxDuJCK2GK gePD/sZx5asuR3ADnmTg8mytbpx/o+9xss/cAD6DxB/3klJVQ5y9BsxG1fv34DBK p3mxXDjccj2/4xwY+maiK8N70hmoIqLnKalfdo++RDuKAt1uLV6KV9TKZpviP7wI cRULuYDML1CtEvX3XmekQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1660748865; x=1660835265; bh=Z NNpMK1wa7+6NoLbQmcL10ektlfzTRzcH8NYKMJXJDQ=; b=xEu+P3yvfp6ka+nY9 2gJdtbZMvVxnhz8DybN0/H2Pnc7BPw6tNCmEBsfMqPc5rR+KyRg9Jp/FJnJgmd8f xcsOTGpzbewRt7CvztNk6uUy1r4XKAv9yzAX7o30jko9Hl/HjU+rdh6xneBFIT0x hxedI7mwLNniJqyP8Sj2GlG7domCDgymzXbpncHtSmgw2hn5r3kvHUvnZgstk6Rv zRJl4x5Yd62iqYvKNdbPxOyKQ0nFpyNPzDwKQpjfy8CVd4W5djd88NEBw2GSRsH6 Idh2leJHtslV7XY3wYePYQp/HOYZS+yDPQPWZSsd/avHi//naWtT/fbBIMQum50T uXzOg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehiedgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeelkeegjefhkeetheefudevteehiedvudehkeduleet fedvffeuhedtvdegtdeffeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhi rghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 Aug 2022 11:07:44 -0400 (EDT) Message-ID: Date: Wed, 17 Aug 2022 08:07:43 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: Sub:column "" is of type bigint but expression is of type character varying Content-Language: en-US To: Rama Krishnan , Postgres General References: 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 8/17/22 01:53, Rama Krishnan wrote: > Hi All, > > > i have purged the old data from orginal table when i am restoring the > data from archive table into orignal table i am getting the error > > > *insert into tickets select * from tickets_archive;* The above depends on: https://www.postgresql.org/docs/current/sql-insert.html "The target column names can be listed in any order. If no list of column names is given at all, the default is all the columns of the table in their declared order; or the first N column names, if there are only N columns supplied by the VALUES clause or query. The values supplied by the VALUES clause or query are associated with the explicit or implicit column list left-to-right. " If this is not the case then you can get mismatched columns where a varchar value is being inserted into an integer field. Verify that the table column order is the same for both tables. > > >  column "*ticket_purchase_no*" is of type bigint but expression is of > type character varying > Regards > > A.Rama Krishnan -- Adrian Klaver adrian.klaver@aklaver.com