pg_dump with postgis extension dumps rules separately

Started by Joe Conwayabout 13 years ago33 messageshackers
Jump to latest
#1Joe Conway
mail@joeconway.com

If I create a database and install postgis as an extension, and then run
pg_dump I get this:

[...]
CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;
[...]
CREATE RULE geometry_columns_delete AS ON DELETE TO geometry_columns DO
INSTEAD NOTHING;
[...]

Shouldn't that CREATE RULE be implicitly part of the CREATE EXTENSION?

If so, is this a pg_dump bug, PostGIS bug, or pilot error?

FWIW I see CREATE OR REPLACE RULE statements in the PostGIS extension
SQL script.

Thanks,

Joe

--
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Joe Conway (#1)
Re: pg_dump with postgis extension dumps rules separately

Joe Conway <mail@joeconway.com> writes:

Shouldn't that CREATE RULE be implicitly part of the CREATE EXTENSION?

Yes. It's a bug, been reported before, it's on my todo list. I have
arranged some time to care about it while in beta, I won't be able to
have at it before then…

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Joe Conway
mail@joeconway.com
In reply to: Dimitri Fontaine (#2)
Re: pg_dump with postgis extension dumps rules separately

On 04/08/2013 07:42 AM, Dimitri Fontaine wrote:

Joe Conway <mail@joeconway.com> writes:

Shouldn't that CREATE RULE be implicitly part of the CREATE EXTENSION?

Yes. It's a bug, been reported before, it's on my todo list. I have
arranged some time to care about it while in beta, I won't be able to
have at it before then…

OK, maybe I'll try to take a look in the meantime.

Did you have any comment on the other pg_dump patch (reviewed by Vibhor)?

Thanks,

Joe

--
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Joe Conway (#3)
Re: pg_dump with postgis extension dumps rules separately

Joe Conway <mail@joeconway.com> writes:

OK, maybe I'll try to take a look in the meantime.

That would be awesome :)

Did you have any comment on the other pg_dump patch (reviewed by Vibhor)?

This whole extension table filtering and dumping is more in Tom's realm,
so I guess that if you want to have another pair of eyes on your patch
before commit'ing it yourself, you will need him to have a look.

That said, I didn't spot anything obvious that I want to report myself,
so I would label it "ready for commiter".

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Joe Conway
mail@joeconway.com
In reply to: Dimitri Fontaine (#4)
Re: pg_dump with postgis extension dumps rules separately

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/08/2013 08:34 AM, Dimitri Fontaine wrote:

Joe Conway <mail@joeconway.com> writes:

OK, maybe I'll try to take a look in the meantime.

That would be awesome :)

Did you have any comment on the other pg_dump patch (reviewed by
Vibhor)?

This whole extension table filtering and dumping is more in Tom's
realm, so I guess that if you want to have another pair of eyes on
your patch before commit'ing it yourself, you will need him to have
a look.

That said, I didn't spot anything obvious that I want to report
myself, so I would label it "ready for commiter".

Committed back to 9.1

Joe

- --
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRetZfAAoJEDfy90M199hl8tAP/1CpNniKJIQeZgye3RBY1l6I
TrO+ZEfXoh5EWRkx6uxB1hUm0mMdKIgAWVHIxbFXSaFkB1NW8oX8l1kme9fsVIV2
9xWEviccg/9+iJ/+8xdTCAn8VD4FjcjkXSayjPowekMia28IwHzEA+dww9LWHzvA
TzFC5RAApdWlm9LYAp2O+9U81mbUkXkIokwuMfX9a2jlH7AxCInyo9HvgilWRlkQ
/XcFBuSLqFHOles3f9QFM7ra5uq4Da3niYUkto7GJcOeT/jyFcApgi0mLGx6akpe
807S2F2dkNOCiJeyGe/ZhYV0n6YP2dQMYwa7Lhb1eQswT7VTLEVmw22LuVUWQLOU
WZhHlX5YkiUqkDCXSaAMPCXM/dFdmQanVgmhv2IehL7ZnBbPM4/AL1+GftV6OHpS
k6eogOhVEWOVkfNZ70K144IUocxcPPwPUyo25ov8jJpMqcRuxv43o4/nAITln5Fe
CF2cY+rGTsxJJEzO2m5rXkrA9WuisPLJeS97EZE1XbbDA6CwX++O8yBvbt61NEr0
JvtnkfxnPmMvFIDH7NyVxNgUoT/jh7IbeqjEVA2l1jkWawuRAQg10Woycj0S1+7w
J0nO2T8PJrLsue+Un+NcwZH38iL12a1a1IHTTD8IW4VCF+JCPzf4ka2nHWY/bjX8
D49hPm+YZ97OeifObvfP
=2Jbv
-----END PGP SIGNATURE-----

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#6Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Joe Conway (#5)
Re: pg_dump with postgis extension dumps rules separately

Joe Conway <mail@joeconway.com> writes:

Committed back to 9.1

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#7Joe Conway
mail@joeconway.com
In reply to: Joe Conway (#1)
Re: pg_dump with postgis extension dumps rules separately

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/06/2013 04:49 PM, Joe Conway wrote:

If I create a database and install postgis as an extension, and
then run pg_dump I get this:

[...] CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;
[...] CREATE RULE geometry_columns_delete AS ON DELETE TO
geometry_columns DO INSTEAD NOTHING; [...]

Shouldn't that CREATE RULE be implicitly part of the CREATE
EXTENSION?

If so, is this a pg_dump bug, PostGIS bug, or pilot error?

FWIW I see CREATE OR REPLACE RULE statements in the PostGIS
extension SQL script.

The attached one-liner seems to do the trick. It should probably be
backpatched to 9.1. Remaining questions:

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

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

Thanks,

Joe

- --
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRpSi4AAoJEDfy90M199hlzn4P/j2tgs35b2Y3YoMJHIRDUYmK
uihsKybUYN1uYlS58Igv04lhqWk4MMFFzfwvztENP2SzVysMkA7QoP0BIKy/lF+b
CWwouTLkygnU/a9Mj8TTXMc4YINp4zHOK/XKZaong6zIwCGIXtXp9acl6m7wDI1v
S2FkeRB2dJXyC/Vxv0n9p5JfW75KG6DadJa4ZlcsBx7yV1cwnmePLhoDvsX5fPro
BlD4pFV+GgyW8d65kZxuzIQ/Wy44o0f97yDdeZKi4mzEYooakWzl5iZN5idEBQ3i
LDgjwrCPvod0t8sYGSMaz9qc/fPpWAt4sPkwC6QOCE0u7PJnbZ0oGEGb0JBFGPBc
nV/1sib9KXRfALEUknKYALBqnFhZsaGOTFV9yKhtvscqn/Hmk0mXyocVB9rihcO6
7ipgOgpeqFsS7IQMtiFBUIFPl2ARtD01NKIHbDIKFTQPfss6XXTgIBYmT8W0ldaT
f2jxCEN5SzdCq/G3rx5Z2Dlqau3WIfYiSmWyAG/I2UDBtr7/J7TOSKoJh1+3ntvT
Vxc9b+z8dEz3wE143JOhi1aCNCQ7ybI/K44EhkLjSR4hC6CQiCKlI4OP5gaFj8FJ
YhxTe4FscYTYZVVguBTOKxMzrI1caIt+3LEJ3C7GTkTrQnYc/oZL4v86XlbV24ro
V8IUaO0XFeam7oDxYOZw
=d/qa
-----END PGP SIGNATURE-----

Attachments:

fix-extension-ruledeps.00.difftext/x-patch; name=fix-extension-ruledeps.00.diffDownload+3-0
#8Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Joe Conway (#7)
Re: pg_dump with postgis extension dumps rules separately

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#9Andres Freund
andres@anarazel.de
In reply to: Dimitri Fontaine (#8)
Re: pg_dump with postgis extension dumps rules separately

On 2013-05-29 09:30:43 +0200, Dimitri Fontaine wrote:

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?

Couldn't ALTER EXTENSION ... ADD ...; be brought up to speed to support
this?

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#10Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Andres Freund (#9)
Re: pg_dump with postgis extension dumps rules separately

Andres Freund <andres@2ndquadrant.com> writes:

On 2013-05-29 09:30:43 +0200, Dimitri Fontaine wrote:

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?

Couldn't ALTER EXTENSION ... ADD ...; be brought up to speed to support
this?

I'll blame the Time Zone Difference Recovering. I felt like missing
something…

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#11Joe Conway
mail@joeconway.com
In reply to: Dimitri Fontaine (#10)
Re: pg_dump with postgis extension dumps rules separately

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/29/2013 05:52 AM, Dimitri Fontaine wrote:

Andres Freund <andres@2ndquadrant.com> writes:

On 2013-05-29 09:30:43 +0200, Dimitri Fontaine wrote:

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?

Couldn't ALTER EXTENSION ... ADD ...; be brought up to speed to
support this?

I'll blame the Time Zone Difference Recovering. I felt like
missing something…

Seems like the perfect idea, but is that something we would backpatch?

Joe

- --
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRphI+AAoJEDfy90M199hl4HgP/3LdS4YsE8IiwadEKxDZeBEP
ubtS4a2CwNrWwATpScK7H8BHQfB2Jd7uw5+HeXTbbSdmt2XFz/fCcQtaTuJRNwUw
8OHlqqS9mrgsKHgzE9+1wCUBfmpsldBaw7HetmNnacrQICVir0YXTbHfBewH/wAT
BQ+9qjLXom8gLgZ1rSysa/V4QEYdCMCSIsW/A55zkpAcvIfACmGxgzL9msoMiWxR
qdWIMd9Pop8yrAO/r3e64TG+48V18/U17mdhhPx3/svH9FP+Nee4N6t1AozNETUN
OHVJDCZmxa0k3mCj4lJud95qARDLa+1PZ+FMf5tk9+WVlUdT9tMh66RBKilmyaBk
WZReY3plRaK74xnDPo/M5a0PVu7SDaqQVWXArzorZLf5J3hL0LUE8EmkGXYZk860
WpUFOMVZqux96NmFhgNgOuNBCHQN3zztCGwgHA6Y26ajIQQnYs74XnNo/kGdje1h
A16dmxLWUEwthpPoU/DyRrObavIWI6OMMUDZ3TlQ0CK8KziLGgD2JV4uzXjyrm+w
xwNFbR5j6dFkolO32Z8v01JHH1iKCQhMo9TzTAP8w9oRPvYVxX7QbotCKV7+X0mu
uBmAB9y3EjiVvuHCkuDFw2tJ/u9/p9R0cbJYdEzNyOvG22/LL6/RaTgyjg6d+jZN
Mso43jWnjh2O6Cxy0v6N
=Mf13
-----END PGP SIGNATURE-----

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#12Andres Freund
andres@anarazel.de
In reply to: Joe Conway (#11)
Re: pg_dump with postgis extension dumps rules separately

On 2013-05-29 07:35:42 -0700, Joe Conway wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/29/2013 05:52 AM, Dimitri Fontaine wrote:

Andres Freund <andres@2ndquadrant.com> writes:

On 2013-05-29 09:30:43 +0200, Dimitri Fontaine wrote:

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?

Couldn't ALTER EXTENSION ... ADD ...; be brought up to speed to
support this?

I'll blame the Time Zone Difference Recovering. I felt like
missing something…

Seems like the perfect idea, but is that something we would backpatch?

Sounds better to me than manually fiddling with pg_depend... We can't
really drop and recreate the RULEs, there might be dependencies
preventing that.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#13Joe Conway
mail@joeconway.com
In reply to: Andres Freund (#12)
Re: pg_dump with postgis extension dumps rules separately

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/29/2013 07:43 AM, Andres Freund wrote:

On 2013-05-29 07:35:42 -0700, Joe Conway wrote:

On 05/29/2013 05:52 AM, Dimitri Fontaine wrote:

Andres Freund <andres@2ndquadrant.com> writes:

On 2013-05-29 09:30:43 +0200, Dimitri Fontaine wrote:

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?

Couldn't ALTER EXTENSION ... ADD ...; be brought up to speed
to support this?

I'll blame the Time Zone Difference Recovering. I felt like
missing something…

Seems like the perfect idea, but is that something we would
backpatch?

Sounds better to me than manually fiddling with pg_depend... We
can't really drop and recreate the RULEs, there might be
dependencies preventing that.

OK, simple enough. New patch attached. I still need to do some testing
to verify this does not break anything, but other than that, any
complaints (including the notion of backpatching this back to 9.1)?

Joe

- --
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRpoG2AAoJEDfy90M199hl3WYP/0xCtvVQKRwZ1hWS2xxVd7OU
PFHfkX7/fLvEWi/ubra8VXexfjxO9cERLBQ5dMxxflq8sh3YHhNGLwa4TOthBzoA
zmUUgS/d6EDt9ZipSlE+L9pV3r6gfZDfz0x5RRv3aIWxxW5yOXfp1umfL1l6AGpU
e9uasllNhwOoY/voie6Aj9gSdtFMtAejXBQGsnUpj+JCITZPkRzxMfDBwTmbIPtT
U4fiHzO3fbuwtoyvjZIdF6d1GJ8U0/oLGS4AFS9nq27GFTj1PlWjMgeEKku0Nqgx
s4jIYNH/uczw9+RM8R+WF+934IcWJ47jGxQLaaS6Oog9egcbFXdjpoMjLkcaYcNb
uR1RELh/C341QFHvJQjYiwBxfPwd9kAtGdfTp/wEGnhJ1TflbaVjrOqgoWvSn6Op
emTOFhaGoAvCS2lgPhMxy2YwToKqYpiYQ8oaQQlcitG2JZaBX9X6ewFNkx2HKOrU
bickTfzLaKggKC52AsOUY1zdJBJB8Tx+srZsIV3ipDOrdftzv4hFXpWo9il+NoLr
zu4//jFmZsZXN/Y7xafnBkDWGxVizLohGVIkgTwsuaUtCjYAWPJpg7my6y3IXHfd
NpaUvKgz430XTGwxem2ICLJmLeMhVOUVIQvsV4TVDRnR+db9rq9buu611iPKcsBz
30VxweOi2keQn8C+7I/1
=vij9
-----END PGP SIGNATURE-----

Attachments:

fix-extension-ruledeps.01.difftext/x-patch; name=fix-extension-ruledeps.01.diffDownload+14-11
#14Joe Conway
mail@joeconway.com
In reply to: Joe Conway (#13)
Re: pg_dump with postgis extension dumps rules separately

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/29/2013 03:31 PM, Joe Conway wrote:

On 05/29/2013 07:43 AM, Andres Freund wrote:

Couldn't ALTER EXTENSION ... ADD ...; be brought up to
speed to support this?

Sounds better to me than manually fiddling with pg_depend... We
can't really drop and recreate the RULEs, there might be
dependencies preventing that.

OK, simple enough. New patch attached. I still need to do some
testing to verify this does not break anything, but other than
that, any complaints (including the notion of backpatching this
back to 9.1)?

Here's a cleaned up version, which also includes documentation. I'll
commit back to 9.1 in a day or two unless there are any objections.

Joe

- --
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRpodyAAoJEDfy90M199hlpBoP/jOp/KlgZvAL2bOZarTW/Zba
2NMQP3VV3BO7NMO8PcX9xxwZa2zhfCxr2A0GT6IJXgqTDfBCBZLFVsNGPCxS1Yik
DfrhUWxNmyPEIvwVWNCgf2G9UkOcoVLU7ROn000EDly2Fhhi0NTvHWlFWhHaM2kY
64sgjV+b++/JWzWBZntnPZH2VScv9AxaJXqNFV32AADfNOGymc17lTBalnWUzYHE
E1xWn9rZWjM35zEvBpoUcyn3jcf1NryCZIP0HGD3Vn/sW0slltBiAjnjtskhC8iF
iBLcFGvR2jZK9vvry19gVnX5dHTSM71Lxp02+x1KEEMsbqma/VFdtakUSlJUeIWH
ou6ND7lQcriyethluAJ56A4vPyHxzCVjU3aghdQiTuli7lB/2I8GOklhitGz9C2W
/firBDExUd12Um2Fc2zwQzm3s+2Hj3VMR3SVQkbXVfdNAJVqw/QWSeKl3I2CqcJH
mTDNQ9Il8LiOpUUwl9YLEazEyEvlAbfodOl8weO8WBH9QXNm0FXIHdDZeUSSmgY7
7ZHP0IScCNRkF/wxSsWI5VjQtp3GGWeyqYhpuc62CJO8aUICBxeqpB40L11Mplsh
sO8btaIOnZnzKyZqM0fhhT3+y7KbkG59VzuwhXrTV0BvXR7K0McoIJfhI9az6mAf
B5y77JTZL7Ig4HS9IyZD
=Tr4H
-----END PGP SIGNATURE-----

Attachments:

fix-extension-ruledeps.02.difftext/x-patch; name=fix-extension-ruledeps.02.diffDownload+13-0
#15Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Joe Conway (#14)
Re: pg_dump with postgis extension dumps rules separately

Joe Conway <mail@joeconway.com> writes:

Here's a cleaned up version, which also includes documentation. I'll
commit back to 9.1 in a day or two unless there are any objections.

Looks good to me.

Were you able to test it against an extension containing both rules and
views, to check that pg_dump has no problem with the new set of
dependencies?

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#16Joe Conway
mail@joeconway.com
In reply to: Dimitri Fontaine (#15)
Re: pg_dump with postgis extension dumps rules separately

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/30/2013 02:02 AM, Dimitri Fontaine wrote:

Joe Conway <mail@joeconway.com> writes:

Here's a cleaned up version, which also includes documentation.
I'll commit back to 9.1 in a day or two unless there are any
objections.

Looks good to me.

Were you able to test it against an extension containing both rules
and views, to check that pg_dump has no problem with the new set
of dependencies?

PostGIS has both:

test=# \dv
List of relations
Schema | Name | Type | Owner
- --------+-------------------+------+----------
public | geography_columns | view | postgres
public | geometry_columns | view | postgres
public | raster_columns | view | postgres
public | raster_overviews | view | postgres
(4 rows)

select tablename, rulename from pg_rules ;
tablename | rulename
- ------------------+-------------------------
pg_settings | pg_settings_n
pg_settings | pg_settings_u
geometry_columns | geometry_columns_delete
geometry_columns | geometry_columns_update
geometry_columns | geometry_columns_insert
(5 rows)

8<----------------
# pg_dump test > /tmp/test-01.dmp
# dropdb test
# createdb test
# psql test < /tmp/test-01.dmp
SET
SET
SET
SET
SET
SET
CREATE EXTENSION
COMMENT
CREATE EXTENSION
COMMENT
SET
REVOKE
REVOKE
GRANT
GRANT
# pg_dump test > /tmp/test-02.dmp
# diff /tmp/test-01.dmp /tmp/test-02.dmp
...<no differences>...
8<----------------

Joe

- --
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRp1ykAAoJEDfy90M199hlLQcP/1OkpFeb99EO9xca0RD+WIHS
FrqhBEJDHA4ujODvitZRMTFjpS1WH4Difm7P05Lvbr1xEUmwuSD6oBw/VQ1p6cxs
RyIvUM1uLVhR/nwjMeymner9kOINPu4rBVKf+7EgPJQcFvZuUSzafNGH1l70p6wk
dXMA2ggjjFdvF6voVxaKkHFbs+uttURNDZ2l0f6eb4QJRZta+NuFCOtIkPTqBESx
oABWuoAutAEX0Z7b0iEyNjjDLduPzjMIqQm8Y6NfsGmkEYd2jrpYVl04T8hcbqf0
vFJ2NvblvuaHoRIhq/ZYbFt9dQKIdoUtNuzR8MOK474mD/VrX6v/xquGh1rcmL4x
1k94Lis3Cf/QEBUEqwKNribkOLemaxEEDVnVTCWSC59FoDbaAZuiwtYspHYwAQED
D3nZ9jknEr+Bziqw6y8KP3wQGAbyssIKdtXFlw2u1BFeFjuWK5pL8vR3vi08j/Ij
diycCOBLotJGlkaHEt7vCNMTbHlIru4d4yblh0hbB6wL6JvI2HbGlK5chPPqIu+O
zHpPGUuTy7lgi+0809k5ceoqYUDJJTo0yu/3BuvLeaZwJqfS9QBIjCdryb/0MCVn
QJ6u3r54aSz4FQHP8iDoDnfbZIAdpCtjlqiTxLARxxYZqWt9nHoW0bC9fZpTkBfT
YxJX5C74NCVHE2Qdqnqx
=fbuL
-----END PGP SIGNATURE-----

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#17Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Joe Conway (#16)
Re: pg_dump with postgis extension dumps rules separately

Joe Conway <mail@joeconway.com> writes:

Were you able to test it against an extension containing both rules
and views, to check that pg_dump has no problem with the new set
of dependencies?

PostGIS has both:

[...]

# pg_dump test > /tmp/test-02.dmp
# diff /tmp/test-01.dmp /tmp/test-02.dmp
...<no differences>...

Perfect, thanks!

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#18Robert Haas
robertmhaas@gmail.com
In reply to: Joe Conway (#14)
Re: pg_dump with postgis extension dumps rules separately

On Wed, May 29, 2013 at 6:55 PM, Joe Conway <mail@joeconway.com> wrote:

OK, simple enough. New patch attached. I still need to do some
testing to verify this does not break anything, but other than
that, any complaints (including the notion of backpatching this
back to 9.1)?

Here's a cleaned up version, which also includes documentation. I'll
commit back to 9.1 in a day or two unless there are any objections.

Changing SQL syntax in the back-branches isn't normally something we
do, but I confess I don't see any real reason not to do it in this
case.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#19Joe Conway
mail@joeconway.com
In reply to: Robert Haas (#18)
Re: pg_dump with postgis extension dumps rules separately

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/31/2013 08:46 PM, Robert Haas wrote:

On Wed, May 29, 2013 at 6:55 PM, Joe Conway <mail@joeconway.com>
wrote:

OK, simple enough. New patch attached. I still need to do some
testing to verify this does not break anything, but other than
that, any complaints (including the notion of backpatching
this back to 9.1)?

Here's a cleaned up version, which also includes documentation.
I'll commit back to 9.1 in a day or two unless there are any
objections.

Changing SQL syntax in the back-branches isn't normally something
we do, but I confess I don't see any real reason not to do it in
this case.

That was part of my hesitation, but I don't see any better way to fix
existing installations and this is pretty well self-contained. Any
other opinions out there?

Joe

- --
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRqgvcAAoJEDfy90M199hlmG0P/0LmkNBvMrMqASA4zyhtKGTG
3Wd+/wC2cHPrfVqFmEKsuCStWTiQxzdcNGgPBfzdg5QskB8xcAr81ggH3mW5ldHE
Gnz9ZJ6LaAWeqAg0IjIir2spQmZbNfPc9BY+vnTQAoSPmJwoXgFLnJSdW8+5JrLR
qwrRv3f6jJzYPXYdSXu91fDCwNi7mZmcqjJRtjO58xI+hcrNsKMjGnloryeifrVP
N1ZI2vrPiwUBmKR01RTjjfTjCA1iBxwABLbzknO4hNchE7l8ghcXmE/K5Zkaj8E4
QXQk/dx5EzXlKtOqBpKh2QpZZDoKD1NAR9u+SSsbjjdgzXM+L3SkslvlisbCEbrH
HwYys2honEk38SzxeDeqpmLBDmEqccfuq/VIqe82szbusn58kmq7RbU/veScIwkA
5eAOzi+YbbaK1ThS2CZKrt9DqhUgaIhj66X7+bmhusPxG1cQyGnV8Tetol50Hyo4
6unkqiQhr4qfXwDtrUDDtdBxTiFWsIwXCe3zytp9J6HStHN1OjGfjDM8Mu71wwiH
44PqYnugaJff7I6fLC+qDWX5VD5i+7gSm8/Q7awt1hk7L5gLsFU6qQmJVkpY2HJs
RQ3G2aoB2pKyvnbeYvFb9Ny1LH2I8gnUW0vXZ69T7ecvRLm4IC4wmFc3SGmUXP+x
xbRWb6LW+RXPhsZYooKQ
=RP/c
-----END PGP SIGNATURE-----

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#20Tom Lane
tgl@sss.pgh.pa.us
In reply to: Joe Conway (#19)
Re: pg_dump with postgis extension dumps rules separately

Joe Conway <mail@joeconway.com> writes:

On 05/31/2013 08:46 PM, Robert Haas wrote:

Changing SQL syntax in the back-branches isn't normally something
we do, but I confess I don't see any real reason not to do it in
this case.

That was part of my hesitation, but I don't see any better way to fix
existing installations and this is pretty well self-contained. Any
other opinions out there?

I don't like this approach much.

1. It does nothing to fix the issue in *existing* databases, which
won't have pg_depend entries like this.

2. In general, we have assumed that properties of tables, such as
indexes and constraints, cannot be independent members of extensions.
It's not clear to me why rules should be different.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#21Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#20)
#22Joe Conway
mail@joeconway.com
In reply to: Tom Lane (#20)
#23Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#21)
#24Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#23)
#25Joe Conway
mail@joeconway.com
In reply to: Andres Freund (#24)
#26Tom Lane
tgl@sss.pgh.pa.us
In reply to: Joe Conway (#22)
#27Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#26)
#28Joe Conway
mail@joeconway.com
In reply to: Tom Lane (#27)
#29Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Tom Lane (#27)
#30Joe Conway
mail@joeconway.com
In reply to: Dimitri Fontaine (#29)
#31Tom Lane
tgl@sss.pgh.pa.us
In reply to: Joe Conway (#30)
#32Joe Conway
mail@joeconway.com
In reply to: Tom Lane (#31)
#33Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Joe Conway (#32)