Re: help defining a basic type operator

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Luca Ferrari <fluca1978(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: help defining a basic type operator
Date: 2018-08-20 14:51:45
Message-ID: 19616.1534776705@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Luca Ferrari <fluca1978(at)gmail(dot)com> writes:
> I'm trying to define a custom data type that would represent a number
> of bytes in a lossy human way.

You did not show us the SQL definition of the type. I don't see anything
obviously wrong in what you showed (other than hfsize_add not setting the
result's scaling), so the problem is somewhere else. Given this C
declaration, the type probably needs to be size 16, double alignment,
pass-by-reference; maybe you messed up part of that?

> HFSize *sum = new_HFSize();

What is new_HFSize?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ravi Krishna 2018-08-20 14:53:05
Previous Message Luca Ferrari 2018-08-20 14:40:21 help defining a basic type operator