Re: Fixed length data types issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixed length data types issue
Date: 2006-09-05 15:02:41
Message-ID: 24757.1157468561@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark <stark(at)enterprisedb(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2006-09-05 15:14:12 Re: Open items for 8.2
Previous Message Andrew Sullivan 2006-09-05 14:58:40 Re: integration of pgcluster into postgresql