Re: [HACKERS] Modules

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: Mattias Kregert <matti(at)algonet(dot)se>
Cc: David Gould <dg(at)illustra(dot)com>, Darren King <darrenk(at)insightdist(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Modules
Date: 1998-03-30 06:32:49
Message-ID: 351F3C91.D6F79352@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> All this would be done by the init function in the module you load.
> What we need is a set of functions callable by modules, like
> module_register_type(name, descr, func*, textin*, textout*, whatever
> ...)
> module_register_smgr(name, descr, .....)
> module_register_command(....
> Casts would be done by converting to a common format (text) and then to
> the desired type. Use textin/textout. No special cast functions would
> have to exist. Why doesn't it work this way already??? Would not that
> solve all casting problems?

It does work this way already, at least in some cases. It definitely
does not solve casting problems, for several reasons, two of which are:
- textout->textin is inefficient compared to binary conversions.
- type conversion also may require value and format manipulation far
beyond what you would accept for an input function for a specific type.
That is, to convert a type to another type may require a conversion
which would not be acceptable in any case other than a conversion from
that specific type to the target type. You need to call a specialized
routine to do this.

> Dependencies are checked by the OS kernel when you try to unload
> modules. You cannot unload slhc without first unloading ppp, for
> example. What's the difference?

Granularity. If, for example, we had a package of 6 types and 250
functions, you would need to check each of these for dependencies. David
was just pointing out that it isn't as easy, not that it is impossible.
I thought his list of issues was fairly complete, and any solution would
address these somehow...

- Tom

In response to

  • Modules at 1998-03-28 13:05:11 from Mattias Kregert

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas G. Lockhart 1998-03-30 06:42:36 Re: [PORTS] Port Bug Report: pg_dump -d database >unload.file; cat unload.file|psql database ARE NOT EQUAL
Previous Message Bruce Momjian 1998-03-30 05:16:16 Re: Let's talk up 6.3