Re: pg_dump with postgis extension dumps rules separately

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump with postgis extension dumps rules separately
Date: 2013-05-29 07:30:43
Message-ID: m2txlm6y58.fsf@2ndQuadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joe Conway <mail(at)joeconway(dot)com> writes:
> The attached one-liner seems to do the trick. It should probably be
> backpatched to 9.1. Remaining questions:

Thanks for the patch (and testing, etc, that it entails)!

> 1) Are there other database object types, likely to be included in
> extension scripts, that are also lacking dependency records to
> their extension?

To be honest I'm quite surprised that we missed rules at all. I think
what happened is that for views we only track the pg_class entry they
have, and missed that you can still use rules in other contexts…

Thinking about it, what happens with your patch for an extension
providing views: I'd guess the RULE(s) are registered themselves as well
as the RULEs they build-on, and I don't know what to expect of the
pg_dump behavior in such case…

> 2) How should we handle already installed extensions, which will still
> lack dependency records after this bugfix?

I don't really see any other way here than providing an upgrade script
that will somehow re-attach those objects, either by directly messing
with pg_depends (that is, when there's a systematic way to get the OIDs
of the missing RULEs), or by maybe doing a drop/create on the RULEs?

Regards,
--
Dimitri Fontaine 06 63 07 10 78
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Albe Laurenz 2013-05-29 08:26:59 Re: GRANT role_name TO role_name ON database_name
Previous Message Daniel Farina 2013-05-29 06:04:16 Re: Planning incompatibilities for Postgres 10.0