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

BUG #4947: libpq PQntuples should return 64-bit number

From: "Jim Michaels" <jmichae3(at)yahoo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4947: libpq PQntuples should return 64-bit number
Date: 2009-07-28 06:54:39
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      4947
Logged by:          Jim Michaels
Email address:      jmichae3(at)yahoo(dot)com
PostgreSQL version: 8.4.0
Operating system:   Win XP Pro Sp3
Description:        libpq PQntuples should return 64-bit number

I agree that 64-bit numbers are compiler-specific.  this can be overcome
with something like the following code:

although now I understand that the microsoft 2008 compiler implements
UINT128, UINT8, UINT64, UINT32, INT64 and the like, but the MINGW compiler
and BCC++5.5 do not necessarily implement them.

maybe with some #if defined(INT64) the following code could be made proper.
something common to all 32-bit microsoft compilers is the __int64 type.

I suggest using the qlong type.

#if !defined(TYPES_LIB_VERSION)
#define TYPES_LIB_VERSION "1.0"

typedef unsigned long dword;
typedef unsigned short word;
typedef unsigned char byte;

#if defined(__DJGPP__)
typedef unsigned long long qword;
typedef long long qlong;
#elif defined(__BORLANDC__)||defined(_MSC_VER) || defined(__MINGW32__)
#include <windows.h>

#if defined(__MINGW32__)
#include <basetsd.h>

#endif //DJGPP

/*these are kept down here below the #include windows.h on purpose.
__int64 is defined in basetsd.h in MINGW.
#if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__GNUC__)

#if !defined(DWORD)
typedef unsigned long DWORD;

#if !defined(WORD)
typedef unsigned short WORD;

#if !defined(BYTE)
typedef unsigned char BYTE;


#if defined(__MINGW32__)||defined(_MSC_VER)||defined(__BORLANDC__)

typedef unsigned __int64 qword;
typedef __int64 qlong;

#if !defined(QWORD)
typedef unsigned __int64 QWORD;

#elif defined(__DJGPP__)

#if !defined(QWORD)
typedef unsigned long long QWORD;

#endif /*MINGW32*/



pgsql-bugs by date

Next:From: fousDate: 2009-07-28 08:30:57
Subject: BUG #4948: getting error while vacuuming the database
Previous:From: Craig RingerDate: 2009-07-28 06:13:55
Subject: Re: BUG #4945: Parallel update(s) gone wild

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