Skip site navigation (1) Skip section navigation (2)

Re: Unsigned ints (Help)

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>
Cc: Postgresql <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unsigned ints (Help)
Date: 2001-03-28 15:53:08
Message-ID: 3AC208E4.70B4AF6C@alumni.caltech.edu (view raw or flat)
Thread:
Lists: pgsql-hackers
> At this point I decided that somewhere in the definition of the type
> there must be a way of specifying how values can be transformed. Can
> anybody explain to me what I need to change to make this work? Without
> this ecpg cannot work with unsigned ints, so explicit casting is not an
> option.

The large integer-like value is silently transformed into a float8 by
the scanner (very early in the parsing stage). You have not provided a
function to transform float8 into uint4, which if you do so will fix
your problem. Do a

  create function uint4(float8)...

and the type coersion code will understand how to convert one into the
other.

                     - Thomas

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2001-03-28 16:09:28
Subject: Re: Unsigned ints (Help)
Previous:From: Joel BurtonDate: 2001-03-28 15:52:28
Subject: Re: Feature Request: ALTER FUNCTION (or something like that)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group