pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Spiegelberg <gspiegelberg@cranel.com>
To: Joe Conway <mail@joeconway.com>
Cc: Seader, Cameron <CSeader@idahopower.com>
Cc: pgsql-php@postgresql.org
Subject: Re: error on Database insert (off-topic)
Date: Mon, 01 Dec 2003 12:40:31 -0500
Message-ID: <3FCB7D0F.1020500@cranel.com> (raw)
In-Reply-To: <3FC6B449.1000606@joeconway.com>
References: <71B8A8BEC516CF46835CA629156CF21163F6A9@bedford.idacorp.local>
	<3FC6B449.1000606@joeconway.com>

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.





Message-ID: <3FCB7D0F.1020500@cranel.com>
Permalink:  ../3FCB7D0F.1020500@cranel.com/
Also on:    postgresql.org/message-id/3FCB7D0F.1020500@cranel.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: gspiegelberg@cranel.com, mail@joeconway.com, CSeader@idahopower.com
  Subject: Re: error on Database insert (off-topic)
  In-Reply-To: <3FCB7D0F.1020500@cranel.com>
  References: <71B8A8BEC516CF46835CA629156CF21163F6A9@bedford.idacorp.local> <3FC6B449.1000606@joeconway.com> <3FCB7D0F.1020500@cranel.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox