Thread: Re: [pgsql-patches] pg_dump pretty_print
-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 Peter Eisentraut replied: > The harm here is that under undefined circumstances a dump file > will not be a proper and robust representation of the original > database, which would add significant confusion and potential for error. What "undefined circumstances" are we talking here? If there is a chance that pg_get_viewdef and company do not output a version that can be read again by the database because we simply changed the whitespace, that sounds like a serious bug to be fixed, not a reason to reject this optional flag. - -- Greg Sabino Mullane greg@turnstep.com PGP Key: 0x14964AC8 200701251003 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iD8DBQFFuXd2vJuQZxSWSsgRA9VDAJ9S1b+4DJomO3Bmij4wvida9wtgfgCeID16 qeoNrrehtTGIeJeL8T+mx9M= =VecV -----END PGP SIGNATURE-----
"Greg Sabino Mullane" <greg@turnstep.com> writes: > Peter Eisentraut replied: >> The harm here is that under undefined circumstances a dump file >> will not be a proper and robust representation of the original >> database, which would add significant confusion and potential for error. > What "undefined circumstances" are we talking here? If there is a chance > that pg_get_viewdef and company do not output a version that can be > read again by the database because we simply changed the whitespace, that > sounds like a serious bug to be fixed, not a reason to reject this > optional flag. The original definition of the prettyprint flag was that it'd produce a version that was nice to look at but not guaranteed to parse back exactly the same; in particular it might omit parentheses that perhaps were really needed to ensure the same parsing. (I think there might be some other issues too ... but whitespace is NOT one of them.) It's possible that the current prettyprint code is smart enough to never make such an error --- and then again it's possible that it isn't. Like Peter, I've not got much confidence in that code, and don't want to trust pg_dump's correctness to it. regards, tom lane
-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 Tom Lane wrote: > The original definition of the prettyprint flag was that it'd produce a > version that was nice to look at but not guaranteed to parse back > exactly the same; in particular it might omit parentheses that perhaps > were really needed to ensure the same parsing. (I think there might be > some other issues too ... but whitespace is NOT one of them.) It's > possible that the current prettyprint code is smart enough to never make > such an error --- and then again it's possible that it isn't. Like > Peter, I've not got much confidence in that code, and don't want to > trust pg_dump's correctness to it. Can we perhaps add to the TODO to get the pretty print functions audited and tested out? I'm sure people are already using the pretty print option today via psql so it seems like this should be a high priority. Plus of course I'd like to see it added to pg_dump once Peter, yourself, and others have more confidence in it working as one would expect. - -- Greg Sabino Mullane greg@turnstep.com PGP Key: 0x14964AC8 200701301509 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iD8DBQFFv6YcvJuQZxSWSsgRA1ujAKDqfH1lAUcba0ce8wBjN/PIRzfNxACgnVWf XnusK0UcywWnaBDF6KE/x4E= =WoFo -----END PGP SIGNATURE-----