libpq: Char to INT - Mailing list pgsql-general

From Nelio Alves Pereira Filho
Subject libpq: Char to INT
Date
Msg-id 3A0ACAE3.D7416B97@ifx.com.br
Whole thread Raw
Responses Re: libpq: Char to INT  (Jim Mercer <jim@reptiles.org>)
List pgsql-general
Hi there..

I want to do a query that returns an integer and then fetch the result
as an int. My query is something like that:

SELECT 1::int

Normally, I would get the result as a char and then convert it to int.
Until here, no misteries. However, 'The Programmer's Guide' shows an
example where a char pointer is converted to an int pointer, and then
it's used normally. I tried that, but the result wasn't correct..

Just to mention, I 'm used to convert char to int with strtol.

Thanks in advance.


Nelio Pereira
IFX Networks


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: upgrading to 7.0.2
Next
From: Dan Moschuk
Date:
Subject: More vacuum troubles