From: Tom Lane <tgl@sss.pgh.pa.us>
To: Luca Ferrari <fluca1978@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: help defining a basic type operator
Date: Mon, 20 Aug 2018 10:51:45 -0400
Message-ID: <19616.1534776705@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKoxK+6huo++-LL50d-5qvST94cFKpNR4_qZnEqDYZfbvbXBPQ@mail.gmail.com>
References: <CAKoxK+6huo++-LL50d-5qvST94cFKpNR4_qZnEqDYZfbvbXBPQ@mail.gmail.com>
Luca Ferrari <fluca1978@gmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, fluca1978@gmail.com
Subject: Re: help defining a basic type operator
In-Reply-To: <19616.1534776705@sss.pgh.pa.us>
References: <CAKoxK+6huo++-LL50d-5qvST94cFKpNR4_qZnEqDYZfbvbXBPQ@mail.gmail.com> <19616.1534776705@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox