| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Ivan Voras <ivoras(at)freebsd(dot)org> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Custom integer-like type |
| Date: | 2012-09-14 15:57:42 |
| Message-ID: | 14978.1347638262@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Ivan Voras <ivoras(at)freebsd(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ing.Edmundo.Robles.Lopez | 2012-09-14 16:14:56 | OFFTOPIC: core dumped with strcpy,atoi,sprintf. |
| Previous Message | Ivan Voras | 2012-09-14 15:20:11 | Custom integer-like type |