Re: real/float example for testlibpq3

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Mark Wong <markwkm(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: real/float example for testlibpq3
Date: 2022-02-28 13:03:30
Message-ID: CAExHW5tm1FyoLZXdTjdrfRO7ObuoL_p2krc65C5s8D3eWFB50g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Mark,
Fetching a "real" type field from libpq doesn't look that intuitive.
So this example is super helpful. Thanks.

I am wondering whether we should provide PQgetfloatvalue() which does
what that example shows but transparently. It will return a float
value of the given field instead of char *. That will standardize the
way to fetch real typed values in libpq. That leads to the next
question. Do we need to introduce different PQget*value() for standard
C/SQL data types.

--
Best Wishes,
Ashutosh Bapat

On Fri, Feb 25, 2022 at 3:12 AM Mark Wong <markwkm(at)gmail(dot)com> wrote:
>
> Hi everyone,
>
> Would adding additional examples to testlibpq3.c on handling more data
> types be helpful? I've attached a patch adding how to handle a REAL to
> current example.
>
> Regards,
> Mark

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2022-02-28 13:10:25 Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)
Previous Message Julien Rouhaud 2022-02-28 12:58:58 Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)