Re: Typing Records

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Typing Records
Date: 2010-08-24 15:47:32
Message-ID: AANLkTik1HQf6HHZ_cGAtMVbiKaF0vEiCpxdAL7BX=DBF@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 24, 2010 at 11:32 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I think it wouldn't take too much code to defend against this in
> transformArrayExpr, but I'm a tad worried about whether there are
> similar cases elsewhere.  The generic problem is that we suppose that
> different values are compatible if they have the same type OID, but
> for RECORD types that's really not true.

We've argued about this before: it's not really true for array types
either. A one-dimensional array is not the same type as a
two-dimensional array, but we treat it that way because bloating
pg_type by a factor of seven is even less appealing than bloating it
by a factor of two. And then there are other kinds of types people
might want to define: hashes, sets, functions, etc. This shoe is
going to rub for so long as we keep wearing it.

Nevertheless, there's not much hope of better than a localized fix for
this particular bug.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2010-08-24 16:02:03 Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Previous Message Andres Freund 2010-08-24 15:39:54 Re: EXPLAIN doesn't show the actual function expression for FunctionScan