Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtHl1-0006YS-1I for pgsql-admin@arkaria.postgresql.org; Mon, 11 Feb 2019 20:00:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gtHkz-0008Ki-RQ for pgsql-admin@arkaria.postgresql.org; Mon, 11 Feb 2019 20:00:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtHkz-0008KY-Gh for pgsql-admin@lists.postgresql.org; Mon, 11 Feb 2019 20:00:45 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtHkw-00030Z-JC for pgsql-admin@lists.postgresql.org; Mon, 11 Feb 2019 20:00:44 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 87E3BAB7A0; Mon, 11 Feb 2019 20:00:41 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo05-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xqm3JoDViaqt; Mon, 11 Feb 2019 20:00:41 +0000 (UTC) Received: from [10.25.225.169] (unknown [159.182.1.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 47C36AB790; Mon, 11 Feb 2019 20:00:38 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: insert data with invalid input syntax for integer:"42P01" From: Scott Ribe In-Reply-To: <2112371589.1866229.1549913142122@mail.yahoo.com> Date: Mon, 11 Feb 2019 13:00:36 -0700 Cc: "David G. Johnston" , Pgsql-admin Content-Transfer-Encoding: quoted-printable Message-Id: <741DB90F-6C7A-4AEA-B2EB-DD37C5529AF4@elevated-dev.com> References: <2112371589.1866229.1549913142122.ref@mail.yahoo.com> <2112371589.1866229.1549913142122@mail.yahoo.com> To: Pepe TD Vo X-Mailer: Apple Mail (2.3445.102.3) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Feb 11, 2019, at 12:25 PM, Pepe TD Vo wrote: >=20 > insert into cidrmgmt.errorlog(...) For what it's worth, it seems likely the error is coming from that line = (assuming you posted the correct procedure definition), thus that's the = table whose definition matters. Further, the bad value is likely coming = from the context, and there's no info here that would help figure out = why there's "42P01" where an integer is required. But I can tell you = that PG's nearest equivalent of Oracle's sys_context is untyped, always = a string, so there would have to be a cast to an integer type. But of = course you can't cast 42P01 to an integer, so that has to be figured out = first.