Re: jsonb and nested hstore

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Josh Berkus <josh(at)agliodbs(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>, Christophe Pettus <xof(at)thebuild(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb and nested hstore
Date: 2014-03-05 15:24:40
Message-ID: 3123.1394033080@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> On 03/05/2014 09:39 AM, Bruce Momjian wrote:
>> So, I am going to ask a back-track question and ask why we can't move
>> hstore into core. Is this a problem with the oids of the hstore data
>> type and functions? Is this a pg_upgrade-only problem? Can this be
>> fixed?

> Yes, pg_upgrade is the problem, and no, I can't see how it can be fixed.

> Builtin types have Oids in a certain range. Non-builtin types have Oids
> outside that range. If you have a clever way to get over that I'd be all
> ears, but it seems to me insurmountable right now.

More to the point:

1. Built-in types have predetermined, fixed OIDs. Types made by
extensions do not, and almost certainly will have different OIDs in
different existing databases.

2. There's no easy way to change the OID of an existing type during
pg_upgrade, because it may be on-disk in (at least) array headers.

We could possibly get around #2, if we could think of a secure way
for array_out and sibling functions to identify the array type
without use of the embedded OID value. I don't know how we could
do that though, particularly in polymorphic-function contexts.

Also, there might be other cases besides arrays where we've embedded
type OIDs in on-disk data; anyone remember?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2014-03-05 15:26:52 Re: jsonb and nested hstore
Previous Message Alvaro Herrera 2014-03-05 15:22:04 Re: Fwd: patch: make_timestamp function