Re: Custom integer-like type - Mailing list pgsql-general

From Tom Lane
Subject Re: Custom integer-like type
Date
Msg-id 14978.1347638262@sss.pgh.pa.us
Whole thread Raw
In response to Custom integer-like type  (Ivan Voras <ivoras@freebsd.org>)
List pgsql-general
Ivan Voras <ivoras@freebsd.org> writes:
> 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)

What you'd need for that is an assignment cast from integer to myint.
Literal 1 is an integer, period; it's not going to get fed to your
type's input routine.

            regards, tom lane


pgsql-general by date:

Previous
From: Ivan Voras
Date:
Subject: Custom integer-like type
Next
From: "Ing.Edmundo.Robles.Lopez"
Date:
Subject: OFFTOPIC: core dumped with strcpy,atoi,sprintf.