Re: [GENERAL] A real currency type

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] A real currency type
Date: 2006-03-21 22:44:22
Message-ID: 20060321224422.GK11045@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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(at)svana(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2006-03-21 22:47:58 Re: index scan backward plan question
Previous Message Devrim GUNDUZ 2006-03-21 22:43:57 Re: Postgresql won't run after upgrade to fc5

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-03-21 22:47:00 Re: Automatically setting work_mem
Previous Message Craig A. James 2006-03-21 22:40:17 Poor performance o