Re: Another swing at JSON - Mailing list pgsql-hackers

From Joseph Adams
Subject Re: Another swing at JSON
Date
Msg-id BANLkTi=6-vY5iCV8GyM_jzq7tG4i5sqS2g@mail.gmail.com
Whole thread Raw
In response to Re: Another swing at JSON  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Responses Re: Another swing at JSON
List pgsql-hackers
On Tue, Mar 29, 2011 at 10:26 AM, Dimitri Fontaine
<dimitri@2ndquadrant.fr> wrote:
> Joseph Adams <joeyadams3.14159@gmail.com> writes:
>> Done.  The new extension interface isn't exactly compatible with the
>> old, so I dropped support for PostgreSQL 8.4 from the module.  I
>> suppose I could maintain a back-ported json module separately.
>
> In fact it is, but there's some history hiding the fact.  I'm overdue to
> another doc patch on the matter, but it's quite simple.

Cool, thanks!  Attached is an updated patch for the module.  Backward
compatibility has been brought back, and the module has been tested on
PostgreSQL versions 8.4.0 and 9.1devel.

However, there are a couple minor caveats:

 * The last test, relocatable, fails (and should fail) on pre-9.1
because it's a test related to the new extension interface.
 * init.sql is rather hacky in how it caters to both the old extension
system and the new one:

  \set ECHO none
  SET client_min_messages = fatal;

  CREATE EXTENSION json;
  \i json--0.1.sql

  SET client_min_messages = warning;
  ...
  RESET client_min_messages;
  \set ECHO all

It would be nice if I could make a Makefile conditional that skips the
relocatable test and loads init-pre9.1.sql if the new extension
interface isn't available.  Is there a Makefile variable or something
I can use to do this?

Also, should uninstall_json.sql be named something else, like
json--uninstall--0.1.sql ?

Thanks,


Joey Adams

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Additional options for Sync Replication
Next
From: Simon Riggs
Date:
Subject: Re: Additional options for Sync Replication