Re: pl/pgSQL, get diagnostics and big data

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>
Cc: Christian Ullrich <chris(at)chrullrich(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pl/pgSQL, get diagnostics and big data
Date: 2016-03-12 05:33:33
Message-ID: 56E3AA2D.9040605@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/03/16 04:30, Tom Lane wrote:
>
> 1. I found two places (marked XXX in this patch) that are using strtoul()
> to parse a tuple count back out of a command tag. That won't do anymore.
> pg_stat_statements has a messy hack for the same problem (look for
> HAVE_STRTOULL), which is probably what we want to do, but not by
> copy-and-pasting #ifdef HAVE_STRTOULL into multiple places. I'd be
> inclined to provide a utility function "pg_strtouint64" or some such
> to encapsulate that. (numutils.c might be a good place for it.)
>

Hmm, I thought that solution is not really portable for 64bit numbers
and only is allowed in pg_stat_statements because worst case it will cut
the number to 32bit int and misreport but won't break anything there.
For example windows IIRC need _strtoui64 for this.

I once wrote (well copy-pasted from BDS + some #define wrappers)
portable version of that, see the 0004 and bottom of 0003 in
http://www.postgresql.org/message-id/557D9DED.2080204@2ndquadrant.com (I
think at minimum what the 0003 does in c.h is needed).

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2016-03-12 05:54:29 Re: [COMMITTERS] pgsql: Provide much better wait information in pg_stat_activity.
Previous Message Chris Ruprecht 2016-03-12 04:18:56 Re: OS X 10.11.3, psql, bus error 10, 9.5.1