Re: Review: create extension default_full_version

From: Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>
To: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Review: create extension default_full_version
Date: 2012-12-11 15:07:18
Message-ID: CALtqXTcxV8KUFH-NhvU6VUR+PNwc3VAjfP9M0JKyzUu5hD5AJQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Now it works in most of the cases, here is one more point about the patch.

* In case we have hstore--1.3.sql file and want to install that file, but
failed because of default_full_version.

No default_full_version specified
-----------------------------------------------
postgres=# CREATE EXTENSION hstore version '1.3';
CREATE EXTENSION

default_full_version = 1.2
------------------------------------
postgres=# CREATE EXTENSION hstore version '1.3';
ERROR: could not stat file
"/usr/local/pgsql/share/extension/hstore--1.2.sql": No such file or
directory

If we don't want to address this issue at least we should give some
meaningful error message.

On Tue, Dec 4, 2012 at 4:46 PM, Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com> wrote:

>
>
> On Tue, Dec 4, 2012 at 7:54 PM, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>wrote:
>
>> Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com> writes:
>> > I am still getting the same error message.
>>
>> With the attached patch (v2), it works well:
>>
>> create extension hstore version '1.2' from 'unpackaged';
>> DEBUG: execute_extension_script:
>> '/Users/dim/pgsql/ddl/share/extension/hstore--unpackaged--1.0.sql'
>> DEBUG: execute_extension_script:
>> '/Users/dim/pgsql/ddl/share/extension/hstore--1.0--1.1.sql'
>> DEBUG: execute_extension_script:
>> '/Users/dim/pgsql/ddl/share/extension/hstore--1.1--1.2.sql'
>> CREATE EXTENSION
>>
>> You have to remember that the spelling FROM 'unpackaged version' really
>> means that we have previously installed a "loose" version of the
>> extension (just \i hstore.sql) and want to apply the upgrade path from
>> there.
>>
>> We can't have FROM meaning the same thing as default_full_version.
>>
>>
> I know.
>
>
>
>> > With default_full_version = '1.1'
>> > --------------------------------------------
>> > postgres=# CREATE EXTENSION hstore version '1.3' from '1.1';
>> > DEBUG: execute_extension_script:
>> > '/usr/local/pgsql/share/extension/hstore--1.1.sql'
>> > DEBUG: execute_extension_script:
>> > '/usr/local/pgsql/share/extension/hstore--1.1--1.3.sql'
>> > *ERROR: could not stat file
>> > "/usr/local/pgsql/share/extension/hstore--1.1--1.3.sql": No such file or
>> > directory*
>>
>> That's nonetheless a bug and is fixed now:
>>
>> - if (pcontrol->default_full_version)
>> + if (pcontrol->default_full_version && !unpackaged)
>>
>>
>> Thanks, I will look at this again in detail.
>
>
>
>> See attached.
>>
>> Regards,
>> --
>> Dimitri Fontaine
>> http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support
>>
>>
>
>
> --
> Ibrar Ahmed
> EnterpriseDB http://www.enterprisedb.com
>
>
>

--
Ibrar Ahmed
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2012-12-11 15:09:05 Re: allowing multiple PQclear() calls
Previous Message Bruce Momjian 2012-12-11 15:06:50 Re: [WIP] pg_ping utility