Zu-Ming Jiang <zuming.jiang@inf.ethz.ch> writes:
> But I am bit wondering whether it is a bug. I think PostgreSQL should
> not directly crash because of a incorrect datatype. Maybe PostgreSQL can
> return an error?
It's not reasonable to expect the system to figure out the behavior
of C functions (see: halting problem). In the end this is why
creating base types is a superuser-only operation: it's possible
to crash the server with a wrong definition. I don't see any prospect
of making that meaningfully safer.
regards, tom lane