On Tue, Mar 21, 2006 at 05:25:15PM -0500, Tom Lane wrote: > The dump should look the same as the commands originally used to create > the type, which is surely not going to happen with that "SELECT > create_tagged_type()" stuff barring pg_dump modifications. Otherwise > we are nailing down not one but two representations of this feature that > we'll have to support forevermore: what the users see and what's in > pg_dump scripts.
Well, I agree with you in principle there. However, when you install tsearch2 and do a pg_dump you don't get just a "\i tsearch.sql" out either (I did propose something like this once though). Now, tsearch2 isn't integrated either, so I guess that the difference. Let me put it this way: if this is to progress beyond just a contrib module, it needs to go all the way (special syntax, pg_dump, etc). I'm not sure if I'm that enamoured with it to want all that. > Now I happen to think that SELECT create_tagged_type() is a horrid kluge > anyway ;-) so I'm not proposing that pg_dump be changed to output that. > What we would need is to design a command syntax that we're actually > prepared to live with for the indefinite future, then implement it in > the backend and teach pg_dump about it. Ack. > What we *don't* want is a pg_dump representation that exposes > implementation details. I would classify both the backing table for a > tagged type's enum values, and the representation of its operators and > functions, as implementation details. One slight problem: the "backing table" is provided by the creator of the type. And in principle they could be altered once the type is created. So if the user creates a new tagged type, the pg_dump output is going to have to output the backing table in some form, if not COPY then something else. The only way to avoid that is if both the type and the backing table are included in the standard distribution and we forbid user changes. Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them.
signature.asc
Description: Digital signature