Re: pg_dump with postgis extension dumps rules separately - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: pg_dump with postgis extension dumps rules separately
Date
Msg-id m2txlm6y58.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: pg_dump with postgis extension dumps rules separately  (Joe Conway <mail@joeconway.com>)
Responses Re: pg_dump with postgis extension dumps rules separately  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Joe Conway <mail@joeconway.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



pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: [GENERAL] pg_upgrade -u
Next
From: Albe Laurenz
Date:
Subject: Re: GRANT role_name TO role_name ON database_name