Re: Fixed length data types issue - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fixed length data types issue
Date
Msg-id 24757.1157468561@sss.pgh.pa.us
Whole thread Raw
In response to Fixed length data types issue  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> 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


pgsql-hackers by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: integration of pgcluster into postgresql
Next
From: Andrew Dunstan
Date:
Subject: Re: Open items for 8.2