Lists: | pgsql-hackers |
---|
From: | Enrico Pirozzi <sscotty71(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | A little pg_dump patch |
Date: | 2011-09-19 14:34:39 |
Message-ID: | CAEe=WwW2ZfWgQHF1ohN5M58qiy8mV2ok+GTzQdwhbFqhdxkoYQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hi, I'm Enrico,
I wrote a little pg_dump patch,
I have introduced a new option to have a database dump without comments,
no 'COMMENT ON' are written on the dump if my new option is selected.
If this little piece of code can interest somebody, I'll be happy to
share it with the community,
Regards,
Enrico
--
That's one small step for man; one giant leap for mankind
Enrico Pirozzi
Tel. +39 0861 1855771
Mob.+39 328 4164437
Fax +39 0861 1850310
www.enricopirozzi.info
info(at)enricopirozzi(dot)info
Skype sscotty71
Gtalk sscotty71(at)gmail(dot)com
From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | info(at)enricopirozzi(dot)info |
Cc: | Enrico Pirozzi <sscotty71(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: A little pg_dump patch |
Date: | 2011-09-19 15:07:30 |
Message-ID: | 4E775AB2.8030408@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On 09/19/2011 10:34 AM, Enrico Pirozzi wrote:
> Hi, I'm Enrico,
> I wrote a little pg_dump patch,
> I have introduced a new option to have a database dump without comments,
> no 'COMMENT ON' are written on the dump if my new option is selected.
>
> If this little piece of code can interest somebody, I'll be happy to
> share it with the community,
>
>
We had a recent discussion about filtering items in pg_dump /
pg_restore. My personal feeling is that we should provide filtering of
table data ion pg_dump, and pre-data and post-data sections in both, all
of which we know there are good and widespread use cases for, but beyond
that users should filter using pg_dump -F c and pg_restore --use-list.
If we try to build in every kind of filter any user might want we'll
just become horribly bloated.
What's the use case for not dumping comments? At first glance it seems a
very odd thing to do.
cheers
andrew
From: | Enrico Pirozzi <sscotty71(at)gmail(dot)com> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: A little pg_dump patch |
Date: | 2011-09-19 15:23:35 |
Message-ID: | CAEe=WwV9eBv_N8Xh9oAhfr8wnaoHrCiPtJMXHUuE=MrCgMp99A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
> What's the use case for not dumping comments? At first glance it seems a
> very odd thing to do.
>
> cheers
>
> andrew
I wrote this little patch, becuse my customer doesn't want to have
comments on the production db. It's not my choice
Regards,
Enrico
--
That's one small step for man; one giant leap for mankind
Enrico Pirozzi
Tel. +39 0861 1855771
Mob.+39 328 4164437
Fax +39 0861 1850310
www.enricopirozzi.info
info(at)enricopirozzi(dot)info
Skype sscotty71
Gtalk sscotty71(at)gmail(dot)com
From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | info(at)enricopirozzi(dot)info |
Cc: | Enrico Pirozzi <sscotty71(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: A little pg_dump patch |
Date: | 2011-09-19 15:32:33 |
Message-ID: | 4E776091.1090000@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On 09/19/2011 11:23 AM, Enrico Pirozzi wrote:
>> What's the use case for not dumping comments? At first glance it seems a
>> very odd thing to do.
>>
>>
> I wrote this little patch, becuse my customer doesn't want to have
> comments on the production db. It's not my choice
>
>
Then use pg_restore --use-list to filter them out, and you won't need a
single line of C code to achieve your goal. The --use-list option gives
you very fine grained control over what gets restoresd and what does
not. Patching pg_dump like this seems like the wrong way to go.
cheers
andrew
From: | Enrico Pirozzi <sscotty71(at)gmail(dot)com> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: A little pg_dump patch |
Date: | 2011-09-19 15:42:44 |
Message-ID: | CAEe=WwWh11PpzbVQO3WKu8PVW7HNgz+VxwZS8dA4TU_9GQBQjA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
> Patching pg_dump like this seems like the wrong way to go.
Ok ;)
Thank you very much
Enrico
--
That's one small step for man; one giant leap for mankind
From: | "Greg Sabino Mullane" <greg(at)turnstep(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: A little pg_dump patch |
Date: | 2011-09-19 15:44:13 |
Message-ID: | 1d07ac99930ec8d28100d033fa39c66d@biglumber.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
>> I wrote this little patch, becuse my customer doesn't want to have
>> comments on the production db. It's not my choice
>
> Then use pg_restore --use-list to filter them out, and you won't need a
Or just strip them out after the fact with a little bit of SQL, e.g.
DELETE FROM pg_description WHERE objoid > 50000;
(test first, your system may vary and 50000 may not work)
- --
Greg Sabino Mullane greg(at)turnstep(dot)com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201109191143
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----
iEYEAREDAAYFAk53YzsACgkQvJuQZxSWSsgA0wCguiURJI4Hneu7Dn+vBtcEOLsR
/OcAn35ujJCWhf2tM3a1J2yek0uddF1X
=wc3x
-----END PGP SIGNATURE-----
From: | Enrico Pirozzi <sscotty71(at)gmail(dot)com> |
---|---|
To: | Greg Sabino Mullane <greg(at)turnstep(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: A little pg_dump patch |
Date: | 2011-09-19 15:57:09 |
Message-ID: | CAEe=WwU9Qtd4DQ4J4JA3F-iDFAaWEe-=oLQuAkZKB+k38AWrhg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Ok, but with this hack I need 2 databases, one with comments and
another without comments.
I prefer to have only one db with comments and choice to have a dump
with comments or without comments.
regards,
Enrico
2011/9/19 Greg Sabino Mullane <greg(at)turnstep(dot)com>:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
>
>
>>> I wrote this little patch, becuse my customer doesn't want to have
>>> comments on the production db. It's not my choice
>>
>> Then use pg_restore --use-list to filter them out, and you won't need a
>
> Or just strip them out after the fact with a little bit of SQL, e.g.
>
> DELETE FROM pg_description WHERE objoid > 50000;
>
> (test first, your system may vary and 50000 may not work)
>
> - --
> Greg Sabino Mullane greg(at)turnstep(dot)com
> End Point Corporation http://www.endpoint.com/
> PGP Key: 0x14964AC8 201109191143
> http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
> -----BEGIN PGP SIGNATURE-----
>
> iEYEAREDAAYFAk53YzsACgkQvJuQZxSWSsgA0wCguiURJI4Hneu7Dn+vBtcEOLsR
> /OcAn35ujJCWhf2tM3a1J2yek0uddF1X
> =wc3x
> -----END PGP SIGNATURE-----
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
--
That's one small step for man; one giant leap for mankind