Re: VARIANT / ANYTYPE datatype

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Joseph Adams <joeyadams3(dot)14159(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VARIANT / ANYTYPE datatype
Date: 2011-05-11 11:53:47
Message-ID: BANLkTikoj2eCqtcoz0uaWVX3hg7rQSJO2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 10, 2011 at 10:29 PM, Joseph Adams
<joeyadams3(dot)14159(at)gmail(dot)com> wrote:
> It seems to me a reasonable way to implement VARIANT would be to have
> a data type called VARIANT that stores an OID of the inner type at the
> beginning, followed by the binary data.

That's likely to be how it gets implemented, but you seem to have
missed the point of some of the discussion upthread: the big problem
with that is that someone might type "DROP TYPE foo", and when they
do, you need an efficient way to figure out whether foo is in use
inside an instance of the variant type anywhere in the system. The
devil is in the details...

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yeb Havinga 2011-05-11 12:07:55 Patch to allow domains over composite types
Previous Message Heikki Linnakangas 2011-05-11 11:53:41 Re: time-delayed standbys