Re: error on Database insert - Mailing list pgsql-php

From Joe Conway
Subject Re: error on Database insert
Date
Msg-id 3FC6B449.1000606@joeconway.com
Whole thread Raw
In response to error on Database insert  ("Seader, Cameron" <CSeader@idahopower.com>)
Responses Re: error on Database insert (off-topic)
List pgsql-php
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


pgsql-php by date:

Previous
From: "Seader, Cameron"
Date:
Subject: error on Database insert
Next
From: "Majolee InfoTech"
Date:
Subject: plan CONTEXT: PL/pgSQL function Error