Re: Custom Data Type Question

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: "Greg Mitchell" <gmitchell(at)atdesk(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Custom Data Type Question
Date: 2006-11-18 14:31:12
Message-ID: 1163860272.27956.811.camel@silverbirch.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2006-11-15 at 16:38 -0500, Andrew Dunstan wrote:

> My little enumkit tool allows you to create enumerations today very
> easily, but its values are completely hardcoded. However, the above
> trick still works. The downside is that each enumeration type requires a
> tiny bit of compilation.

Andrew,

Your enum sounds good, apart from the hardcoded/compilation thing. That
is a data management nightmare AFAICS and so restricts the usefulness of
the solution.

It would be much better to read things dynamically into an array, so
using an init function in *preload_libraries would work well.

I'd also love any suggestions as to how we might be able to use a
similar local-data-cacheing mechanism to work when we specify SQL
standard FOREIGN KEYs. It would be really cool to say USING LOCAL CACHE
or some way of avoiding the overhead of all those stored after triggers
and SPI SELECT statements when we've got checks against tables with only
a few rows where the values hardly ever change. The enum concept departs
radically from the declarative Referential Integrity concepts that many
of us are already used to. I'd like to be able to speed things up
without radical re-design of the database... so a few nicely sprinked
ALTER TABLE statements would be a much better way of implementing this
IMHO.

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Harris 2006-11-18 14:35:39 Re: [GENERAL] Shutting down a warm standby database in 8.2beta3
Previous Message jorge alberto 2006-11-18 13:02:49 Fwd: Remove contrib version of rtree_gist --- now in core system ?