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 14:36:38
Message-ID: m2d3183l6x.fsf@2ndQuadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

After much distractions I've at least been able to do something about
that bug report.

Marko Kreen <markokr(at)gmail(dot)com> writes:
> 1) Dumpable sequences are not supported - if sequence is tagged
> with pg_catalog.pg_extension_config_dump(), the pg_dump tries
> to run COPY on it.

I can only reproduce that in 9.1. I first tried in HEAD where pg_dump
will just entirely skip the sequence, which is not the right answer
either, but at least does not spit out that message.

> pg_dump: Error message from server: ERROR: cannot copy from sequence
> "batch_id_seq"
> pg_dump: The command was: COPY pgq.batch_id_seq TO stdout;

Please find attached a patch that fixes it in 9.1, in all classic
pg_dump, --data-only and --schema-only.

git diff --stat
src/bin/pg_dump/pg_dump.c | 68 +++++++++++++++++++++++++++++++++++---------
1 files changed, 54 insertions(+), 14 deletions(-)

Once that's ok for 9.1, I'll get to work on a fix for master, oh and
look at what the situation is in 9.2, which I guess is the same as in
master actually.

> 2) If there is schema with functions, but nothing else,
> create extension pgq_coop from 'unpackaged';
> drop extension pgq_coop;
> create extension pgq_coop;
> ERROR: schema "pgq_coop" already exists

From reading the scripts, it's not clear to me, but it appears that the
schema existed before the create from unpackaged then got added to the
extension by way of

ALTER EXTENSION pgq_coop ADD SCHEMA pgq_coop;

Is that true? Can we work out a minimal example to reproduce the bug?
(The Makefile in skytools/sql/pgq_coop fails on my OS)

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

Attachment Content-Type Size
fix-ext-sequence-config-dump.patch text/x-patch 5.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2012-09-26 14:38:23 Re: Oid registry
Previous Message Alvaro Herrera 2012-09-26 14:31:00 Re: htup header reorganization breaks many extension modules