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 1oOI8f-0006j9-Gc for pgsql-general@arkaria.postgresql.org; Wed, 17 Aug 2022 12:27:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oOI8d-00046f-LC for pgsql-general@arkaria.postgresql.org; Wed, 17 Aug 2022 12:27:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oOI8d-00045o-94 for pgsql-general@lists.postgresql.org; Wed, 17 Aug 2022 12:27:11 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oOI8Z-0004tv-U0 for pgsql-general@lists.postgresql.org; Wed, 17 Aug 2022 12:27:10 +0000 Received: by mail-pj1-x1029.google.com with SMTP id s36-20020a17090a69a700b001faad0a7a34so1663633pjj.4 for ; Wed, 17 Aug 2022 05:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:from:to:cc; bh=HsALYto549P2MlnQT29bPVqUmzUWbwAs0GKu4mFYIFI=; b=iMm/ZI6eKAfWxc88XEeAw8fcKffDr1jUx2/DDAKLAtRL2l15lWnLH1mcSWoZdjqmKZ gMZkTtniaqnwdgxzHDNJnD7fov+9wInHRiUWiyaYsAuqwrP0VP/NOu5Ibrpq7z2rp6iH Mxwya229g+TlHk2baU8yzxNRtFCQrfqxsOutHlcnW6WGyDir5E3J16cE5sdPBBeSEn4G lc5rTKW3v+Oo8dWkusSE5vx7vYbAJsw/YouY6uRrU2Pn9cebknIO1dzCCX7Rt/uhXsyq gyVcnmS7EpR+8IS0kBaetFuAbpRxNO0KJnD1Fy/+e8eccBN2Io7v0zAV44pnRnw/E89b EFbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:x-gm-message-state:from:to:cc; bh=HsALYto549P2MlnQT29bPVqUmzUWbwAs0GKu4mFYIFI=; b=21WK3J/7Jod+Gkc31qnSja1c2aH+REWAHyt7QlaPFaAFaJD4MspdtppSiHXQaNxcGQ u1JHFMHMQnDqDcOVf7VpeByYNfu2J2ANx/HDp9uEF4VG5r+g3T6SY5phVdi8bLftODTY 6uOQV2wzD/mQP83bEsk3LjDj5oAymdKvWZmgWLsbSJ60MrrfhBio4izOQF83B3iSQqjS N8dQ6wey+RWvl238o6mamtyPdzMFQH8DZLfQJoSCRmR1vK+tcSrbVmoetMYWUv8yj4Nx 3wMLR9XwwhitRhAvRHREWHimBkNIftTIqTkh4WnWofzM8LoqXJAwRwwOW6Y5nfBfrSqS ZKsQ== X-Gm-Message-State: ACgBeo1/faSkDEcF5y9kLUDZwD/P2v7PqlmLR8gGtSdTKe4pvZ9Hsz1r MkRdi0UyWfyI+zwVycTAS6jca0389pw= X-Google-Smtp-Source: AA6agR7DcM060zyHCxjarnxb3vRfCt4esYG5Q+2NHi7Mu5VZgrdkB/pPk3cdMJQxaR+8IPL5QnuC2A== X-Received: by 2002:a17:90b:4b0a:b0:1f5:f2c3:645c with SMTP id lx10-20020a17090b4b0a00b001f5f2c3645cmr3616980pjb.10.1660739225833; Wed, 17 Aug 2022 05:27:05 -0700 (PDT) Received: from [10.11.12.172] ([182.69.205.142]) by smtp.gmail.com with ESMTPSA id m15-20020a6562cf000000b00422c003cf78sm8152533pgv.82.2022.08.17.05.27.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Aug 2022 05:27:05 -0700 (PDT) From: JITEN KUMAR SHAH X-Google-Original-From: JITEN KUMAR SHAH Content-Type: multipart/alternative; boundary="------------EGhSEbLtFWwLGBg3d5pMudIl" Message-ID: Date: Wed, 17 Aug 2022 17:57:02 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0 Subject: Re: Sub:column "" is of type bigint but expression is of type character varying Content-Language: en-US To: pgsql-general@lists.postgresql.org References: In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------EGhSEbLtFWwLGBg3d5pMudIl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 1. Please check you tickets_archive.ticket_purchase_no data type. 2. check if you are using correct schema. On 8/17/22 14:23, Rama Krishnan wrote: > Hi All, > > I am having table name called tickets > > > \d tickets > >             Column            |     Type             | Collation | > Nullable | Default > ------------------------------+-----------------------------+-----------+----------+--------- >  id                           | bigint                     |   | not > null | >  ticket_purchase_no| bigint          |                        | not > null | > > this below table contains more than 2 years old data > \d tickets_archive > >             Column |            Type             | Collation | > Nullable | Default > ------------------------------+-----------------------------+-----------+----------+--------- >  id                           | bigint                      |         >           | not null | >  ticket_purchase_no| bigint                  |         | not null | > > > > > 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;* > > >  column "*ticket_purchase_no*" is of type bigint but expression is of > type character varying > Regards > > A.Rama Krishnan --------------EGhSEbLtFWwLGBg3d5pMudIl Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Please check you tickets_archive.ticket_purchase_no data type.

2. check if you are using correct schema.


On 8/17/22 14:23, Rama Krishnan wrote:
Hi All,

I am having table name called tickets


\d tickets

            Column            |            Type             | Collation | Nullable | Default
------------------------------+-----------------------------+-----------+----------+---------
 id                           | bigint                      |                        | not null |
 ticket_purchase_no| bigint                     |                        | not null | 

this below table contains more than 2 years old data
\d tickets_archive 

            Column            |            Type             | Collation | Nullable | Default
------------------------------+-----------------------------+-----------+----------+---------
 id                           | bigint                      |                        | not null |
 ticket_purchase_no| bigint                     |                        | not null | 




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;


 column "ticket_purchase_no" is of type bigint but expression is of type character varying
Regards

A.Rama Krishnan

--------------EGhSEbLtFWwLGBg3d5pMudIl--