Gregory Stark <[EMAIL PROTECTED]> writes: > So I'm thinking again about the problems with fixed length data types not > having typmod available when they would need it. But I'm having trouble > finding enough old posts to get a handle on exactly what the problem is.
The problem is it isn't available ;-) AFAIR the only context where datatype-specific functions *do* get passed typmod is in the invocation of a datatype input function or length coercion function. And in those contexts the semantics are really "convert the input to match this typmod", not "this typmod describes what you've been passed". The basic rule here is that you have to be able to find out everything you need to know about a given instance of a datatype just by looking at the Datum. If you try to rely on external data then you have the same security problems that we had to redesign output functions to get rid of: there's not sufficient guarantee that the external data actually matches the datum. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match