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

8.3devel BUG with Cash send and recv

From: Andrew Chernow <ac(at)esilo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>
Subject: 8.3devel BUG with Cash send and recv
Date: 2007-08-19 20:10:09
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
There is what looks like a bug in 8.3devel.  When getting the money type in 
binary format from a libpq client, the below error is thrown from the backend:

ERROR:  unsupported integer size 8

It appears that the Cash typedef, defined in include/utils/cash.h, has changed 
to an int64 (previously an int32).  The cash_send and cash_recv functions, in 
backend/utils/adt/cash.c, are still calling pq_sendint and pq_getmsgint.

I tested on an 8.2rc box and that did not suffer from this issue because it uses 
a 32-bit Cash type.

Below is a test to reproduce the issue.

create table money_test (amount money);
insert into money_test values ('13.85');

/* libpq test code (breaks on 8.3devel, works on 8.2rc) */
#include <libpq-fe.h>
#include <stdio.h>

int main(void)
   PGresult *res;
   PGconn *conn = PQconnectdb("hostaddr=  user=postgres");

   if(PQstatus(conn) != CONNECTION_OK)
     printf("connection failure\n");
     return 1;

   res = PQexecParams(
     "SELECT amount FROM money_test LIMIT 1",
     (const Oid *)NULL,
     (const char * const *)NULL,
     (const int *)NULL,
     (const int *)NULL,
     1); /* binary */

   printf("tuples=%d, err=%s, res_err=%s\n",

   return 0;


pgsql-bugs by date

Next:From: Hiroshi SaitoDate: 2007-08-20 01:39:35
Subject: Re: reindexdb in Windows
Previous:From: Ruediger KemmlerDate: 2007-08-19 19:51:05
Subject: BUG #3556: Installroutine hides destination folder

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