pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6640: pg_dump does not always dump data of tables marked as editable in extension
4+ messages / 4 participants
[nested] [flat]

* BUG #6640: pg_dump does not always dump data of tables marked as editable in extension
@ 2012-05-15 12:27  lr@pcorp.us
  0 siblings, 1 reply; 4+ messages in thread

From: lr@pcorp.us @ 2012-05-15 12:27 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      6640
Logged by:          Regina Obe
Email address:      lr@pcorp.us
PostgreSQL version: 9.1.3
Operating system:   Any
Description:        

This seems to be only an issue if a user individually chooses to backup a
table marked as editable in an extension, but works fine if full backup is
chosen.

The particular extension in question here is PostGIS.

Please refer to:
http://trac.osgeo.org/postgis/ticket/1815

for details.
In short -- if I do a full backup of a database, a table marked as editable
gets its data backed up as expected, but if I try to backup a schema the
table is in or the table itself, pg_dump does not dump anything.




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #6640: pg_dump does not always dump data of tables marked as editable in extension
@ 2012-05-20 17:27  Tom Lane <tgl@sss.pgh.pa.us>
  parent: lr@pcorp.us
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2012-05-20 17:27 UTC (permalink / raw)
  To: lr@pcorp.us; +Cc: pgsql-bugs

lr@pcorp.us writes:
> This seems to be only an issue if a user individually chooses to backup a
> table marked as editable in an extension, but works fine if full backup is
> chosen.

AFAICT this is a misunderstanding of the intended behavior of extension
configuration tables.  The data in them will be dumped when, and only when,
the extension itself is included in the dump.  Moreover, if you have a
mixture of extension-provided and user-provided data in the table, as
seems to be the case here, you really need to take measures to keep
those separate so that you can dump only the user-provided entries.
This is not a "fire and forget" type of feature, it requires nontrivial
effort on the part of the extension author to make it useful.  Please
see
http://www.postgresql.org/docs/9.1/static/extend-extensions.html#AEN51978

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #6640: pg_dump does not always dump data of tables marked as editable in extension
@ 2012-05-20 17:53  Paragon Corporation <lr@pcorp.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Paragon Corporation @ 2012-05-20 17:53 UTC (permalink / raw)
  To: 'Tom Lane' <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs; 'Paul Ramsey' <pramsey@opengeo.org>; 'Mark Cave-Ayland' <mark.cave-ayland@ilande.co.uk>; 'strk' <strk@keybit.net>; 'Chris Hodgson' <chodgson@refractions.net>

Tom,

Okay understood.  We had planned to do something along this line of having a
where condition for the extension or putting the custom spatial_ref_sys in a
separate table but hand't decided which way to go. So that will take care of
the handling custom records issue.

So I guess the more major issue is a won't fix on both sides since a user
will not be able to backup custom records without backing up the whole
database. I don't see any option in 9.1 or 9.2 pg_dump to explicitly backup
an extension and even backing up the schema an extension is installed in
doesn't seem to do the trick. 

I would have expected backing up the schema an extension is installed in
would backup the extension.  Is that expected behavior that it doesn't?
 
Thanks,
Regina

> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us] 
> Sent: Sunday, May 20, 2012 1:28 PM
> To: lr@pcorp.us
> Cc: pgsql-bugs@postgresql.org
> Subject: Re: [BUGS] BUG #6640: pg_dump does not always dump 
> data of tables marked as editable in extension 
> 
> lr@pcorp.us writes:
> > This seems to be only an issue if a user individually chooses to 
> > backup a table marked as editable in an extension, but 
> works fine if 
> > full backup is chosen.
> 
> AFAICT this is a misunderstanding of the intended behavior of 
> extension configuration tables.  The data in them will be 
> dumped when, and only when, the extension itself is included 
> in the dump.  Moreover, if you have a mixture of 
> extension-provided and user-provided data in the table, as 
> seems to be the case here, you really need to take measures 
> to keep those separate so that you can dump only the 
> user-provided entries.
> This is not a "fire and forget" type of feature, it requires 
> nontrivial effort on the part of the extension author to make 
> it useful.  Please see
> http://www.postgresql.org/docs/9.1/static/extend-extensions.ht
ml#AEN51978
> 
> 			regards, tom lane
> 





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #6640: pg_dump does not always dump data of tables marked as editable in extension
@ 2012-05-22 20:06  Robert Haas <robertmhaas@gmail.com>
  parent: Paragon Corporation <lr@pcorp.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Robert Haas @ 2012-05-22 20:06 UTC (permalink / raw)
  To: Paragon Corporation <lr@pcorp.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs; Paul Ramsey <pramsey@opengeo.org>; Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>; strk <strk@keybit.net>; Chris Hodgson <chodgson@refractions.net>

On Sun, May 20, 2012 at 1:53 PM, Paragon Corporation <lr@pcorp.us> wrote:
> Okay understood.  We had planned to do something along this line of having a
> where condition for the extension or putting the custom spatial_ref_sys in a
> separate table but hand't decided which way to go. So that will take care of
> the handling custom records issue.
>
> So I guess the more major issue is a won't fix on both sides since a user
> will not be able to backup custom records without backing up the whole
> database. I don't see any option in 9.1 or 9.2 pg_dump to explicitly backup
> an extension and even backing up the schema an extension is installed in
> doesn't seem to do the trick.
>
> I would have expected backing up the schema an extension is installed in
> would backup the extension.  Is that expected behavior that it doesn't?

Extensions are not schema objects.

But it seems like maybe we need a pg_dump --extension=XYZ option.

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2012-05-22 20:06 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-05-15 12:27 BUG #6640: pg_dump does not always dump data of tables marked as editable in extension lr@pcorp.us
2012-05-20 17:27 ` Tom Lane <tgl@sss.pgh.pa.us>
2012-05-20 17:53   ` Paragon Corporation <lr@pcorp.us>
2012-05-22 20:06     ` Robert Haas <robertmhaas@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox