Thread: util/int8.h: missing int8_text() function

util/int8.h: missing int8_text() function

From
Michael Enke
Date:
Hi all,
I migrate from 8.1 to 8.3.
In 8.2.7 and previous there are functions int4_text() and int8_text(),
in 8.3.0 they are missing (not documented that they are removed in the release notes).
What I'm supposed to use instead of int8_text() now?
(I use my own datatype which is similar to varchar/text
  and for a  CREATE CAST (int8 as myType) WITH FUNCTION myFunction(int8) AS ASSIGNMENT;
  I call the int8_text() function.)

Thank you,
Michael

--
Wincor Nixdorf International GmbH
Sitz der Gesellschaft: Paderborn
Registergericht Paderborn HRB 3507
Gesch�ftsf�hrer: Eckard Heidloff (Vorsitzender), Stefan Auerbach, Dr. J�rgen Wunram
Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller
Steuernummer: 339/5884/0020 - Ust-ID Nr.: DE812927716 - WEEE-Reg.-Nr. DE44477193

Diese E-Mail enth�lt vertrauliche Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt�mlich
erhaltenhaben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie
dieunbefugte Weitergabe dieser E-Mail ist nicht gestattet. 

This e-mail may contain confidential information. If you are not the intended recipient (or have received this e-mail
inerror) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or
distributionof the material in this e-mail is strictly forbidden. 


Re: util/int8.h: missing int8_text() function

From
Craig Ringer
Date:
Michael Enke wrote:
> Hi all,
> I migrate from 8.1 to 8.3.
> In 8.2.7 and previous there are functions int4_text() and int8_text(),
> in 8.3.0 they are missing (not documented that they are removed in the
> release notes).
> What I'm supposed to use instead of int8_text() now?

Probably an explicit cast, such as

CAST(4444::int8 AS text)

CAST('4444' AS int8)

etc.

I don't know, but I'd guess that this is related to the removal of all
the implicit casts to text from 8.3 .

--
Craig Ringer

Re: util/int8.h: missing int8_text() function

From
Alvaro Herrera
Date:
Michael Enke wrote:
> Hi all,
> I migrate from 8.1 to 8.3.
> In 8.2.7 and previous there are functions int4_text() and int8_text(),
> in 8.3.0 they are missing (not documented that they are removed in the release notes).
> What I'm supposed to use instead of int8_text() now?
> (I use my own datatype which is similar to varchar/text
>  and for a  CREATE CAST (int8 as myType) WITH FUNCTION myFunction(int8) AS ASSIGNMENT;
>  I call the int8_text() function.)

IIRC the casts now use the type's output function.  I'm guessing you
should be able to do the same with your type.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Re: util/int8.h: missing int8_text() function

From
Michael Enke
Date:
Alvaro Herrera wrote:
> Michael Enke wrote:
>
>>Hi all,
>>I migrate from 8.1 to 8.3.
>>In 8.2.7 and previous there are functions int4_text() and int8_text(),
>>in 8.3.0 they are missing (not documented that they are removed in the release notes).
>>What I'm supposed to use instead of int8_text() now?
>>(I use my own datatype which is similar to varchar/text
>> and for a  CREATE CAST (int8 as myType) WITH FUNCTION myFunction(int8) AS ASSIGNMENT;
>> I call the int8_text() function.)
>
>
> IIRC the casts now use the type's output function.  I'm guessing you
> should be able to do the same with your type.
>

I thougth there is same functionality with changed name.
But probably not public available anymore.
Now I do an sprintf() myself.

--
Wincor Nixdorf International GmbH
Sitz der Gesellschaft: Paderborn
Registergericht Paderborn HRB 3507
Gesch�ftsf�hrer: Eckard Heidloff (Vorsitzender), Stefan Auerbach, Dr. J�rgen Wunram
Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller
Steuernummer: 339/5884/0020 - Ust-ID Nr.: DE812927716 - WEEE-Reg.-Nr. DE44477193

Diese E-Mail enth�lt vertrauliche Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt�mlich
erhaltenhaben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie
dieunbefugte Weitergabe dieser E-Mail ist nicht gestattet. 

This e-mail may contain confidential information. If you are not the intended recipient (or have received this e-mail
inerror) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or
distributionof the material in this e-mail is strictly forbidden. 


Re: util/int8.h: missing int8_text() function

From
Martijn van Oosterhout
Date:
On Wed, Apr 16, 2008 at 03:41:31PM +0200, Michael Enke wrote:
> >IIRC the casts now use the type's output function.  I'm guessing you
> >should be able to do the same with your type.
>
> I thougth there is same functionality with changed name.
> But probably not public available anymore.
> Now I do an sprintf() myself.

For reference, the casts now do the equivalent of text_in(int8_out(v)).

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

Attachment