Custom integer-like type

From: Ivan Voras <ivoras(at)freebsd(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Custom integer-like type
Date: 2012-09-14 15:20:11
Message-ID: k2vhva$1tg$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I'm creating a new data in C, and everything is proceeding well, except
that the data type should be parsed on input like an integer. Maybe it's
best if I explain it with an example:

Currently, I can do this:

INSERT INTO t(my_data_type) VALUES ('1')

but I cannot do this:

INSERT INTO t(my_data_type) VALUES (1)

My type is defined as:

CREATE TYPE myint (
internallength = variable,
input = encbigint_in,
output = encbigint_out,
alignment = int4,
storage = external
);

(The "variable" length is correct in this case.)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-09-14 15:57:42 Re: Custom integer-like type
Previous Message Steve Crawford 2012-09-14 14:34:02 Re: Need help in reclaiming disk space by deleting the selected records