error on Database insert

Greetings all,
I have been receiveing an error on database inserts stated below:

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
Thanks,

Cameron Seader
Operations Center Technician II
CSeader [at] Idahopower.com
1.208.388.2582 Office



[INFO] -- Access Manager:
This transmission may contain information that is privileged, confidential =
and/or exempt from disclosure under applicable law. If you are not the int=
ended recipient, you are hereby notified that any disclosure, copying, dist=
ribution, or use of the information contained herein (including any relianc=
e thereon) is STRICTLY PROHIBITED. If you received this transmission in err=
or, please immediately contact the sender and destroy the material in its e=
ntirety, whether in electronic or hard copy format. Thank you. A2



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html
CSeader [ Do, 27 November 2003 20:16 ] [ ID #141499 ]

Re: error on Database insert

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 [at] postgresql.org so that your
message can get through to the mailing list cleanly
Joe Conway [ Fr, 28 November 2003 03:34 ] [ ID #141500 ]

Re: error on Database insert (off-topic)

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 [at] 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 [at] Cranel.com
Cranel. Technology. Integrity. Focus.



---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo [at] postgresql.org
Greg Spiegelberg [ Mo, 01 Dezember 2003 18:40 ] [ ID #141506 ]
Datenbanken » gmane.comp.db.postgresql.php » error on Database insert

Vorheriges Thema: CMS with PostgreSQL
Nächstes Thema: Help Conecting to a database from PHP