Skip site navigation (1) Skip section navigation (2)

Re: [9.1] 2 bugs with extensions

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Marko Kreen <markokr(at)gmail(dot)com>
Cc: Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [9.1] 2 bugs with extensions
Date: 2012-09-26 16:15:42
Message-ID: m2txukzro1.fsf@2ndQuadrant.fr (view raw or flat)
Thread:
Lists: pgsql-hackers
Marko Kreen <markokr(at)gmail(dot)com> writes:
>> Can we work out a minimal example to reproduce the bug?
>
> Yes, the above text or sql/pgq_coop/sql/pgq_coop_init_ext.sql
>
> I guess you could replace pgq_coop with any extension just
> consisting of just functions.

I did just that, with a single function, and couldn't reproduce the
problem either in 9.1 nor in master, with relocatable = true then with
relocatable = false and schema = 'pg_catalog' as in your repository.

The extension has those files contents:

  Makefile
    EXTENSION = extschema
    DATA = extschema--unpackaged--1.0.sql extschema.sql extschema--1.0.sql
    
    PG_CONFIG = pg_config
    PGXS := $(shell $(PG_CONFIG) --pgxs)
    include $(PGXS)

  extschema.control
    # extschema extension
    comment = 'debug extension schema handling'
    default_version = '1.0'
    relocatable = false
    schema = 'pg_catalog'

  extschema.sql
    create schema ext;
    create or replace function ext.extschema() returns int language sql
    as $$ select 1; $$;

  extschema--unpackaged--1.0.sql
    alter extension extschema add schema ext;
    alter extension extschema add function ext.extschema();

  extschema--1.0.sql
    create schema ext;
    create or replace function ext.extschema() returns int language sql
    as $$ select 1; $$;

So I guess that needs some more work to reproduce the bug.

>> (The Makefile in skytools/sql/pgq_coop fails on my OS)
>
> How does it fail?  Are you using gnu make?  What version?

I guess sed is the problem here, it's a BSD variant:

  dim ~/skytools/sql/pgq_coop make pgq_coop--unpackaged--3.1.sql
  sed: 1: "/^\\/{s/\\i //;p}\n": extra characters at the end of p command
  sed: 1: "/^\\/{s/\\i //;p}\n": extra characters at the end of p command
  sed: 1: "/^\\/{s/\\i //;p}\n": extra characters at the end of p command
  cat pgq_coop.upgrade.sql > pgq_coop--unpackaged--3.1.sql

  sed --version  
  sed: illegal option -- -
  usage: sed script [-Ealn] [-i extension] [file ...]
         sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
    
Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2012-09-26 16:29:17
Subject: Re: autovacuum stress-testing our system
Previous:From: Jeff JanesDate: 2012-09-26 16:14:15
Subject: Re: autovacuum stress-testing our system

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group