X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 4F4E8D1B486 for ; Mon, 1 Dec 2003 17:41:12 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 47085-05 for ; Mon, 1 Dec 2003 13:40:41 -0400 (AST) Received: from colsweeper.cranel.com (newmail.cranel.com [12.32.71.147]) by svr1.postgresql.org (Postfix) with ESMTP id B4B33D1B4B1 for ; Mon, 1 Dec 2003 13:40:39 -0400 (AST) Received: from colmail01.cranel.com (colmail01.cranel.com) by colsweeper.cranel.com (Content Technologies SMTPRS 4.2.5) with ESMTP id ; Mon, 1 Dec 2003 12:42:06 -0500 Received: from cranel.com (gspiegelberg.cranel.com [192.168.11.134]) by colmail01.cranel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id X9HSLAKB; Mon, 1 Dec 2003 12:43:52 -0500 Message-ID: <3FCB7D0F.1020500@cranel.com> Date: Mon, 01 Dec 2003 12:40:31 -0500 From: Greg Spiegelberg Organization: Cranel, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joe Conway Cc: "Seader, Cameron" , pgsql-php@postgresql.org Subject: Re: error on Database insert (off-topic) References: <71B8A8BEC516CF46835CA629156CF21163F6A9@bedford.idacorp.local> <3FC6B449.1000606@joeconway.com> In-Reply-To: <3FC6B449.1000606@joeconway.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/3 X-Sequence-Number: 2449 Probably better if forwarded to the hackers list but it would be nice if you could set a flag for each transaction/connection to "autocast" on INSERT, UPDATE, DELETE and COPY according to the column the value is destined for. set enable_autocast = on; Could make for sloppy, less portable SQL and may take a hit in performance on INSERT's and the like conversely it would reduce the code on the client side. Guess it depends what you want to be doing the most work. Greg Joe Conway wrote: > Seader, Cameron wrote: > >> Bad int8 external representation "0x000000000002" >> >> what is this all about, why won't it insert this data into my bigint >> field in my Database? What does it mean by external representation? >> Does anyone have any suggestions > > > You are apparently trying to insert a hex string "0x000000000002" > (notice it starts with '0x') into an int8 field -- don't do that. > Convert the hex to integer before inserting, or cast it, like so: > > regression=# select x'000000000002'::int8; > int8 > ------ > 2 > (1 row) > > > Joe > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly -- Greg Spiegelberg Sr. Product Development Engineer Cranel, Incorporated. Phone: 614.318.4314 Fax: 614.431.8388 Email: gspiegelberg@Cranel.com Cranel. Technology. Integrity. Focus.